Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain valid Magistrala API session token
-
DeliverySend crafted HTTP GET to message-readers endpoint with malicious `format` parameter
-
ExploitUnsanitized value passed to fmt.Sprintf() SQL construction
-
ExecutionInjected SQL executed against PostgreSQL or TimescaleDB backend
-
ImpactExfiltrate 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 |
| 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
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.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
More in Magistrala
View allAuthenticated SQL injection in the timescale-reader and postgres-reader HTTP APIs of Magistrala before 1.0.0 lets any us
Cross-tenant authorization bypass in Magistrala through 1.0.0 allows any authenticated member of a workspace to view, is
EUVD-2026-53361
GHSA-pwc8-43hr-jg4j
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB