MITM based Zip Slip in `ca.uhn.hapi.fhir:org.hl7.fhir.core`GHSA-jqh6-9574-5x22
CRITICALFix: hapifhir/org.hl7.fhir.core@b50aec5GHSA-jqh6-9574-5x22 is a critical-severity (CVSS 9.1) Path Traversal vulnerability in ca.uhn.hapi.fhir:org.hl7.fhir.core. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for ca.uhn.hapi.fhir:org.hl7.fhir.core — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-jqh6-9574-5x22.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
ca.uhn.hapi.fhir:org.hl7.fhir.core☕ca.uhn.hapi.fhir:org.hl7.fhir.convertors☕ca.uhn.hapi.fhir:org.hl7.fhir.r4b☕ca.uhn.hapi.fhir:org.hl7.fhir.r5☕ca.uhn.hapi.fhir:org.hl7.fhir.utilities☕ca.uhn.hapi.fhir:org.hl7.fhir.validationReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Impact
MITM can enable Zip-Slip.
Vulnerability
Vulnerability 1: Scanner.java
There is no validation that the zip file being unpacked has entries that are not maliciously writing outside of the intended destination directory. https://github.com/hapifhir/org.hl7.fhir.core/blob/8c43e21094af971303131efd081503e5a112db4b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/Scanner.java#L335-L357
This zip archive is downloaded over HTTP instead of HTTPS, leaving it vulnerable to compromise in-flight. https://github.com/hapifhir/org.hl7.fhir.core/blob/8c43e21094af971303131efd081503e5a112db4b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/Scanner.java#L136
Vulnerability 2: TerminologyCacheManager.java
Note: While these links point to only one implementation, both implementations of TerminologyCacheManager.java are vulnerable to this as their code seems to be duplicated.
- https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/TerminologyCacheManager.java
- https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/TerminologyCacheManager.java
While there is validation in this bit of logic that attempts to validate that the zip file doesn't contain malicious entries that escape the destination directory, the guard is insufficient.
This is because the Utilities.path(String... path) method does not normalize the path, although it seems to be attempting to do so.
https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java#L617-L675
The normalization only occurs if the path element starts with a path traversal payload. As an example, calling Utilities.path("/base", "/child/../test") will return the string "/base/child/../test".
This guard logic can, thus, be easily bypassed: https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/TerminologyCacheManager.java#L100-L104
Assuming an attacker can control the return value of ze.getName(), they can supply a value like /anything/../../../../zipsip-protection-bypass.txt.
Similarly, an attacker can control the contents of the Zip file via a MITM attack as this logic is used with resources not downloaded over HTTPS.
Patches
Unknown
Workarounds
Unknown
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.core | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.core:5.6.92 |
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.convertors | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.convertors:5.6.92 |
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.r4b | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.r4b:5.6.92 |
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.r5 | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.r5:5.6.92 |
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.utilities | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.utilities:5.6.92 |
| ☕Maven | ca.uhn.hapi.fhir:org.hl7.fhir.validation | all versions | 5.6.92ca.uhn.hapi.fhir:org.hl7.fhir.validation:5.6.92 |
Affected Products
hl7 fhir corehapifhirfhir ig publisherhl7Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ca.uhn.hapi.fhir:org.hl7.fhir.core, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ca.uhn.hapi.fhir:org.hl7.fhir.core to 5.6.92 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-jqh6-9574-5x22 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is GHSA-jqh6-9574-5x22 in your dependencies?
Find it across Maven, including transitive dependencies.