Skip to content

SQL Injection in DHIS2 Tracker API

High
amcgee published GHSA-fj38-585h-hxgj Jun 24, 2021

Package

dhis2-core

Affected versions

2.34.4,2.35.2,2.35.3,2.35.4,2.36.0

Patched versions

2.34.5,2.35.5,2.36.1

Description

Improper neutralization of special elements used in an SQL command
('SQL Injection') vulnerability in the Tracker component in DHIS2 Server allows authenticated remote attackers to execute arbitrary SQL commands via unspecified vectors.

Impact

A serious SQL injection security vulnerability has been found in specific versions of DHIS2. This vulnerability affects the /api/trackedEntityInstances API endpoint in DHIS2 versions 2.34.4, 2.35.2, 2.35.3, 2.35.4, and 2.36.0.

Earlier versions, such as 2.34.3 and 2.35.1 and all versions 2.33 and older are unaffected.

The system is vulnerable to attack only from users that are logged in to DHIS2, and there is no known way of exploiting the vulnerability without first being logged in as a DHIS2 user.

The vulnerability is not exposed to a non-malicious user - the vulnerability requires a conscious attack to be exploited.

A successful exploit of this vulnerability could allow the malicious user to read, edit and delete data in the DHIS2 instance.

There are no known exploits of the security vulnerabilities addressed by these patch releases. However, we strongly recommend that all DHIS2 implementations using versions 2.34, 2.35 and 2.36 install these patches as soon as possible.

Patches

Security patches are now available for the following DHIS2 versions:

v2.34.4 -- Update to v2.34.5
v2.35.2, v2.35.3, v2.35.4 -- Update to v2.35.5
v2.36.0 -- Update to v2.36.1

These patches address a critical security vulnerability. If your DHIS2 system is using one of the versions listed above, you should download and install the appropriate patch version immediately. All latest patch versions are available for download at dhis2.org/downloads.

Workarounds

There is no straightforward known workaround for DHIS2 instances using the Tracker functionality other than upgrading the affected DHIS2 server to one of the patches in which this vulnerability has been fixed. For implementations which do NOT use Tracker functionality, it may be possible to block all network access to POST to the /api/trackedEntityInstance endpoint as a temporary workaround while waiting to upgrade.

References

These updates are the first product of the newly formed DHIS2 Security team. You can read more about the process for identifying and reviewing potential security vulnerabilities on our website: dhis2.org/security

For more information

If you have any questions or comments about this advisory:

Severity

High
8.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2021-32704

Weaknesses