SQL injection in DHIS2 dhis2-core SqlView filters enables arbitrary database reads

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-55084?

CVE-2026-55084 is a vulnerability classified as Improper Neutralization of Special Elements used in an SQL Command, affecting dhis2-core (affected versions: >= 2.37, <= 2.39, >= 2.40.0, < 2.40.11.1, and other affected versions). This vulnerability is rated High, with a CVSS score of 8.8. Current sources do not report this vulnerability as exploited.

Overview

Original source data

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

Affected products and scope

  • dhis2-core 2.37, 2.38 and 2.39 are affected. The advisory lists 2.37-EOS, 2.38-EOS and 2.39-EOS as the patched versions, each dated 2026-06-09.
  • The 2.40.x branch is affected before 2.40.11.1 or 2.40.12. The structured affected data records >= 2.40.0, < 2.40.11.1, while the CNA advisory lists both patch boundaries for this branch.
  • The 2.41.x branch is affected before 2.41.8.2.
  • The 2.42.x branch is affected before 2.42.5.1.
  • The 2.43.x branch is affected before 2.43.0.1, with the structured affected range recorded as >= 2.43.0, < 2.43.0.1.
  • The 2.44 development branch is affected before PR #24162 and is described by the advisory as patched after that PR. The status of other branches is not confirmed by the record and should not be inferred from the listed fixes.

Technical details

DHIS2 dhis2-core accepts the filter parameter through GET /api/sqlViews/{viewId}/data.json. The attacker controls this parameter, while the application concatenates the filter column name into the generated SQL expression in DefaultSqlViewService.getFilterQuery instead of handling it as a safely constrained identifier.

  1. An authenticated user sends a request to a SqlView that the account is allowed to access.
  2. User-controlled input reaches the column-name position in the generated WHERE clause.
  3. PostgreSQL evaluates the injected SQL expression. The disclosed regression tests describe both SQL insertion through the column-name slot and PostgreSQL type-cast errors that reflect data in the application error message.
  4. The attacker can use the error output to extract arbitrary database content.

The fix addresses this location by wrapping the column name with SqlUtils.quote(), causing the supplied string to be treated as a single identifier rather than as part of the SQL statement. The database privileges used by the application server, the accessible tables and the ability to perform write or disruptive statements are not fully established by the record.

Exploitability

  • Reachability: The flaw is exposed through a network-accessible API endpoint.
  • Authentication: The attacker needs an authenticated session and access to at least one SqlView. Administrative privileges are not required.
  • Interaction and complexity: The supplied record characterizes the attack as requiring no user interaction and having low complexity.
  • Status: The supplied record marks public exploit as false, while known exploitation is not established. This does not prove that exploitation has never occurred.

Technical impact

Successful exploitation can allow an authenticated application user, without necessarily having administrative privileges, to read data outside the intended SqlView result. The PostgreSQL error behavior provides a feedback channel for extracting arbitrary database content.

The normalized record characterizes confidentiality, integrity and availability impact as high, but the published technical material directly demonstrates SQL execution and data extraction most clearly. The ability to write or delete data, or to disrupt service, depends on the database account privileges and is not documented with a specific scenario. The actual data scope must be assessed separately for each deployment.

Business impact

The directly confirmed consequence is loss of database confidentiality because an attacker can extract arbitrary content through reflected application errors. Depending on the deployment, exposed rows could include operational or health-related information, but the record does not identify specific tables or records.

The advisory describes arbitrary SQL query execution, so data modification or service disruption may be possible when the database account and query context permit it. However, the record does not demonstrate a specific write or outage scenario. An application account without administrative privileges can still provide a sufficient starting point if it is allowed to access a SqlView.

Remediation

  1. Upgrade each branch to the exact corresponding fix: 2.40.11.1 or 2.40.12 for 2.40.x; 2.41.8.2 for 2.41.x; 2.42.5.1 for 2.42.x; and 2.43.0.1 for 2.43.x.
  2. For the 2.37, 2.38 and 2.39 branches, deploy 2.37-EOS, 2.38-EOS and 2.39-EOS respectively, as listed by the advisory. These releases are recorded with the date 2026-06-09.
  3. For the 2.44 development branch, apply the change after PR #24162, which quotes the SQL View filter column name with SqlUtils.quote().
  4. After updating, verify that the SqlView endpoint is running the fixed code and that regression coverage for the filter path no longer reproduces SQL injection.
  5. The record does not provide a vendor-confirmed workaround. Until patching is possible, reducing access to SqlViews and the related endpoint may be used as a compensating control, but it is not a code fix and does not remove the underlying flaw.

Detection

  1. Inventory every DHIS2 dhis2-core deployment and identify its release branch, then compare it with the affected and fixed boundaries in affected_summary.
  2. Identify accounts that can execute or read SqlViews, especially non-administrative accounts that can call the SqlView data endpoint.
  3. Review access logs for GET /api/sqlViews/{viewId}/data.json, focusing on requests with unusual filter values or responses containing PostgreSQL errors, type-cast errors or error messages that include query data.
  4. If request parameters are logged, look for filter values containing SQL syntax that is inconsistent with ordinary column names or filters. Treat this as an investigation signal based on the disclosed mechanism, not as a validated IOC.
  5. Correlate application error responses with database activity to determine whether data was reflected externally. Do not treat the absence of log evidence as proof that the system is safe.
Sources (16)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.