GitHub Advisoryadvisory · npm
GHSA-38gf-rh2w-gmj7 @cyclonedx/cyclonedx-library Improper Restriction of XML External Entity Reference vulnerability
HIGH
Official page ↗
- Aliases
- CVE-2024-34345
- Ecosystem
- npm
- Packages
- @cyclonedx/cyclonedx-library
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-611
- Reviewed
- 2024-05-08
Affected packages
• npm @cyclonedx/cyclonedx-library: >= 6.7.0, < 6.7.1 → fixed in 6.7.1
Description
Impact
XML External entity injections could be possible, when running the provided XML Validator on arbitrary input.
POC
```js
const {
Spec: { Version },
Validation: { XmlValidator }
} = require('@cyclonedx/cyclonedx-library');
const version = Version.v1dot5;
const validator = new XmlValidator(version);
const input = `
]>
testing
1.337
&xxe;
`;
// 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 .
Related
Alias · CVE (1)
- CVE-2024-34345 The CycloneDX JavaScript library contains the core functionality of OWASP CycloneDX for JavaScript. vulnerability
Weakness · CWE (1)
- CWE-611 Improper Restriction of XML External Entity Reference weakness
References
- https://github.com/CycloneDX/cyclonedx-javascript-library/security/advisories/GHSA-38gf-rh2w-gmj7 web
- https://nvd.nist.gov/vuln/detail/CVE-2024-34345 advisory
- https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1063 web
- https://github.com/CycloneDX/cyclonedx-javascript-library/commit/5e5e1e0b9422f47d2de81c7c4064b803a01e7203 web
- https://github.com/CycloneDX/cyclonedx-javascript-library package