Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
PR:L for required device-list auth; C:H for arbitrary DB read via SELECT-path injection; I:N as tag-filter queries expose no write path.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
Lifecycle Timeline
1DescriptionCVE.org
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.
AnalysisAI
SQL injection in ChirpStack's SQLite-backend device tag filtering exposes the full database contents to any authenticated user with device-list access. The flaw lives in chirpstack/src/storage/device.rs within both get_count() and list(), where the tag KEY is concatenated into raw SQL via Rust's format!() macro while only the tag VALUE receives safe parameterization through Diesel's .bind(). Only deployments using the chirpstack-sqlite package are affected - the PostgreSQL backend uses Diesel's native JSONB containment operator and is architecturally immune. No public exploit code or CISA KEV listing has been identified at time of analysis.
Technical ContextAI
ChirpStack is an open-source LoRaWAN Network Server stack commonly deployed in IoT environments. The vulnerable code uses Diesel ORM's dsl::sql() escape hatch to construct a raw SQL fragment for SQLite JSONB-style key lookup: dsl::sql::<Bool>(&format!("device.tags->>'{}' =", k)).bind::<Text, _>(v). Because SQLite does not support PostgreSQL's native @> JSONB containment operator, the developers adopted a raw-string workaround - but failed to parameterize the key component k, leaving it open to injection. The value v is safely bound via a Diesel parameter placeholder. CWE-89 (SQL Injection) applies precisely: user-controlled input reaches a SQL interpreter without sanitization or parameterization. The CPE string cpe:2.3:a:chirpstack:chirpstack:*:*:*:*:*:*:*:* covers all versions with no lower or upper bound specified.
RemediationAI
No vendor-released patched version has been identified at time of analysis - monitor the upstream repository at https://github.com/chirpstack/chirpstack and the specific file https://github.com/chirpstack/chirpstack/blob/master/chirpstack/src/storage/device.rs for a code fix. The most effective immediate remediation is to migrate from the chirpstack-sqlite backend to the PostgreSQL backend, which is architecturally immune to this vulnerability; this is a configuration-level change but may require data migration effort. If migration is not immediately feasible, restrict device-list access permissions to only trusted, vetted users, since exploitation requires an authenticated account with that specific permission; reducing the pool of eligible attackers limits exposure but does not eliminate the vulnerability. Audit existing ChirpStack SQLite database contents and API access logs for anomalous query patterns that may indicate prior exploitation. The correct code-level fix requires replacing the format!() key interpolation with a Diesel parameterized binding for the key component.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
Same weakness CWE-89 – SQL Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-53367
GHSA-9g5q-g36m-7qqq