Skip to content

Possible XML External Entity injection via upload of CycloneDX BOMs in XML format

Moderate
nscuro published GHSA-7r6q-xj4c-37g4 Jun 24, 2024

Package

maven org.dependencytrack:dependency-track (Maven)

Affected versions

>= 3.6.0, < 4.11.4

Patched versions

4.11.4

Description

Impact

Dependency-Track uses the org.cyclonedx:cyclonedx-core-java library to validate and parse CycloneDX Bill of Materials. Before parsing a BOM in XML format, cyclonedx-core-java versions before 9.0.4 leverage XPath expressions to determine the schema version of the BOM. The DocumentBuilderFactory used to evaluate XPath expressions was not configured securely, making the library, and in consequence Dependency-Track, vulnerable to XML External Entity (XXE) injection.

As of version 4.11.0, Dependency-Track validates uploaded BOMs against the CycloneDX schema prior to processing them. Unfortunately, the logic to determine the correct schema version for validation made the same mistake as cyclonedx-core-java, rendering it vulnerable, too.

In order to upload BOMs to Dependency-Track, clients must authenticate, and have the BOM_UPLOAD permission.

Exploitation of XXE injections for information disclosure primarily relies on error messages containing (parts of) the file being targeted for exfiltration.

Dependency-Track does not surface XML parsing errors to clients:

  • With the BOM validation feature (introduced in version 4.11.0) enabled, a failure in parsing the uploaded BOM is responded to with a generic BOM is neither valid JSON nor XML message.
  • With the BOM validation feature disabled, the BOM is only parsed during asynchronous processing, at which point the client is no longer involved.

It is possible to impact availability by uploading BOMs that reference external entities on a remote system that never responds or responds slowly. This way, application threads can be kept busy waiting for responses, causing a service degradation of the Dependency-Track system.

Patches

The vulnerability has been fixed in Dependency-Track version 4.11.4.

Workarounds

  • The import of BOMs can be disabled completely in the administration panel, via Configuration -> BOM Formats -> Enable CycloneDX.
  • Review which teams and users have the BOM_UPLOAD permission, potentially revoking it until a a fixed version is deployed.
  • Review and potentially revoke API keys that haven't been used in a while.

References

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L

CVE ID

CVE-2024-38515

Weaknesses

Credits