Skip to content

Commit a060ef1

Browse files
authored
Merge branch 'main' into issue_781
2 parents 11fbb83 + af159c8 commit a060ef1

25 files changed

+14641
-265
lines changed

.github/actions/spelling/allow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ pacman
260260
palletsprojects
261261
pcsc
262262
pdf
263+
PDFs
263264
pdftotext
264265
pdxjohnny
265266
peb
@@ -296,6 +297,7 @@ realpython
296297
rebasing
297298
refactoring
298299
regex
300+
reportlab
299301
Romi
300302
rossburton
301303
rpmfile

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,38 @@ Vulnerability Exchange (VEX) format by specifying `--vex` command line option.
9898
The generated VEX file can then be used as an `--input-file` to support
9999
a triage process.
100100

101+
If you wish to use PDF support, you will need to install the `reportlab`
102+
library separately.
103+
104+
If you intend to use PDF support when you install cve-bin-tool you can specify it and report lab will be installed as part of the cve-bin-tool install:
105+
```console
106+
pip install cve-bin-tool[PDF]
107+
```
108+
109+
If you've already installed cve-bin-tool you can add reportlab after the fact
110+
using pip:
111+
112+
```console
113+
pip install --upgrade reportlab
114+
```
115+
116+
Note that reportlab was taken out of the default cve-bin-tool install because
117+
it has a known CVE associated with it
118+
([CVE-2020-28463](https://nvd.nist.gov/vuln/detail/CVE-2020-28463)). The
119+
cve-bin-tool code uses the recommended mitigations to limit which resources
120+
added to PDFs, as well as additional input validation. This is a bit of a
121+
strange CVE because it describes core functionality of PDFs: external items,
122+
such as images, can be embedded in them, and thus anyone viewing a PDF could
123+
load an external image (similar to how viewing a web page can trigger external
124+
loads). There's no inherent "fix" for that, only mitigations where users of
125+
the library must ensure only expected items are added to PDFs at the time of
126+
generation.
127+
128+
Since users may not want to have software installed with an open, unfixable CVE
129+
associated with it, we've opted to make PDF support only available to users who
130+
have installed the library themselves. Once the library is installed, the PDF
131+
report option will function.
132+
101133
## Full option list
102134

103135
Usage:
@@ -110,6 +142,8 @@ Usage:
110142
--disable-version-check
111143
skips checking for a new version
112144
--detailed display detailed report
145+
--disable-validation-check
146+
skips checking xml files against schema
113147
--offline operate in offline mode
114148

115149
CVE Data Download:

cve_bin_tool/checkers/xml2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def guess_xml2_version(lines):
6060
new_guess2 = match.group(1).strip()
6161
if len(new_guess2) > len(new_guess):
6262
new_guess = new_guess2
63-
# If no version guessed, set version to UNKNOWN
63+
# If no version guessed, set version to "UNKNOWN"
6464
return new_guess or "UNKNOWN"
6565

6666
def get_version(self, lines, filename):

cve_bin_tool/cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ def main(argv=None):
261261
help="skips checking for a new version",
262262
default=False,
263263
)
264+
parser.add_argument(
265+
"--disable-validation-check",
266+
action="store_true",
267+
help="skips checking xml files against schema",
268+
)
264269
parser.add_argument(
265270
"--offline",
266271
action="store_true",
@@ -559,6 +564,7 @@ def main(argv=None):
559564
should_extract=args["extract"],
560565
exclude_folders=args["exclude"],
561566
error_mode=error_mode,
567+
validate=not args["disable_validation_check"],
562568
)
563569
version_scanner.remove_skiplist(skips)
564570
LOGGER.info(f"Number of checkers: {version_scanner.number_of_checkers()}")
@@ -579,7 +585,10 @@ def main(argv=None):
579585
if args["sbom_file"]:
580586
# Process SBOM file
581587
sbom_list = SBOMManager(
582-
args["sbom_file"], sbom_type=args["sbom"], logger=LOGGER
588+
args["sbom_file"],
589+
sbom_type=args["sbom"],
590+
logger=LOGGER,
591+
validate=not args["disable_validation_check"],
583592
)
584593
parsed_data = sbom_list.scan_file()
585594
LOGGER.info(

0 commit comments

Comments
 (0)