Dhis 2Application · Dhis2

CVE-2023-31139

HIGH · 7.5 CVSS v3.1 Published 2023-05-09
Fix available
A fix is available. Upgrade to 2.37.9.1 / 2.38.3.1 or later.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
DHIS2 Core contains the service layer and Web API for DHIS2, an information system for data capture. Starting in the 2.37 branch and prior to versions 2.37.9.1, 2.38.3.1, and 2.39.1.2, Personal Access Tokens (PATs) generate unrestricted session cookies. This may lead to a bypass of other access restrictions (for example, based on allowed IP addresses or HTTP methods). DHIS2 implementers should upgrade to a supported version of DHIS2: 2.37.9.1, 2.38.3.1, or 2.39.1.2. Implementers can work around this issue by adding extra access control validations on a reverse proxy.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Personal Access Tokens (PATs) in DHIS2 Core generate unrestricted session cookies that bypass access controls based on IP addresses or HTTP methods. This allows authenticated users with PATs to circumvent configured security restrictions.

MitigationUpgrade DHIS2 to version 2.37.9.1, 2.38.3.1, or 2.39.1.2 to receive the patch. Alternatively, implement additional access control validation at the reverse proxy layer as a compensating control.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Dhis 2Application
Affected:>= 2.37.0, < 2.37.9.1>= 2.38.0, < 2.38.3.1>= 2.39.0, < 2.39.1.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Determine DHIS2 version
    Query the DHIS2 API system info endpoint at /api/system/info or check the WAR file name in the deployment directory. Alternatively, check the dhis.conf file for version information.
    Affected if The installed version falls within the affected ranges: 2.37.0 to 2.37.9.0, 2.38.0 to 2.38.3.0, or 2.39.0 to 2.39.1.1.
  2. Verify if Personal Access Tokens are in use
    Check the DHIS2 database for entries in the oauth_client table or query the /api/oAuth2Clients endpoint if accessible. PATs are stored as oauth clients with grant_type 'refresh_token'.
    Affected if PATs have been created and are actively used for API authentication.
  3. Confirm IP-based access restrictions are configured
    Inspect the dhis.conf file for 'system.ip_ranges' or 'security.ip_ranges' settings. Check if any IP whitelisting or blacklisting rules are defined in the DHIS2 security configuration.
    Affected if IP-based access controls are configured but the system relies on DHIS2 session cookies for enforcement.
  4. Check HTTP method restrictions
    Review any configured HTTP method restrictions in the application server (Tomcat) configuration, reverse proxy (nginx/apache), or DHIS2 security settings that limit certain HTTP methods by user or token type.
    Affected if HTTP method restrictions are configured but rely on session cookie validation that PATs bypass.

You are affected if your DHIS2 version is within the vulnerable ranges AND you use Personal Access Tokens while relying on IP-based or HTTP method access controls for security.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 2.37.9.1 / 2.38.3.1 / 2.39.1.2 or later
Fixed in 2.37.9.12.38.3.12.39.1.2
Interim mitigation

Upgrade DHIS2 to version 2.37.9.1, 2.38.3.1, or 2.39.1.2 to receive the patch. Alternatively, implement additional access control validation at the reverse proxy layer as a compensating control.

Recommended fix High confidence

2.37.9.1 (for 2.37.x) or 2.38.3.1 (for 2.38.x) or 2.39.1.2 (for 2.39.x)

  1. 1. Identify the currently running DHIS2 version using the /api/system/info endpoint or the About dialog in the UI
  2. 2. Based on your current version branch, plan upgrade to the appropriate fixed release: 2.37.9.1 for 2.37.x, 2.38.3.1 for 2.38.x, or 2.39.1.2 for 2.39.x
  3. 3. Review the DHIS2 upgrade guide and release notes for your target version to understand any prerequisites
  4. 4. Perform a full backup of the database and DHIS2 configuration files before proceeding
  5. 5. Stop the DHIS2 application server
  6. 6. Upgrade DHIS2 to the target fixed version following standard upgrade procedures (typically replacing the DHIS2 WAR file)
  7. 7. Restart the DHIS2 application server
  8. 8. Verify the upgrade was successful by checking the version in /api/system/info

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Dhis 2 Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing4.0 h
  • Review / QA2.0 h
15.0 hours of engineering $2,640
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,224.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-31139 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-31139 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data