CVE-2026-71282

ChirpStack SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter

Published Aug 5, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
ChirpStack's SQLite-backend device tag filtering (chirpstack/src/storage/device.rs, in both get_count and list) interpolates the user-supplied tag KEY directly into a raw SQL fragment via Rust's format! macro , while only the tag VALUE is safely parameter-bound via Diesel's .bind.

Analysis

AI-generated

Technical impact

ChirpStack’s SQLite backend allows authenticated users with device‑list privileges to inject arbitrary SQL by supplying a specially crafted tag key in the device filter of ListDevices. The source of the flaw is the direct interpolation of the tag key into a raw SQL string using Rust’s format!() macro while only the tag value is parameter‑bound, enabling an attacker to execute unintended SQL statements. This classic unsanitised input flaw is identified as CWE-89 and can compromise confidentiality, integrity, and potentially availability of the SQLite database.

Affected Systems

All installations of chirpstack that rely on the SQLite backend (chirpstack-sqlite package) are affected. The PostgreSQL backend remains unaffected because it uses parameterised JSONB operators instead of raw SQL. Deployments where users possess device‑list permissions and the backend is configured as SQLite are vulnerable.

Risk and Exploitability

The CVSS score of 6.5 indicates a high‑impact vulnerability, though the EPSS score of 0.00227 (~0.23%) indicates a very low likelihood of exploitation. The flaw is not listed in the CISA KEV catalog. An attacker needs authenticated access with device‑list privileges to exploit this weakness, using the tag key filter as the injection vector. Once the conditions are met, the injection is straightforward and could allow arbitrary database queries or modifications.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Install the latest ChirpStack release that corrects the raw SQL interpolation of tag keys.
  • Reconfigure the deployment to use the PostgreSQL backend instead of SQLite, eliminating the vulnerability path.
  • If an upgrade or backend change cannot be performed immediately, restrict tag key values to strictly alphanumeric patterns or temporarily disable device‑tag filtering until a patch is applied.

Generated by OpenCVE AI on August 10, 2026 at 20:59 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description ChirpStack's SQLite-backend device tag filtering (chirpstack/src/storage/device.rs, in both get_count() and list()) interpolates the user-supplied tag KEY directly into a raw SQL fragment via Rust's format!() macro (`dsl::sql::<Bool>(&format!("device.tags->>'{}' =", k)).bind::<Text, _>(v)`), while only the tag VALUE is safely parameter-bound via Diesel's .bind(). An authenticated user with device-list access can inject SQL via a crafted tag key when the SQLite backend (chirpstack-sqlite package) is in use; the PostgreSQL backend is unaffected as it uses Diesel's native JSONB containment operator instead of raw SQL string formatting. ChirpStack's SQLite-backend device tag filtering (chirpstack/src/storage/device.rs, in both get_count and list) interpolates the user-supplied tag KEY directly into a raw SQL fragment via Rust's format! macro , while only the tag VALUE is safely parameter-bound via Diesel's .bind.
Title ChirpStack - SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter ChirpStack SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter
Type Values Removed Values Added
Title ChirpStack SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter ChirpStack - SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter
Type Values Removed Values Added
First Time appeared Chirpstack
Chirpstack chirpstack
Vendors & Products Chirpstack
Chirpstack chirpstack
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 ChirpStack's SQLite-backend device tag filtering (chirpstack/src/storage/device.rs, in both get_count() and list()) interpolates the user-supplied tag KEY directly into a raw SQL fragment via Rust's format!() macro (`dsl::sql::<Bool>(&format!("device.tags->>'{}' =", k)).bind::<Text, _>(v)`), while only the tag VALUE is safely parameter-bound via Diesel's .bind(). An authenticated user with device-list access can inject SQL via a crafted tag key when the SQLite backend (chirpstack-sqlite package) is in use; the PostgreSQL backend is unaffected as it uses Diesel's native JSONB containment operator instead of raw SQL string formatting.
Title ChirpStack SQLite Backend SQL Injection via Device Tag Key in ListDevices Filter
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/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:47 AM
Reserved
Aug 5, 2026, 12:23 PM
Status
Deferred
Published
Aug 5, 2026, 1:24 PM
Modified
Aug 26, 2026, 5:13 PM