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.
Published: 2026-08-05
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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 yet.

History

Mon, 10 Aug 2026 12:00:00 +0000

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

Mon, 10 Aug 2026 11:45:00 +0000

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

Fri, 07 Aug 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Absmach
Absmach magistrala
Vendors & Products Absmach
Absmach magistrala

Wed, 05 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 05 Aug 2026 13:15:00 +0000

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'}


Subscriptions

Absmach Magistrala
cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-10T11:46:54.326Z

Reserved: 2026-08-05T12:23:34.967Z

Link: CVE-2026-71276

cve-icon Vulnrichment

Updated: 2026-08-05T15:55:37.916Z

cve-icon NVD

Status : Deferred

Published: 2026-08-05T13:24:52.080

Modified: 2026-08-26T17:13:24.800

Link: CVE-2026-71276

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-10T21:15:07Z

Weaknesses
  • CWE-89

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