Skip to content

Commit 7b8aebd

Browse files
authored
Ignore false positives from osv-scanner (#1005)
* Ignore false positives from osv-scanner OSV prior to version 2.0 is unable to parse pip version specs correctly, as explained by one of the developers in the following comment from January 2025: google/osv-scanner#1483 (comment) The suggested workaround is to configure osv-scanner to ignore the particular cases it complains about. The following are all about NumPy, because osv-scanner can't understand the version spec "numpy>=1.24,<2.0" and therefore raises errors about all versions of NumPy, including very old ones. Ignoring these specific dependencies is okay because we will never use the old versions of NumPy and it doesn't block detection of future new vulnerabilities. * Add configuration file argument to osv-scanner call
1 parent d2e1c1b commit 7b8aebd

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/osv-scanner.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
continue-on-error: true
5858
with:
5959
scan-args: |-
60+
--config=.osv-scanner.toml
6061
--format=json
6162
--output=osv-results.json
6263
--recursive

.osv-scanner.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Summary: config for Open Source Vulnerabilitis Scanner.
2+
# See https://google.github.io/osv-scanner/configuration/ for more info.
3+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
# OSV prior to version 2.0 is unable to parse pip version specs correctly:
6+
# https://github.com/google/osv-scanner/issues/1483#issuecomment-2585999293
7+
# The suggested workaround is to configure osv-scanner to ignore the particular
8+
# cases it complains about. The following are all about NumPy, because
9+
# osv-scanner can't understand the version spec "numpy>=1.24,<2.0" and
10+
# therefore raises errors about all versions of NumPy, including very old ones.
11+
# Ignoring these specific dependencies is okay because we will never use the
12+
# old versions of NumPy and it doesn't block detection of future new
13+
# vulnerabilities.
14+
15+
[[IgnoredVulns]]
16+
id = "PYSEC-2018-34"
17+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
18+
19+
[[IgnoredVulns]]
20+
id = "PYSEC-2021-855"
21+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
22+
23+
[[IgnoredVulns]]
24+
id = "PYSEC-2021-856"
25+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
26+
27+
[[IgnoredVulns]]
28+
id = "PYSEC-2019-108"
29+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
30+
31+
[[IgnoredVulns]]
32+
id = "PYSEC-2018-33"
33+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
34+
35+
[[IgnoredVulns]]
36+
id = "PYSEC-2021-857"
37+
reason = "false positive due to osv-scanner's buggy pip requirements parser"
38+
39+
[[IgnoredVulns]]
40+
id = "PYSEC-2017-1"
41+
reason = "false positive due to osv-scanner's buggy pip requirements parser"

0 commit comments

Comments
 (0)