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

Impact

The vulnerability arises when the message‑readers API processes an unvalidated ‘format’ query parameter and directly interpolates it into SQL statements using fmt.Sprintf. An attacker who is authenticated and has permission to read channel messages can alter the parameter to inject arbitrary SQL, potentially reading from or modifying data stored in the PostgreSQL or TimescaleDB backends.

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 is unavailable, 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 5, 2026 at 14:52 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 5, 2026 at 14:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

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

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

Link: CVE-2026-71276

cve-icon Vulnrichment

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

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-05T15:00:05Z

Weaknesses
  • CWE-89

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