Cross-site Scripting with user-uploaded files in dhis2-core
Description
DHIS 2 is an open source information system for data capture, management, validation, analytics and visualization. Through various features of DHIS2, an authenticated user may be able to upload a file which includes embedded javascript. The user could then potentially trick another authenticated user to open the malicious file in a browser which would trigger the javascript code, resulting in a cross-site scripting (XSS) attack. DHIS2 administrators should upgrade to the following hotfix releases: 2.36.12.1, 2.37.8.1, 2.38.2.1, 2.39.0.1. Users unable to upgrade may add the following simple CSP rule in your web proxy to the vulnerable endpoints: script-src 'none'. This workaround will prevent all javascript from running on those endpoints.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Stored XSS in DHIS2 via file upload allows authenticated attackers to execute arbitrary JavaScript when a victim opens a malicious file.
Vulnerability
An authenticated user in DHIS2 (versions 2.35, 2.36, 2.37, 2.38, and 2.39) can upload a file containing embedded JavaScript through various features. The uploaded file, when opened by another authenticated user in a browser, triggers the malicious script, resulting in a stored cross-site scripting (XSS) vulnerability. The file is served from endpoints such as /documents/, /fileResources/, /events/files, /dataValues/files, /externalFileResources/, /trackedEntityInstances/, and /messageConversations/. The vulnerable versions are 2.36.x before 2.36.12.1, 2.37.x before 2.37.8.1, 2.38.x before 2.38.2.1, and 2.39.x before 2.39.0.1 [2].
Exploitation
The attacker must be an authenticated user with the ability to upload files via DHIS2 features. After uploading a crafted file containing JavaScript, the attacker tricks another authenticated user into opening the file in a browser (e.g., via social engineering or by sharing a link). No further privileges or complex race conditions are required; the file access itself triggers script execution [2].
Impact
Successful exploitation allows the attacker to execute arbitrary JavaScript in the context of the victim's browser session. This can lead to data theft, session hijacking, defacement, or other actions the victim can perform within DHIS2, potentially compromising sensitive health information managed by the system [2].
Mitigation
Fixed versions are 2.36.12.1, 2.37.8.1, 2.38.2.1, and 2.39.0.1. Administrators should upgrade immediately. For users unable to upgrade, a workaround exists: add the CSP header script-src 'none' to the vulnerable endpoints listed in the GHSA. Example configurations for nginx and Apache reverse proxies are provided in the advisory [2]. This workaround blocks all JavaScript execution on those endpoints, mitigating the XSS risk [1].
AI Insight generated on May 25, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2- dhis2/dhis2-corev5Range: < 2.36.12.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
2- developer.mozilla.org/en-US/docs/Web/HTTP/CSPmitrex_refsource_MISC
- github.com/dhis2/dhis2-core/security/advisories/GHSA-763w-rm78-6xcgmitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.