google / osv-scanner

Vulnerability scanner written in Go which uses the data provided by https://osv.dev
https://google.github.io/osv-scanner/
Apache License 2.0
6.11k stars 343 forks source link

Scan manifest files as well (not just lockfiles) #416

Open another-rex opened 1 year ago

another-rex commented 1 year ago

Add the ability to scan manifest files e.g. package.json in addition to package-lock.json. Possibly using deps.dev dependency graph data to scan transitive dependencies.

Motivation: Some projects don't check in their package-lock.json files, breaking automated repo scanning that's done by projects like scorecard. E/.g see #410

Related #352

spencerschrock commented 6 months ago

Would this also help with cases where the project being analyzed is the one with vulnerabilities (as opposed to dependencies)?

For example, consider the archived npm package parsejson, which has an advisory against it.

$ osv-scanner -r .
Scanning dir .
Scanning /tmp/parsejson/ at commit d2986dc30989377409102516ecdebbfd06cbf28f
No issues found

Or is osv-scanner intended to be used only to find vulns in your dependencies, not in the project being analyzed?

another-rex commented 6 months ago

It'll be good to add support to find vulns in the project being analyzed. The only way we are doing it currently is by git commit, which we only really enumerate for C/C++ advisories, which is why osv-scanner did not return a result.

Couple issues I can think of:

github-actions[bot] commented 1 month ago

This issue has not had any activity for 60 days and will be automatically closed in two weeks

github-actions[bot] commented 1 month ago

Automatically closing stale issue