Open prabhu opened 2 months ago
untrusted
codebases.--untrusted
to configure some install commands. Example: for npm, we can pass --ignore-scripts argument. Need to investigate similar capabilities for other package managers.This has now landed in the CVE database and is being reported by GitHub's security tab:
This is a design limitation, without an immediate fix.
Summary
(Rewritten for clarity)
npm install
, maven, gradle, and sbt commandsnpm install
(default behavior unless--no-install-deps
is passed), npm could be invoking more commands as per the scripts section in the package.json file present in the given codebase.POC
Timeline
8 Aug 2024 - Email received from the researcher. 8 Aug 2024 - Initial response: Known acceptable risk that is consistent with executing any CLI command including the package manager commands themselves. 19 Aug 2024 - Researcher shared more details about attacking SCA scanners that wrap cdxgen such as OWASP dep-scan. 26 Aug 2024 - GitHub Issue created.
Known workarounds
-v /tmp:/tmp
and-v $HOME:$HOME
), and a dedicated seccomp profiles.--no-install-deps
or--lifecycle pre-build
to prevent cdxgen from running install commands. This may not work for all package managers.