Summary
MITM based Zip Slip in ca.uhn.hapi.fhir:org.hl7.fhir.core
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.
Workarounds
Unknown
References
Impact
MITM can enable Zip-Slip.
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2023-24057 has a CVSS score of 9.1 (Critical). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.6.92); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Unknown
Frequently Asked Questions
- What is CVE-2023-24057? CVE-2023-24057 is a critical-severity path traversal vulnerability in ca.uhn.hapi.fhir:org.hl7.fhir.core (maven), affecting versions < 5.6.92. It is fixed in 5.6.92. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- How severe is CVE-2023-24057? CVE-2023-24057 has a CVSS score of 9.1 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2023-24057?
ca.uhn.hapi.fhir:org.hl7.fhir.core(maven) (versions < 5.6.92)ca.uhn.hapi.fhir:org.hl7.fhir.convertors(maven) (versions < 5.6.92)ca.uhn.hapi.fhir:org.hl7.fhir.r4b(maven) (versions < 5.6.92)ca.uhn.hapi.fhir:org.hl7.fhir.r5(maven) (versions < 5.6.92)ca.uhn.hapi.fhir:org.hl7.fhir.utilities(maven) (versions < 5.6.92)ca.uhn.hapi.fhir:org.hl7.fhir.validation(maven) (versions < 5.6.92)
- Is there a fix for CVE-2023-24057? Yes. CVE-2023-24057 is fixed in 5.6.92. Upgrade to this version or later.
- Is CVE-2023-24057 exploitable, and should I be worried? Whether CVE-2023-24057 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-24057 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-24057?
- Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.coreto 5.6.92 or later - Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.convertorsto 5.6.92 or later - Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.r4bto 5.6.92 or later - Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.r5to 5.6.92 or later - Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.utilitiesto 5.6.92 or later - Upgrade
ca.uhn.hapi.fhir:org.hl7.fhir.validationto 5.6.92 or later
- Upgrade