Skip to content

Commit e8d0cb1

Browse files
authored
feat(checker): add xpdf checker (#4815)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent e606a1a commit e8d0cb1

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@
403403
"wpa_supplicant",
404404
"xerces",
405405
"xml2",
406+
"xpdf",
406407
"xscreensaver",
407408
"xwayland",
408409
"xz",

cve_bin_tool/checkers/xpdf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for xpdf
7+
8+
https://www.cvedetails.com/product/60729/Glyphandcog-Xpdf.html?vendor_id=19912
9+
https://www.cvedetails.com/product/55299/Glyphandcog-Xpdfreader.html?vendor_id=19912
10+
https://www.cvedetails.com/product/43745/Xpdfreader-Xpdf.html?vendor_id=17664
11+
https://www.cvedetails.com/product/118819/Xpdf-Project-Xpdf.html?vendor_id=28048
12+
13+
"""
14+
from __future__ import annotations
15+
16+
from cve_bin_tool.checkers import Checker
17+
18+
19+
class XpdfChecker(Checker):
20+
CONTAINS_PATTERNS: list[str] = []
21+
FILENAME_PATTERNS: list[str] = []
22+
VERSION_PATTERNS = [r"Xpdf[a-zA-Z0-9:* \-\r\n]*([0-9]+\.[0-9]+)\r?\n"]
23+
VENDOR_PRODUCT = [
24+
("glyphandcog", "xpdf"),
25+
("glyphandcog", "xpdfreader"),
26+
("xpdfreader", "xpdf"),
27+
("xpdf_project", "xpdf"),
28+
]
76.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/xpdf.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "xpdf", "version": "3.04", "version_strings": ["Xpdf\n3.04"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/x/",
10+
"package_name": "xpdf-4.05-6.fc42.aarch64.rpm",
11+
"product": "xpdf",
12+
"version": "4.05",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/x/xpdf/",
16+
"package_name": "xpdf_3.04-13_amd64.deb",
17+
"product": "xpdf",
18+
"version": "3.04",
19+
},
20+
{
21+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/",
22+
"package_name": "xpdf-3.04-r4.apk",
23+
"product": "xpdf",
24+
"version": "3.04",
25+
},
26+
]

0 commit comments

Comments
 (0)