Skip to content

Commit bb5e7ac

Browse files
committed
Scan vendored npm via its installed bundle tree
Special-case deps/npm to avoid npm audit on npm's workspace source checkout. When deps/npm has a valid installed tree, run npm ls --omit=dev --all --json, walk the packages reachable from bundleDependencies, and query GitHub advisories using exact installed versions. This keeps the scan aligned with the vendored npm payload instead of trying to synthesize a lockfile from the workspace checkout. Also: - normalize GitHub advisory ranges such as '= 8.0.0' before version matching - prefer CVE identifiers when GitHub exposes one, otherwise fall back to GHSA - add regression coverage for the deps/npm path.
1 parent b59f203 commit bb5e7ac

3 files changed

Lines changed: 398 additions & 155 deletions

File tree

dep_checker/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def main() -> int:
378378

379379
from npm_audit import NPMAuditChecker
380380
print("Running npm package vulnerability audit...", file=sys.stderr)
381-
npm_checker = NPMAuditChecker(repo_path, npm_timeout)
381+
npm_checker = NPMAuditChecker(repo_path, npm_timeout, gh_token=gh_token)
382382
npm_vulnerabilities = npm_checker.check_npm_vulnerabilities(Vulnerability)
383383
if npm_checker.failed_packages:
384384
scan_complete = False

0 commit comments

Comments
 (0)