CVE-2023-28465
Description
The package-decompression feature in HL7 (Health Level 7) FHIR Core Libraries before 5.6.106 allows attackers to copy arbitrary files to certain directories via directory traversal, if an allowed directory name is a substring of the directory name chosen by the attacker. NOTE: this issue exists because of an incomplete fix for CVE-2023-24057.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ca.uhn.hapi.fhir:org.hl7.fhir.coreMaven | < 5.6.106 | 5.6.106 |
ca.uhn.hapi.fhir:org.hl7.fhir.convertorsMaven | < 5.6.106 | 5.6.106 |
ca.uhn.hapi.fhir:org.hl7.fhir.r4bMaven | < 5.6.106 | 5.6.106 |
ca.uhn.hapi.fhir:org.hl7.fhir.r5Maven | < 5.6.106 | 5.6.106 |
ca.uhn.hapi.fhir:org.hl7.fhir.utilitiesMaven | < 5.6.106 | 5.6.106 |
ca.uhn.hapi.fhir:org.hl7.fhir.validationMaven | < 5.6.106 | 5.6.106 |
Affected products
6- ghsa-coords6 versionspkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.convertorspkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.corepkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.r4bpkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.r5pkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.utilitiespkg:maven/ca.uhn.hapi.fhir/org.hl7.fhir.validation
< 5.6.106+ 5 more
- (no CPE)range: < 5.6.106
- (no CPE)range: < 5.6.106
- (no CPE)range: < 5.6.106
- (no CPE)range: < 5.6.106
- (no CPE)range: < 5.6.106
- (no CPE)range: < 5.6.106
Patches
Vulnerability mechanics
Root cause
"Incomplete path validation in Utilities.path() allows directory traversal when an attacker-chosen directory name is a substring of an allowed directory name."
Attack vector
An attacker crafts a malicious FHIR package (e.g., an NPM package) containing a zip entry with a path that uses `../` traversal sequences. If the attacker's chosen directory name is a substring of an allowed directory name, the previous validation could be bypassed. The attacker supplies the malicious package to the package-decompression feature, which calls `Utilities.path()` to construct the output path. Because the path construction did not verify that the final resolved path still starts with the intended base directory, the attacker could write files to arbitrary directories on the filesystem [patch_id=1640911].
Affected code
The vulnerability resides in the `Utilities.path()` method within `org.hl7.fhir.utilities`. The incomplete fix for CVE-2023-24057 allowed directory traversal when an attacker-supplied directory name is a substring of an allowed directory name. The patch adds validation in `Utilities.path()` to reject computed paths that do not start with the first path element, preventing traversal outside the intended base directory.
What the fix does
The fix adds validation in `Utilities.path()` that checks whether the computed path starts with the first path element provided. If the computed path does not start with that first element, a `RuntimeException` is thrown, preventing directory traversal. The patch also adds extensive parameterized tests covering Windows root paths (e.g., `C:\`), macOS/Linux root paths (e.g., `/`), and non-first-element start paths to ensure the validation works correctly across platforms [patch_id=1640911]. The release version was bumped from `5.6.106-SNAPSHOT` to `5.6.106` [patch_id=1640906].
Preconditions
- inputThe attacker must supply a malicious FHIR NPM package (or other archive) containing zip entries with directory traversal sequences.
- configThe target application must use the package-decompression feature of HL7 FHIR Core Libraries before version 5.6.106.
- configAn allowed directory name must be a substring of the directory name chosen by the attacker for the traversal to bypass the earlier incomplete fix.
Generated on May 23, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-9654-pr4f-gh6mghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-28465ghsaADVISORY
- github.com/hapifhir/org.hl7.fhir.core/blob/b0daf666725fa14476d147522155af1e81922aac/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/terminologies/TerminologyCacheManager.javaghsaWEB
- github.com/hapifhir/org.hl7.fhir.core/pull/1162ghsaWEB
- github.com/hapifhir/org.hl7.fhir.core/releases/tag/5.6.106ghsaWEB
- github.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-9654-pr4f-gh6mghsaWEB
- www.smilecdr.com/our-blogghsaWEB
- www.smilecdr.com/our-blog/statement-on-cve-2023-24057-smile-digital-healthghsaWEB
News mentions
0No linked articles in our index yet.