Skip to content

Commit

Permalink
fix: improve lua checker
Browse files Browse the repository at this point in the history
Improve lua checker to avoid false positives with haproxy, nmap, vim and
wireshark binaries which link dynamically with lua library (and save
the associated version number)

While at it, add an OpenWRT test package

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Dec 14, 2023
1 parent 098a96f commit 4ff0ca3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cve_bin_tool/checkers/lua.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class LuaChecker(Checker):
r"-o name output to file `name' \(default is \"luac.out\"\)",
]
FILENAME_PATTERNS = [r"lua"]
VERSION_PATTERNS = [r"Lua ([0-9]+\.[0-9]+\.[0-9]+)"]
VERSION_PATTERNS = [r"Lua ([0-9]+\.[0-9]+\.[0-9]+) "]
VENDOR_PRODUCT = [("lua", "lua")]
Binary file not shown.
3 changes: 1 addition & 2 deletions test/test_data/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"package_name": "haproxy-1.8.4-2.fc28.x86_64.rpm",
"product": "haproxy",
"version": "1.8.4",
"other_products": ["gcc", "lua"],
"other_products": ["gcc"],
},
{
"url": "https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/",
Expand All @@ -33,7 +33,6 @@
"package_name": "haproxy_2.6.6-1_arm64.deb",
"product": "haproxy",
"version": "2.6.6",
"other_products": ["lua"],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
Expand Down
6 changes: 6 additions & 0 deletions test/test_data/lua.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@
"product": "lua",
"version": "5.0.3",
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/",
"package_name": "liblua5.1.5_5.1.5-3_x86_64.ipk",
"product": "lua",
"version": "5.1.5",
},
]
1 change: 0 additions & 1 deletion test/test_data/nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"package_name": "nmap_7.40-1_amd64.deb",
"product": "nmap",
"version": "7.40",
"other_products": ["lua"],
},
{
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
Expand Down
1 change: 0 additions & 1 deletion test/test_data/vim.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"package_name": "vim-enhanced-9.0.1429-1.fc38.aarch64.rpm",
"product": "vim",
"version": "9.0.1429",
"other_products": ["lua"],
},
{
"url": "http://ftp.de.debian.org/debian/pool/main/v/vim/",
Expand Down
1 change: 0 additions & 1 deletion test/test_data/wireshark.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@
"package_name": "libwireshark16_4.0.3-1_amd64.deb",
"product": "wireshark",
"version": "4.0.3",
"other_products": ["lua"],
},
]

0 comments on commit 4ff0ca3

Please sign in to comment.