CVE-2024-51132: Org.hl7.fhir.convertors HAPI FHIR XML External Entity Vulnerability

HIGH
Advisory Identifier: GHSA-4cf2-cxp3-rjr7
CVSS 9.8
CWE-601 CWE-611
Published
Advisory Summary

CVE-2024-51132 is a HIGH (CVSS 9.8) hapi fhir xml external entity vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Org.hl7.fhir.convertors libraries in the Maven ecosystem. The issue involves hapi fhir xml external entity (xxe) vulnerability. Remediation is available by upgrading affected packages to version 6.4.0.

CVE-2024-51132 at a Glance

CVE Identifier CVE-2024-51132
GHSA Identifier GHSA-4cf2-cxp3-rjr7
Severity HIGH
CVSS v3.1 Base Score 9.8
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Org.hl7.fhir.convertors
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:U/C:H/I:H/A:H).

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

How to Fix CVE-2024-51132

To remediate this vulnerability, upgrade all affected Org.hl7.fhir.convertors 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.convertors fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.convertors</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.dstu2</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.dstu2016may</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.dstu3 fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.dstu3</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r4 fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r4</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r4b fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r4b</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.r5 fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.r5</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.utilities fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.utilities</artifactId>
    <version>6.4.0</version>
</dependency>
ca.uhn.hapi.fhir:org.hl7.fhir.validation fixed: 6.4.0
<dependency>
    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>org.hl7.fhir.validation</artifactId>
    <version>6.4.0</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-51132, 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.convertors in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.4.0), 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Org.hl7.fhir.convertors, 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

An XML External Entity (XXE) vulnerability in HAPI FHIR before v6.4.0 allows attackers to access sensitive information or execute arbitrary code via supplying a crafted request containing malicious XML entities.

CVE-2024-51132 Affected Org.hl7.fhir.convertors Versions

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

References

Frequently Asked Questions

What is CVE-2024-51132?
CVE-2024-51132 is a security vulnerability in Org.hl7.fhir.convertors involving HAPI FHIR XML External Entity (XXE) vulnerability under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Org.hl7.fhir.convertors versions are affected?
Affected versions include releases prior to 6.4.0 across affected packages: ca.uhn.hapi.fhir:org.hl7.fhir.convertors, ca.uhn.hapi.fhir:org.hl7.fhir.dstu2, 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, ca.uhn.hapi.fhir:org.hl7.fhir.validation.
What version fixes CVE-2024-51132?
Upgrading to 6.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.hl7.fhir.convertors affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.convertors is affected in releases prior to 6.4.0. Upgrade your dependency to 6.4.0 or later.
Is org.hl7.fhir.dstu2 affected?
Yes, ca.uhn.hapi.fhir:org.hl7.fhir.dstu2 is affected in releases prior to 6.4.0. Upgrade your dependency to 6.4.0 or later.
What is the CVSS score of CVE-2024-51132?
CVE-2024-51132 has a CVSS v3.1 base score of 9.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-51132?
CVE-2024-51132 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Maven dependencies for CVE-2024-51132?
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-4cf2-cxp3-rjr7",
  "modified" : "2024-11-06T23:38:37Z",
  "published" : "2024-11-05T18:32:11Z",
  "aliases" : [ "CVE-2024-51132" ],
  "summary" : "HAPI FHIR XML External Entity (XXE) vulnerability",
  "details" : "An XML External Entity (XXE) vulnerability in HAPI FHIR before v6.4.0 allows attackers to access sensitive information or execute arbitrary code via supplying a crafted request containing malicious XML entities.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.convertors"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r4b"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.r5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.utilities"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ca.uhn.hapi.fhir:org.hl7.fhir.validation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-51132"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core/commit/7ede053a5fca50cc2802884c661a241d51703a67"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JAckLosingHeart/CVE-2024-51132-POC"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapifhir/org.hl7.fhir.core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601", "CWE-611" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-05T18:56:08Z",
    "nvd_published_at" : "2024-11-05T17:15:07Z"
  }
}