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. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.05% (18th percentile)

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 Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-CYCLONEDXCDXGEN-8309366
  • published28 Oct 2024
  • disclosed27 Oct 2024
  • creditUnknown

Introduced: 27 Oct 2024

CVE-2024-50611  (opens in a new tab)
CWE-94  (opens in a new tab)

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