Summary
PoC
import org.cyclonedx.parsers.XmlParser;
class Poc {
public static void main(String[] args) {
// Will throw org.cyclonedx.exception.ParseException: java.net.ConnectException: Connection refused
new XmlParser().parse("""
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bom [<!ENTITY % sp SYSTEM "https://localhost:1010/does-not-exist/file.dtd"> %sp;]>
<bom xmlns="http://cyclonedx.org/schema/bom/1.5"/>
""".getBytes());
}
}
Workarounds
If feasible, applications can reject XML documents before handing them to cyclonedx-core-java for parsing.
This may be an option if incoming CycloneDX BOMs are known to be in JSON format.
References
- Issue was fixed via https://github.com/CycloneDX/cyclonedx-core-java/pull/434
- Issue was introduced via https://github.com/CycloneDX/cyclonedx-core-java/commit/162aa594f347b3f612fe0a45071693c3cd398ce9
- https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing
- https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xpathexpression
Impact
Before deserializing CycloneDX Bill of Materials in XML format, cyclonedx-core-java leverages XPath expressions to determine the schema version of the BOM. The DocumentBuilderFactory used to evaluate XPath expressions was not configured securely, making the library vulnerable to XML External Entity (XXE) injection.
XXE injection can be exploited to exfiltrate local file content, or perform Server Side Request Forgery (SSRF) to access infrastructure adjacent to the vulnerable application.
An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs. Typical impact: local file disclosure, server-side request forgery, or denial of service.
CVE-2024-38374 has a CVSS score of 7.5 (High). The vector is network-reachable, no 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 (9.0.4); 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.
Remediation advice
The vulnerability has been fixed in cyclonedx-core-java version 0.9.4.
Frequently Asked Questions
- What is CVE-2024-38374? CVE-2024-38374 is a high-severity XML external entity injection (XXE) vulnerability in org.cyclonedx:cyclonedx-core-java (maven), affecting versions >= 2.1.0, < 9.0.4. It is fixed in 9.0.4. An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs.
- How severe is CVE-2024-38374? CVE-2024-38374 has a CVSS score of 7.5 (High). 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 versions of org.cyclonedx:cyclonedx-core-java are affected by CVE-2024-38374? org.cyclonedx:cyclonedx-core-java (maven) versions >= 2.1.0, < 9.0.4 is affected.
- Is there a fix for CVE-2024-38374? Yes. CVE-2024-38374 is fixed in 9.0.4. Upgrade to this version or later.
- Is CVE-2024-38374 exploitable, and should I be worried? Whether CVE-2024-38374 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-2024-38374 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-2024-38374? Upgrade
org.cyclonedx:cyclonedx-core-javato 9.0.4 or later.