CVE-2026-71276

Magistrala (formerly Mainflux) IoT Platform SQL Injection via format Query Parameter

Published Aug 5, 2026 CVSS 3.1 · 7.1 High EPSS < 1% KEV · Not listed
Description
Magistrala (formerly Mainflux)'s message-readers API reads a 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: ) and the TimescaleDB reader (readers/timescale/messages.go, same pattern), enabling SQL injection by any authenticated user able to query channel messages.

Analysis

AI-generated

Technical impact

The updated details describe that Magistrala's message‑readers API accepts a ‘format’ query parameter without validation, and directly interpolates it into SQL queries using fmt.Sprintf. Because the parameter is used by any authenticated user who can read channel messages, an attacker can craft a malicious value to execute arbitrary SQL commands against the PostgreSQL or TimescaleDB backends, leading to data disclosure or tampering.

Affected Systems

The affected product is Magistrala (formerly Mainflux) as supplied by absmach. The injection flaw exists in both the PostgreSQL and TimescaleDB reader modules of the message‑readers API; specific version data is not provided.

Risk and Exploitability

With a CVSS score of 7.1, the weakness is considered high severity. The EPSS score of 0.00191 (< 1%) indicates a very low but non-zero probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog. The attack requires authentication but does not mandate elevated privileges; any user who can query channel messages can exploit the flaw, suggesting a setting of the vulnerability that is limited to users with existing reading rights. The lack of protection via parameterized queries makes exploitation straightforward for an attacker with the necessary access.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Magistrala to the latest release that includes a fix for the format parameter validation.
  • Implement input validation to restrict the ‘format’ parameter to an allowlist of legitimate table or column names before constructing the query.
  • Modify the code to use parameterized/prepared statements instead of fmt.Sprintf to build SQL, thereby eliminating the injection vector.

Generated by OpenCVE AI on August 10, 2026 at 21:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description 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. Magistrala (formerly Mainflux)'s message-readers API reads a 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: ) and the TimescaleDB reader (readers/timescale/messages.go, same pattern), enabling SQL injection by any authenticated user able to query channel messages.
Title Magistrala IoT Platform - SQL Injection via format Query Parameter Magistrala (formerly Mainflux) IoT Platform SQL Injection via format Query Parameter
Type Values Removed Values Added
Title Magistrala (formerly Mainflux) IoT Platform SQL Injection via format Query Parameter Magistrala IoT Platform - SQL Injection via format Query Parameter
Type Values Removed Values Added
First Time appeared Absmach
Absmach magistrala
Vendors & Products Absmach
Absmach magistrala
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Magistrala (formerly Mainflux) IoT Platform SQL Injection via format Query Parameter
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
TuranSec
Published
Updated
Aug 10, 2026, 11:46 AM
Reserved
Aug 5, 2026, 12:23 PM
Status
Deferred
Published
Aug 5, 2026, 1:24 PM
Modified
Oct 23, 2026, 9:10 PM