Skip to content

fix: fix xerces CPE ID #2932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cve_bin_tool/checkers/xerces.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CVE checker for libxerces

References:
http://www.cvedetails.com/vulnerability-list/vendor_id-45/product_id-4103/Apache-Xerces-c-.html
https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.3&orderBy=2.3&keyword=cpe%3A2.3%3Aa%3Aapache%3Axerces-c%5C%2B%5C%2B&status=FINAL

RSS feed: http://www.cvedetails.com/vulnerability-feed.php?vendor_id=45&product_id=4103&version_id=&orderby=2&cvssscoremin=0
"""
Expand All @@ -20,4 +20,4 @@ class XercesChecker(Checker):
r"\/xerces-c-src_([0-9]+_[0-9]+_[0-9]+)\/",
r"xercesc_([0-9]+\_[0-9]+):",
]
VENDOR_PRODUCT = [("apache", "xerces-c")]
VENDOR_PRODUCT = [("apache", "xerces-c\\+\\+")]
1 change: 1 addition & 0 deletions test/test_available_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def test_long_debian_available_fix_output(
"avahi: CVE-2011-1002 has available fix in v0.6.28-4 release.",
"avahi: CVE-2017-6519 has available fix in v0.7-5 release.",
"avahi: CVE-2021-26720 has available fix in v0.8-4 release.",
"avahi: CVE-2021-3468 has available fix in v0.8-5+deb11u2 release.",
]

assert expected_output == [rec.message for rec in caplog.records]
Expand Down
4 changes: 2 additions & 2 deletions test/test_data/xerces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

mapping_test_data = [
{
"product": "xerces-c",
"product": "xerces-c\\+\\+",
"version": "3.1.1",
"version_strings": ["/xerces-c-src_3_1_1/"],
}
Expand All @@ -12,7 +12,7 @@
{
"url": "http://mirror.centos.org/centos/7/os/x86_64/Packages/",
"package_name": "xerces-c-3.1.1-10.el7_7.x86_64.rpm",
"product": "xerces-c",
"product": "xerces-c\\+\\+",
"version": "3.1",
}
]
4 changes: 2 additions & 2 deletions test/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ def test_version_mapping(self, product, version, version_strings):
f"{'.'.join(list(product))}-{version}.out",
]
for filename in filenames:
# Replace space in filename to avoid a failure on Windows
# Replace colon and backslash in filename to avoid a failure on Windows
with tempfile.NamedTemporaryFile(
"w+b",
suffix=filename.replace(":", "_"),
suffix=filename.replace(":", "_").replace("\\", "_"),
dir=self.mapping_test_dir,
delete=False,
) as f:
Expand Down