VYPR
High severityNVD Advisory· Published Dec 12, 2023· Updated May 27, 2025

CVE-2023-28465

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.

PackageAffected versionsPatched versions
ca.uhn.hapi.fhir:org.hl7.fhir.coreMaven
< 5.6.1065.6.106
ca.uhn.hapi.fhir:org.hl7.fhir.convertorsMaven
< 5.6.1065.6.106
ca.uhn.hapi.fhir:org.hl7.fhir.r4bMaven
< 5.6.1065.6.106
ca.uhn.hapi.fhir:org.hl7.fhir.r5Maven
< 5.6.1065.6.106
ca.uhn.hapi.fhir:org.hl7.fhir.utilitiesMaven
< 5.6.1065.6.106
ca.uhn.hapi.fhir:org.hl7.fhir.validationMaven
< 5.6.1065.6.106

Affected products

6

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

News mentions

0

No linked articles in our index yet.