Arbitrary Code Injection Affecting @cyclonedx/cdxgen package, versions >=0.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-CYCLONEDXCDXGEN-8309366
  • published 28 Oct 2024
  • disclosed 27 Oct 2024
  • credit Unknown

How to fix?

There is no fixed version for @cyclonedx/cdxgen.

Overview

@cyclonedx/cdxgen is a Creates CycloneDX Software Bill of Materials (SBOM) from source or container image

Affected versions of this package are vulnerable to Arbitrary Code Injection when run against an untrusted codebase, allowing execution of code contained within build-related files such as build.gradle.kts.

Note: This is a design limitation without an immediate fix.

Workaround

  1. Run cdxgen using the container image with limited volume mounts, random TEMP directories (avoid -v /tmp:/tmp and -v $HOME:$HOME), and a dedicated seccomp profiles.

  2. Use the argument --no-install-deps or --lifecycle pre-build to prevent cdxgen from running install commands. This may not work for all package managers.

  3. Do not run cdxgen against untrusted codebases and with sudo/administrative privileges.

  4. Use cdxgen with deno runtime.

References

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
8.6 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    High
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    High
  • Integrity (VI)
    High
  • Availability (VA)
    High
  • Confidentiality (SC)
    None
  • Integrity (SI)
    None
  • Availability (SA)
    None