From ebd94360fbd85bb066397a21f5ba87c8457fe308 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Wed, 2 Jul 2025 08:33:34 +0200 Subject: [PATCH] fix: improve iptables checker Update iptables checker to avoid returning a false positive with the following string: 0.0.0.0 iptables -t nat -D Signed-off-by: Fabrice Fontaine --- cve_bin_tool/checkers/iptables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cve_bin_tool/checkers/iptables.py b/cve_bin_tool/checkers/iptables.py index ab8357bce1..b4a80cb3c3 100644 --- a/cve_bin_tool/checkers/iptables.py +++ b/cve_bin_tool/checkers/iptables.py @@ -17,7 +17,7 @@ class IptablesChecker(Checker): CONTAINS_PATTERNS: list[str] = [] FILENAME_PATTERNS: list[str] = [] VERSION_PATTERNS = [ - r"\r?\n([0-9]{1,2}\.[0-9]+\.[0-9]+\.?[0-9]*)\r?\niptables", + r"\r?\n([1-9]{1,2}\.[0-9]+\.[0-9]+\.?[0-9]*)\r?\niptables", r"iptables-([0-9]+\.[0-9]+\.[0-9]+\.?[0-9]*)", r"iptables-rules>[a-zA-Z %:\r\n]*([0-9]+\.[0-9]+\.[0-9]+\.?[0-9]*)", r"iptables-save v%s on %s\r?\n([0-9]+\.[0-9]+\.[0-9]+\.?[0-9]*)",