Skip to main content

Magistrala CVE-2026-71276

| EUVDEUVD-2026-53361 HIGH
SQL Injection (CWE-89)
2026-08-05 TuranSec GHSA-pwc8-43hr-jg4j
7.1
CVSS 3.1 · Vendor: TuranSec
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain valid Magistrala API session token
  2. Delivery
    Send crafted HTTP GET to message-readers endpoint with malicious `format` parameter
  3. Exploit
    Unsanitized value passed to fmt.Sprintf() SQL construction
  4. Execution
    Injected SQL executed against PostgreSQL or TimescaleDB backend
  5. Impact
    Exfiltrate contents of arbitrary database tables

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a valid authenticated Magistrala account with permission to query channel messages via the message-readers HTTP API - PR:L per the CVSS vector confirms authentication is required. No elevated privileges beyond a standard user session are needed, and no special platform configuration or non-default feature flag must be enabled; the vulnerable fmt.Sprintf() code path executes for any authenticated channel-message query that includes a format parameter. Exploitation is limited by: (1) the mandatory authenticated session, reducing exposure compared to unauthenticated flaws; (2) injection at the SQL identifier (table name) position rather than a WHERE-clause value, which constrains available injection techniques and may require stacked-query support from the underlying Go PostgreSQL driver; (3) network-layer restrictions - environments where the message-readers API is not externally reachable reduce exposure to internal or service-account threats only.

Impact

The CVSS 7.1 score (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N) accurately reflects a network-accessible, low-complexity flaw requiring only a low-privilege authenticated session. The PR:L requirement is the primary real-world limiting factor: unauthenticated exploitation is not possible per the CVSS vector, reducing mass-exploitation risk compared to PR:N flaws. However, in IoT deployments where many device accounts or service users hold API credentials, this is not a strong deterrent. No EPSS probability data was provided, preventing quantitative exploitation likelihood assessment. KEV status is not confirmed and no POC has been publicly disclosed, so exploitation remains theoretical at time of analysis. The I:L rating (rather than I:H) suggests the injection mechanism may have constrained write-path impact - possibly due to the table-name injection position limiting DML mutation compared to WHERE-clause injection - though the exact driver behavior governs this. The wildcard CPE indicates no known safe version exists, which elevates urgency despite the absence of a confirmed public exploit. This is a genuine priority for Magistrala operators, not a high-CVSS-but-low-real-risk case, given that data exfiltration via C:H is well-supported by the described code pattern.

Exploit ScenarioDerived

An authenticated Magistrala user with channel-read permissions sends a crafted GET request to the message-readers API endpoint, supplying a malicious value for the format query parameter - for example, injecting a subquery or UNION-based payload in the table-name position. The Go fmt.Sprintf() call passes the unsanitized value directly to the PostgreSQL or TimescaleDB query executor, returning rows from unintended database tables or triggering further SQL operations. No public exploit code has been identified at time of analysis, but the injection point is straightforward to identify via the publicly referenced source file.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 05, 2026

SQL injection in Magistrala's message-readers API exposes PostgreSQL and TimescaleDB backends to arbitrary query manipulation by any authenticated platform user. The unvalidated format HTTP query parameter is interpolated directly into raw SQL at the table-name identifier position via Go's fmt.Sprintf() in both readers/postgres/messages.go and readers/timescale/messages.go, enabling exfiltration of database contents with high confidentiality impact (CVSS C:H). The wildcard CPE (cpe:2.3:a:absmach:magistrala:*) indicates all known versions are affected; no vendor-released patch has been confirmed in available references, and no public exploit code or CISA KEV listing has been identified at time of analysis.

RemediationAI

No vendor-released patch has been identified at time of analysis - available references point only to the upstream repository and vulnerable source files, with no fixed release or security advisory noted. Operators should immediately restrict access to the message-readers API endpoint to the minimum set of authenticated principals required, enforced at the API gateway or network-policy layer. As a code-level compensating control, developers should implement strict allowlist validation on the format parameter before it reaches the SQL construction path - reject any value not matching the exact set of expected table identifiers using a map or switch statement; do not use regex alone, as bypass risk exists. Since PostgreSQL does not support parameterized identifiers, driver-level escaping is insufficient and the allowlist is the only sound fix. Monitor the upstream repository at https://github.com/absmach/magistrala for a patched release. Enabling PostgreSQL statement-level logging can help detect exploitation attempts in the interim.

Affected VersionsENISA

magistrala 0 ≤*

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Magistrala (formerly Mainflux) is an open-source IoT messaging and device-management platform by absmach. The vulnerability is a CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) flaw originating in the HTTP transport layer at readers/api/http/transport.go, which reads the format query string parameter and passes it unsanitized downstream. Both the PostgreSQL reader (readers/postgres/messages.go) and TimescaleDB reader (readers/timescale/messages.go) construct raw SQL using the pattern fmt.Sprintf("SELECT * FROM %s WHERE %s ...", format, cond). Because the injection occurs at the SQL identifier (table name) position rather than a value position, standard parameterized query drivers cannot protect against it - PostgreSQL does not support bind parameters for identifiers. This means the only correct fix is allowlist validation of the format value before query construction. Depending on the Go PostgreSQL driver configuration, stacked queries or subquery-based exfiltration techniques may be feasible.

Know when Magistrala gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (TuranSec) PRIMARY 7.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
vuln.today AI 7.1 HIGH

Network-accessible API requires only a low-privilege authenticated session (PR:L); table-name injection position constrains write-path impact to I:L; no availability impact in a read-path query context.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (TuranSec).

CVSS VectorVendor: TuranSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

DescriptionCVE.org

Magistrala (formerly Mainflux)'s message-readers API reads a format value from the HTTP query string (readers/api/http/transport.go) with no validation and interpolates it directly into raw SQL queries via fmt.Sprintf() in both the PostgreSQL reader (readers/postgres/messages.go: fmt.Sprintf("SELECT * FROM %s WHERE %s ...", format, cond)) and the TimescaleDB reader (readers/timescale/messages.go, same pattern), enabling SQL injection by any authenticated user able to query channel messages.

Executive ViewAI

Why It Matters

Magistrala's message-readers API contains a security flaw (CVE-2026-71276) that enables any authenticated user to exfiltrate database contents, creating insider threat risk across the organization. All versions are affected with no vendor patch available; however, no public exploit has been identified at time of analysis, providing a limited window to implement compensating controls. Immediate protective measures and contingency planning for system replacement are essential to protect sensitive data.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: (1) restrict API access via firewall rules to authorized clients only, (2) implement least-privilege database roles to limit query scope, (3) enable comprehensive database query logging and real-time alerting for anomalous access patterns, (4) temporarily disable the message-readers API endpoint if not operationally critical, and (5) conduct regular access reviews to minimize authenticated user scope.

Threat Intelligence Overview

EPSS Score
0.2%
Top 91% exploitable
Prevalence
Low
niche open-source IoT messaging platform, limited enterprise footprint
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy