]> code.ossystems Code Review - openembedded-core.git/commitdiff
cve-check: CPE version '-' as all version
authorLee Chee Yang <chee.yang.lee@intel.com>
Tue, 31 Mar 2020 07:26:03 +0000 (15:26 +0800)
committerArmin Kuster <akuster808@gmail.com>
Sun, 17 May 2020 16:01:23 +0000 (09:01 -0700)
CPE version could be '-' to mean no version info.
Current cve_check treat it as not valid and does not report these
CVE but some of these could be a valid vulnerabilities.

Since non-valid CVE can be whitelisted, so treat '-' as all version
and report all these CVE to capture possible vulnerabilities.

Non-valid CVE to be whitelisted separately.

[YOCTO #13617]

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c69ee3594079589d27c10db32bc288566ebde9ef)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/cve-check.bbclass
meta/recipes-core/meta/cve-update-db-native.bb

index 01b363746991a11979a47d225669bd781a9a1d81..0ab022b1359ca1a2709f35157d63d153b8009955 100644 (file)
@@ -214,7 +214,7 @@ def check_cves(d, patched_cves):
                 (_, _, _, version_start, operator_start, version_end, operator_end) = row
                 #bb.debug(2, "Evaluating row " + str(row))
 
-                if (operator_start == '=' and pv == version_start):
+                if (operator_start == '=' and pv == version_start) or version_start == '-':
                     vulnerable = True
                 else:
                     if operator_start:
index 575254af40cc03f8843b3c58011cfbfc564fd7f7..1b4f31692ba168325136c2f1222e872ad9f58711 100644 (file)
@@ -122,7 +122,7 @@ def parse_node_and_insert(c, node, cveId):
             product = cpe23[4]
             version = cpe23[5]
 
-            if version != '*':
+            if version != '*' and version != '-':
                 # Version is defined, this is a '=' match
                 yield [cveId, vendor, product, version, '=', '', '']
             else: