Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Network-reachable API, low complexity, no interaction, but requires an authenticated user holding SqlView access (PR:L); arbitrary SQL injection enables data read, modification and DoS, so C/I/A all High.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
4DescriptionCVE.org
DHIS2 is a flexible information system for data capture, management, validation, analytics and visualization. A SQL injection vulnerability was identified in the SqlView API endpoint of the DHIS2 application in the filter parameter used by the /api/sqlViews/{viewId}/data.json endpoint. An authenticated user with access to a SqlView can inject arbitrary SQL queries inside the filter parameter by abusing an expression executed by PostgreSQL and its output is reflected inside the application error message. This behavior enables attackers to extract arbitrary database content using error-based SQL injection.
Affected versions include: 2.37, 2.38, 2.39, 2.40.x before 2.40.11.1/2.40.12, 2.41.x before 2.41.8.2, 2.42.x before 2.42.5.1, 2.43.0 before 2.43.0.1, 2.44 development branch before PR #24162 Patched versions include: 2.37-EOS (2026-06-09), 2.38-EOS (2026-06-09), 2.39-EOS (2026-06-09), 2.40.11.1, 2.40.12, 2.41.8.2, 2.42.5.1, 2.43.0.1, 2.44 development branch after PR #24162
AnalysisAI
Error-based SQL injection in the DHIS2 core SqlView API (the filter parameter of /api/sqlViews/{viewId}/data.json) lets an authenticated user who has access to a SqlView inject arbitrary SQL that PostgreSQL evaluates, with the result reflected in the application error message to exfiltrate arbitrary database content. It affects DHIS2 core across the 2.37 through 2.44 lines (2.37-2.39 reached end-of-support on 2026-06-09), and the root cause is an unquoted column name concatenated into the query, fixed in PR #24162 by wrapping it in SqlUtils.quote(). There is no public exploit identified at time of analysis and no CISA KEV listing, but the vendor-issued GHSA advisory and CVSS 8.8 mark it as a high-priority patch for any DHIS2 instance where SqlView access is broadly granted.
Technical ContextAI
DHIS2 is an open-source health information platform (dhis2-core, Java/Spring backed by a PostgreSQL database) used for data capture, validation, analytics and visualization, most prominently across national ministry-of-health deployments. The SqlView feature lets privileged users define and run stored SQL views; the data.json endpoint accepts a filter parameter compiled into a WHERE clause. The flaw is CWE-89 (Improper Neutralization of Special Elements used in an SQL Command): per the PR #24162 diff to DefaultSqlViewService.getFilterQuery(), the columnName derived from the filter was concatenated directly into the SQL string rather than quoted, so a crafted filter can inject a PostgreSQL expression whose evaluation error surfaces data back to the caller - classic error-based extraction. The affected component is identified by CPE cpe:2.3:a:dhis2:dhis2-core:*:*:*:*:*:*:*:* and the tags PostgreSQL, SQLi, and Dhis2 Core. Note: the same PR also adds an unrelated ObjectInputFilter deserialization hardening to HibernateUserSettingStore, which is defense-in-depth and not the SQLi fix itself.
RemediationAI
Vendor-released patch: upgrade to 2.40.11.1 or 2.40.12, 2.41.8.2, 2.42.5.1, or 2.43.0.1 depending on your branch (2.44 development builds must include PR #24162 or later); see GHSA-pwmg-mvjw-4m23 at https://github.com/dhis2/dhis2-core/security/advisories/GHSA-pwmg-mvjw-4m23 and the fix at https://github.com/dhis2/dhis2-core/pull/24162. The 2.37, 2.38 and 2.39 branches reached end-of-support on 2026-06-09 and receive no patch, so users on those lines must migrate to a supported release. As compensating controls until patched, revoke or tightly restrict the authorities that grant SqlView access so only trusted administrators retain it, and run the DHIS2 database connection under a least-privilege PostgreSQL role that cannot read or write outside the application schema to limit injected-query impact - the trade-off is that overly restrictive DB grants can break legitimate SqlView execution and analytics. Additionally, restrict network exposure of the /api/sqlViews/ endpoints via reverse-proxy or WAF rules where feasible, accepting that this may impede legitimate API-driven reporting.
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-46360