8.1high
MITM based Zip Slip in `ca.uhn.hapi.fhir:org.hl7.fhir.core`
- Severity
- 8.1high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 1.22% (higher than 69% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-jqh6-9574-5x22GHSA-xr8x-pxm6-prjg
Description
HL7 (Health Level 7) FHIR Core Libraries before 5.6.92 allow attackers to extract files into arbitrary directories via directory traversal from a crafted ZIP or TGZ archive (for a prepackaged terminology cache, NPM package, or comparison archive).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| ca.uhn.hapi.fhir:org.hl7.fhir.core (Maven) | before 5.6.92 | GitHub Advisory Database |
| ca.uhn.hapi.fhir:org.hl7.fhir.convertors (Maven) | before 5.6.92 | GitHub Advisory Database |
| ca.uhn.hapi.fhir:org.hl7.fhir.r4b (Maven) | before 5.6.92 | GitHub Advisory Database |
| ca.uhn.hapi.fhir:org.hl7.fhir.r5 (Maven) | before 5.6.92 | GitHub Advisory Database |
| ca.uhn.hapi.fhir:org.hl7.fhir.utilities (Maven) | before 5.6.92 | GitHub Advisory Database |
| ca.uhn.hapi.fhir:org.hl7.fhir.validation (Maven) | before 5.6.92 | GitHub Advisory Database |
| org.hl7.fhir.publisher:org.hl7.fhir.publisher (Maven) | before 1.2.30 | GitHub Advisory Database |
| hapifhir hl7_fhir_core | before 5.6.92 | NVD |
| hl7 fhir_ig_publisher | before 1.2.30 | NVD |
All scores
| CISA-ADP | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
| NVD | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
HL7 (Health Level 7) FHIR Core Libraries before 5.6.92 allow attackers to extract files into arbitrary directories via directory traversal from a crafted ZIP or TGZ archive (for a prepackaged terminology cache, NPM package, or comparison archive).
GitHub Advisory Database
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
GitHub Advisory Database
Impact
MITM can enable Zip-Slip.
Vulnerability
Vulnerability 1: Publisher.java
There is no validation that the zip file being unpacked has entries that are not maliciously writing outside of the intended destination directory.
Vulnerability 2: WebSourceProvider.java
There is a check for malicious zip entries here, but it is not covered by test cases and could potentially be reverted in future changes.
Vulnerability 3: ZipFetcher.java
This retains the path for Zip files in FetchedFile entries, which could later be used to output malicious entries to another compressed file or file system.
Vulnerability 4: IGPack2NpmConvertor.java
The loadZip method retains the path for entries in the zip file, which could later be used to output malicious entries to another compressed file or file system.
NVD (es)
Las librerías Core de HL7 (Health Level 7) FHIR anteriores a 5.6.92 permiten a los atacantes extraer archivos en directorios arbitrarios a través de un directory traversal desde un archivo ZIP o TGZ manipulado (para un caché de terminología preempaquetado, un paquete NPM o un archivo de comparación).
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-24057 changed 2025-04-01 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jqh6-9574-5x22 changed 2026-07-08 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-xr8x-pxm6-prjg changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2023-24057 changed 2026-06-17 | Public domain |