CVE-2023-24057
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
ca.uhn.hapi.fhir:org.hl7.fhir.core (Maven)before 5.6.92GitHub Advisory Database
ca.uhn.hapi.fhir:org.hl7.fhir.convertors (Maven)before 5.6.92GitHub Advisory Database
ca.uhn.hapi.fhir:org.hl7.fhir.r4b (Maven)before 5.6.92GitHub Advisory Database
ca.uhn.hapi.fhir:org.hl7.fhir.r5 (Maven)before 5.6.92GitHub Advisory Database
ca.uhn.hapi.fhir:org.hl7.fhir.utilities (Maven)before 5.6.92GitHub Advisory Database
ca.uhn.hapi.fhir:org.hl7.fhir.validation (Maven)before 5.6.92GitHub Advisory Database
org.hl7.fhir.publisher:org.hl7.fhir.publisher (Maven)before 1.2.30GitHub Advisory Database
hapifhir hl7_fhir_corebefore 5.6.92NVD
hl7 fhir_ig_publisherbefore 1.2.30NVD

All scores

CISA-ADP8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
NVD8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-22

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.

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.

https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/TerminologyCacheManager.java#L97-L113

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.

https://github.com/hapifhir/org.hl7.fhir.core/blob/f58b7acfb5e393cac52cc5bbb170bdb669c2880e/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/TerminologyCacheManager.java#L66-L73

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.

https://github.com/HL7/fhir-ig-publisher/blob/87313e92de6dd6cea816449e0edd225e054a7891/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/Publisher.java#L3598-L3610

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.

https://github.com/HL7/fhir-ig-publisher/blob/87313e92de6dd6cea816449e0edd225e054a7891/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/web/WebSourceProvider.java#L104-L112

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.

https://github.com/HL7/fhir-ig-publisher/blob/87313e92de6dd6cea816449e0edd225e054a7891/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/ZipFetcher.java#L57-L106

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.

https://github.com/HL7/fhir-ig-publisher/blob/87313e92de6dd6cea816449e0edd225e054a7891/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/IGPack2NpmConvertor.java#L442-L463

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

SourceRecordLicence
CVE ListCVE-2023-24057 changed 2025-04-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-jqh6-9574-5x22 changed 2026-07-08CC-BY-4.0
GitHub Advisory DatabaseGHSA-xr8x-pxm6-prjg changed 2026-07-08CC-BY-4.0
NVDCVE-2023-24057 changed 2026-06-17Public domain