CVE-2024-45294: Org.hl7.fhir.dstu2016may XXE Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-6cr6-ph3p-f5rf
CVSS 8.6
CWE-611
Published
Advisory Summary

CVE-2024-45294 is a HIGH (CVSS 8.6) xxe vulnerability vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Org.hl7.fhir.dstu2016may libraries in the Maven ecosystem. The issue involves xxe vulnerability in xslt transforms in `org.hl7.fhir.core`. Remediation is available by upgrading affected packages to version 6.3.23.

CVE-2024-45294 at a Glance

CVE Identifier CVE-2024-45294
GHSA Identifier GHSA-6cr6-ph3p-f5rf
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Org.hl7.fhir.dstu2016may
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-45294

To remediate this vulnerability, upgrade all affected Org.hl7.fhir.dstu2016may dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.dstu2016may</artifactId>
    <version>6.3.23</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.dstu3</artifactId>
    <version>6.3.23</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r4 fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r4</artifactId>
    <version>6.3.23</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r4b fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r4b</artifactId>
    <version>6.3.23</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r5 fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r5</artifactId>
    <version>6.3.23</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.utilities fixed: 6.3.23
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.utilities</artifactId>
    <version>6.3.23</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-45294, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir

Analyze the terminal output to locate any version of Org.hl7.fhir.dstu2016may in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.3.23), your application is affected.

Note: The mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Org.hl7.fhir.dstu2016may, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact XSLT transforms performed by various components are vulnerable to XML external entity injections. A processed XML file with a malicious DTD tag ( `<!DOCTYPE foo [<!ENTITY example SYSTEM "/etc/passwd"> ]>` could produce XML containing data from the host system. This impacts use cases where org.hl7.fhir.core is being used to within a host where external clients can submit XML. ### Patches This issue has been patched in release 6.3.23 ### Workarounds None. ### References [MITRE CWE](https://cwe.mitre.org/data/definitions/611.html) [OWASP XML External Entity Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#transformerfactory)

CVE-2024-45294 Affected Org.hl7.fhir.dstu2016may Versions

6 component(s)
Fixed Versions:
6.3.23
Product / Package Ecosystem Affected Versions Fixed Version
ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may
Maven
< 6.3.23
6.3.23
ca.uhn.hapi.fhir:org.hl7.fhir.dstu3
Maven
< 6.3.23
6.3.23
ca.uhn.hapi.fhir:org.hl7.fhir.r4
Maven
< 6.3.23
6.3.23
ca.uhn.hapi.fhir:org.hl7.fhir.r4b
Maven
< 6.3.23
6.3.23
ca.uhn.hapi.fhir:org.hl7.fhir.r5
Maven
< 6.3.23
6.3.23
ca.uhn.hapi.fhir:org.hl7.fhir.utilities
Maven
< 6.3.23
6.3.23

References

Frequently Asked Questions

What is CVE-2024-45294?
CVE-2024-45294 is a security vulnerability in Org.hl7.fhir.dstu2016may involving XXE vulnerability in XSLT transforms in `org.hl7.fhir.core` under CWE-611: Improper Restriction of XML External Entity Reference.
Which Org.hl7.fhir.dstu2016may versions are affected?
Affected versions include releases prior to 6.3.23 across affected packages: ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may, ca.uhn.hapi.fhir:org.hl7.fhir.dstu3, ca.uhn.hapi.fhir:org.hl7.fhir.r4, ca.uhn.hapi.fhir:org.hl7.fhir.r4b, ca.uhn.hapi.fhir:org.hl7.fhir.r5, ca.uhn.hapi.fhir:org.hl7.fhir.utilities.
What version fixes CVE-2024-45294?
Upgrading to 6.3.23 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.hl7.fhir.dstu2016may affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may is affected in releases prior to 6.3.23. Upgrade your dependency to 6.3.23 or later.
Is org.hl7.fhir.dstu3 affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 is affected in releases prior to 6.3.23. Upgrade your dependency to 6.3.23 or later.
What is the CVSS score of CVE-2024-45294?
CVE-2024-45294 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2024-45294?
CVE-2024-45294 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check Maven dependencies for CVE-2024-45294?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=ca.uhn.hapi.fhir'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6cr6-ph3p-f5rf",
  "modified" : "2024-09-06T19:45:27Z",
  "published" : "2024-09-06T19:45:27Z",
  "aliases" : [ "CVE-2024-45294" ],
  "summary" : "XXE vulnerability in XSLT transforms in `org.hl7.fhir.core`",
  "details" : "### Impact\nXSLT transforms performed by various components are vulnerable to XML external entity injections. A processed XML file with a malicious DTD tag ( `<!DOCTYPE foo [<!ENTITY example SYSTEM \"/etc/passwd\"> ]>` could produce XML containing data from the host system. This impacts use cases where org.hl7.fhir.core is being used to within a host where external clients can submit XML.\n\n### Patches\nThis issue has been patched in release 6.3.23\n\n### Workarounds\nNone.\n\n### References\n[MITRE CWE](https://cwe.mitre.org/data/definitions/611.html)\n[OWASP XML External Entity Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#transformerfactory)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r4b"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.utilities"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.23"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/HL7/fhir-ig-publisher/security/advisories/GHSA-59rq-22fm-x8q5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/security/advisories/GHSA-6cr6-ph3p-f5rf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45294"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/HL7/fhir-ig-publisher/releases/tag/1.6.22"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/releases/tag/6.3.23"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-06T19:45:27Z",
    "nvd_published_at" : "2024-09-06T16:15:03Z"
  }
}