diff options
author | Ross Burton <ross.burton@arm.com> | 2023-06-23 13:32:49 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-07-13 06:42:46 -1000 |
commit | 62727653aa480c23abc289ee7821508df5944d78 (patch) | |
tree | c94184d5f693a233c3500c7e9587d39169270750 /meta/recipes-core | |
parent | fdd68984644184ec8a189ce5e284c151dbba9fde (diff) | |
download | poky-62727653aa480c23abc289ee7821508df5944d78.tar.gz |
cve-update-nvd2-native: handle all configuration nodes, not just first
Some CVEs, such as CVE-2013-6629, list multiple configurations which are
vulnerable. The current JSON parser only considers the first
configuration.
Instead, consider every configuration. We don't yet handle the AND/OR
logical operators, but this is a step in the right direction.
(From OE-Core rev: 7614e00b9491e5d4d6df5492f72613a56ab390d7)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e1bf4f6dd686055fe9a8bdcc3f739eac2807bae0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/meta/cve-update-nvd2-native.bb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb index 2b585983ac..0c627ef262 100644 --- a/meta/recipes-core/meta/cve-update-nvd2-native.bb +++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb | |||
@@ -323,11 +323,12 @@ def update_db(conn, elt): | |||
323 | [cveId, cveDesc, cvssv2, cvssv3, date, accessVector]).close() | 323 | [cveId, cveDesc, cvssv2, cvssv3, date, accessVector]).close() |
324 | 324 | ||
325 | try: | 325 | try: |
326 | configurations = elt['cve']['configurations'][0]['nodes'] | 326 | for config in elt['cve']['configurations']: |
327 | for config in configurations: | 327 | # This is suboptimal as it doesn't handle AND/OR and negate, but is better than nothing |
328 | parse_node_and_insert(conn, config, cveId) | 328 | for node in config["nodes"]: |
329 | parse_node_and_insert(conn, node, cveId) | ||
329 | except KeyError: | 330 | except KeyError: |
330 | bb.debug(2, "Entry without a configuration") | 331 | bb.debug(2, "CVE %s has no configurations" % cveId) |
331 | 332 | ||
332 | do_fetch[nostamp] = "1" | 333 | do_fetch[nostamp] = "1" |
333 | 334 | ||