From patchwork Fri Nov 20 09:23:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "P. Tatrai" X-Patchwork-Id: 105048 Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2609.1795166598792861901 for ; Fri, 20 Nov 2026 01:23:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.tatrai.ext@siemens.com header.s=fm1 header.b=pBErw/CT; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1328017-202611200923163b8f511c3b000207d1-nteup7@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202611200923163b8f511c3b000207d1 for ; Fri, 20 Nov 2026 10:23:16 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.tatrai.ext@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=U76+3vLoJfaUQBKjuQ/91R5h0NjTpXa63sIQaa9YvFo=; b=pBErw/CTl15fAzSeWclj39XiB0Hf/fPROw5cXCTaWQluSSawC8zZa261B+kDxGCdH2dYQt TiY3xsG5xeiXmGDp+KWYXS7oBh4xKIz2SB6CIpROf4LJq90ThBvTaC24m+KkT76fXvpqnYgu 2GOa/P4JO3/HhJx+QEQVH5ZseUEBXEPQXMPBrku3bMXmvA7wH/55jTT01e0zgduTtfGqu5ik h1bwhu5fUwHNGDoJ9dF17YNHQwyG2+bPaXEjkbfUb8owlehouOSUMOzf30RSeo/RtgvlmtpF FVKyuMsNZsheQ7MF77RmhNKSuyl9vRhtds1Wc5lpmKbCDtgAXjpkpGbA==; From: "P. Tatrai" To: openembedded-core@lists.openembedded.org Cc: Peter Tatrai Subject: [scarthgap][PATCH 1/2] cve-check: keep global CVE exclusions out of unrelated reports Date: Fri, 20 Nov 2026 10:23:08 +0100 Message-Id: <20261120092309.4056817-2-peter.tatrai.ext@siemens.com> In-Reply-To: <20261120092309.4056817-1-peter.tatrai.ext@siemens.com> References: <20261120092309.4056817-1-peter.tatrai.ext@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328017:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 09:23:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250753 From: Peter Tatrai The Scarthgap SPDX 3.0 backport [1] did not bring over product filtering for CVE_STATUS assessments. The follow-up [2] made SPDX export all CVE_STATUS assessments, exposing the same problem in SPDX that already affected CVE-check reports. Global exclusion lists are loaded for every recipe. Without product filtering, assessments intended for one product can appear in the CVE-check and SPDX/VEX reports of unrelated packages. Backport the scoped parser from OE-Core commit abca80a716e9 and the product matcher from 452e605b55ad as they appear in Wrynose. Preserve Scarthgap's tuple and set APIs and the behavior of unscoped entries. [1] Scarthgap SPDX 3.0 backport: https://git.openembedded.org/openembedded-core/commit/?id=9c9b9545049a [2] Export all CVE_STATUS assessments: https://git.openembedded.org/openembedded-core/commit/?id=9a204670b1c0 Signed-off-by: Peter Tatrai --- meta/classes/vex.bbclass | 1 - meta/lib/oe/cve_check.py | 76 ++++++++++++++++++++--- meta/lib/oe/spdx30_tasks.py | 1 - meta/lib/oeqa/selftest/cases/cve_check.py | 48 ++++++++++++++ 4 files changed, 117 insertions(+), 9 deletions(-) diff --git a/meta/classes/vex.bbclass b/meta/classes/vex.bbclass index 97213ea..3c44dbb 100644 --- a/meta/classes/vex.bbclass +++ b/meta/classes/vex.bbclass @@ -141,7 +141,6 @@ python do_generate_vex () { for cve_id in (d.getVarFlags("CVE_STATUS") or {}): mapping, detail, description = decode_cve_status(d, cve_id) if not mapping or not detail: - bb.warn(f"Skipping {cve_id} — missing or unknown CVE status") continue cve_data[cve_id] = { "abbrev-status": mapping, diff --git a/meta/lib/oe/cve_check.py b/meta/lib/oe/cve_check.py index 7c09b78..9620dc5 100644 --- a/meta/lib/oe/cve_check.py +++ b/meta/lib/oe/cve_check.py @@ -227,22 +227,84 @@ def convert_cve_version(version): def decode_cve_status(d, cve): """ - Convert CVE_STATUS into status, detail and description. + Convert a matching CVE_STATUS into status, detail and description. + + Keep the Scarthgap tuple API for cve-check and existing SPDX consumers. """ - status = d.getVarFlag("CVE_STATUS", cve) + status = decode_cve_status_scoped(d, cve) if not status: return ("", "", "") + # Scarthgap applies unscoped statuses even when CVE_PRODUCT is empty. + unscoped = status["vendor"] == status["product"] == "*" + if not unscoped and not has_cve_product_match(status, d.getVar("CVE_PRODUCT") or ""): + return ("", "", "") + return (status["mapping"], status["detail"], status["description"]) + + +def has_cve_product_match(detailed_status, products): + """ + Check product/vendor match between detailed_status from decode_cve_status and a string of + products (like from CVE_PRODUCT) + """ + for product in products.split(): + vendor = "*" + if ":" in product: + vendor, product = product.split(":", 1) + + if (vendor == detailed_status["vendor"] or detailed_status["vendor"] == "*") and \ + (product == detailed_status["product"] or detailed_status["product"] == "*"): + return True - status_split = status.split(':', 1) - detail = status_split[0] - description = status_split[1].strip() if (len(status_split) > 1) else "" + #if no match, return False + return False + +def decode_cve_status_scoped(d, cve): + """ + Convert CVE_STATUS into status, vendor, product, detail and description. + """ + status = d.getVarFlag("CVE_STATUS", cve) + if not status: + return {} + + status_split = status.split(':', 4) + status_out = {} + status_out["detail"] = status_split[0] + product = "*" + vendor = "*" + description = "" + if len(status_split) >= 4 and status_split[1].strip() == "cpe": + # Both vendor and product are mandatory if cpe: present, the syntax is then: + # detail: cpe:vendor:product:description + vendor = status_split[2].strip() + product = status_split[3].strip() + description = status_split[4].strip() + elif len(status_split) >= 2 and status_split[1].strip() == "cpe": + # Malformed CPE + bb.warn( + 'Invalid CPE information for CVE_STATUS[%s] = "%s", not setting CPE' + % (cve, status) + ) + else: + # Other case: no CPE, the syntax is then: + # detail: description + description = status.split(':', 1)[1].strip() if (len(status_split) > 1) else "" + + status_out["vendor"] = vendor + status_out["product"] = product + status_out["description"] = description + + detail = status_out["detail"] status_mapping = d.getVarFlag("CVE_CHECK_STATUSMAP", detail) if status_mapping is None: - bb.warn('Invalid detail "%s" for CVE_STATUS[%s] = "%s", fallback to Unpatched' % (detail, cve, status)) + bb.warn( + 'Invalid detail "%s" for CVE_STATUS[%s] = "%s", fallback to Unpatched' + % (detail, cve, status) + ) status_mapping = "Unpatched" + status_out["mapping"] = status_mapping - return (status_mapping, detail, description) + return status_out def extend_cve_status(d): # do this only once in case multiple classes use this diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 0e9c6fa..539901f 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -470,7 +470,6 @@ def _get_cves_info(d): for cve_id in (d.getVarFlags("CVE_STATUS") or {}): mapping, detail, description = oe.cve_check.decode_cve_status(d, cve_id) if not mapping or not detail: - bb.warn(f"Skipping {cve_id} — missing or unknown CVE status") continue yield cve_id, mapping, detail, description patched_cves.discard(cve_id) diff --git a/meta/lib/oeqa/selftest/cases/cve_check.py b/meta/lib/oeqa/selftest/cases/cve_check.py index 60cecd1..8cd5eb9 100644 --- a/meta/lib/oeqa/selftest/cases/cve_check.py +++ b/meta/lib/oeqa/selftest/cases/cve_check.py @@ -11,6 +11,54 @@ from oeqa.utils.commands import bitbake, get_bb_vars class CVECheck(OESelftestTestCase): + def test_scoped_status(self): + import bb + from oe.cve_check import decode_cve_status, extend_cve_status, get_patched_cves + from unittest.mock import patch + + d = bb.data.init() + cve = "CVE-2020-0001" + d.setVarFlag("CVE_CHECK_STATUSMAP", "fixed-version", "Patched") + d.setVarFlag("CVE_CHECK_STATUSMAP", "ignored", "Ignored") + d.setVarFlag("CVE_STATUS", cve, "fixed-version: cpe:oracle:berkeley_db: Fixed: see upstream") + for product, expected in ( + ("oracle:berkeley_db", ("Patched", "fixed-version", "Fixed: see upstream")), + ("other:berkeley_db", ("", "", "")), + ("oracle:zlib", ("", "", "")), + ("zlib:zlib oracle:berkeley_db", ("Patched", "fixed-version", "Fixed: see upstream")), + ): + with self.subTest(product=product): + d.setVar("CVE_PRODUCT", product) + self.assertEqual(decode_cve_status(d, cve), expected) + with patch("oe.patch.src_patches", return_value=[]): + self.assertEqual(get_patched_cves(d), {cve} if expected[0] else set()) + + d.setVar("CVE_PRODUCT", "zlib") + d.setVarFlag("CVE_STATUS", cve, "ignored: Existing unscoped reason: unchanged") + self.assertEqual(decode_cve_status(d, cve), + ("Ignored", "ignored", "Existing unscoped reason: unchanged")) + d.setVar("CVE_STATUS_GROUPS", "SCOPED_GROUP") + d.setVar("SCOPED_GROUP", cve) + d.setVarFlag("SCOPED_GROUP", "status", "ignored: cpe:*:zlib: Matching group") + extend_cve_status(d) + self.assertEqual(decode_cve_status(d, cve), ("Ignored", "ignored", "Matching group")) + d.setVar("CVE_PRODUCT", "glibc") + self.assertEqual(decode_cve_status(d, cve), ("", "", "")) + + def test_scoped_status_spdx(self): + import bb + import oe.spdx30_tasks + from unittest.mock import patch + + d = bb.data.init() + d.setVar("CVE_PRODUCT", "zlib:zlib") + d.setVarFlag("CVE_CHECK_STATUSMAP", "ignored", "Ignored") + d.setVarFlag("CVE_STATUS", "CVE-2020-0001", "ignored: cpe:*:berkeley_db: Not zlib") + d.setVarFlag("CVE_STATUS", "CVE-2020-0002", "ignored: cpe:*:zlib: Matches zlib") + with patch("oe.patch.src_patches", return_value=[]): + self.assertEqual(list(oe.spdx30_tasks._get_cves_info(d)), + [("CVE-2020-0002", "Ignored", "ignored", "Matches zlib")]) + def test_version_compare(self): from oe.cve_check import Version From patchwork Fri Nov 20 09:23:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "P. Tatrai" X-Patchwork-Id: 105049 Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.2609.1795166598792861901 for ; Fri, 20 Nov 2026 01:23:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.tatrai.ext@siemens.com header.s=fm1 header.b=cclLj2ED; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1328017-202611200923194e8f6bd4120002074a-eusde3@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202611200923194e8f6bd4120002074a for ; Fri, 20 Nov 2026 10:23:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=peter.tatrai.ext@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=jYiqbiMkG73rbVg+DThYUjc1uGg1lPKqRzxJB1pT+LQ=; b=cclLj2EDY7Pr1mXw2R61+9uzKZm1rO2mQw13KqsDKKi27jwTwAmm9y7dLMgh04l/GquEhd qlCDCoc/m10ClkuY8Kf9BAW2QpMiYbLnn4sfhmyAihgBPjZlaQ+wdkNktIgIxjaW9/+Udmdj 1Z3OoEpyWi14fPgojH7es7Te1kiQXm1s2fkBOyiGxl/DpuUgk7MpxUFChVfE+NuU91ojM2ul wHZ/3/529VxuRh8x8JTRYl3GwoRCbjydyz12RNsLTfFF0uM0N8lPvpGKa5HaxkWmykvUTZ5M MZ0f0vOLpnLOwIs1dWGScHUn9zRKNZH4gq+1xi7rD1R79F3wY6XQ0kuQ==; From: "P. Tatrai" To: openembedded-core@lists.openembedded.org Cc: Peter Tatrai Subject: [scarthgap][PATCH 2/2] cve-exclusions: qualify global assessments by product Date: Fri, 20 Nov 2026 10:23:09 +0100 Message-Id: <20261120092309.4056817-3-peter.tatrai.ext@siemens.com> In-Reply-To: <20261120092309.4056817-1-peter.tatrai.ext@siemens.com> References: <20261120092309.4056817-1-peter.tatrai.ext@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328017:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 20 Nov 2026 09:23:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/250754 From: Peter Tatrai Apply Wrynose product scopes without changing Scarthgap's assessment set or descriptions. Keep these exclusions out of reports for unrelated recipes. Signed-off-by: Peter Tatrai --- .../distro/include/cve-extra-exclusions.inc | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/meta/conf/distro/include/cve-extra-exclusions.inc b/meta/conf/distro/include/cve-extra-exclusions.inc index fcef6a1..54bfac3 100644 --- a/meta/conf/distro/include/cve-extra-exclusions.inc +++ b/meta/conf/distro/include/cve-extra-exclusions.inc @@ -16,11 +16,11 @@ # # strace https://nvd.nist.gov/vuln/detail/CVE-2000-0006 -CVE_STATUS[CVE-2000-0006] = "upstream-wontfix: CVE is more than 20 years old \ +CVE_STATUS[CVE-2000-0006] = "upstream-wontfix: cpe:*:strace: CVE is more than 20 years old \ with no resolution evident. Broken links in CVE database references make resolution impractical." # epiphany https://nvd.nist.gov/vuln/detail/CVE-2005-0238 -CVE_STATUS[CVE-2005-0238] = "upstream-wontfix: \ +CVE_STATUS[CVE-2005-0238] = "upstream-wontfix: cpe:*:epiphany: \ The issue here is spoofing of domain names using characters from other character sets. \ There has been much discussion amongst the epiphany and webkit developers and \ whilst there are improvements about how domains are handled and displayed to the user \ @@ -28,7 +28,7 @@ there is unlikely ever to be a single fix to webkit or epiphany which addresses problem. There isn't any mitigation or fix or way to progress this further." # glibc https://nvd.nist.gov/vuln/detail/CVE-2010-4756 -CVE_STATUS[CVE-2010-4756] = "upstream-wontfix: \ +CVE_STATUS[CVE-2010-4756] = "upstream-wontfix: cpe:*:glibc: \ Issue is memory exhaustion via glob() calls, e.g. from within an ftp server \ Best discussion in https://bugzilla.redhat.com/show_bug.cgi?id=681681 \ Upstream don't see it as a security issue, ftp servers shouldn't be passing \ @@ -38,7 +38,7 @@ this to libc glob. Upstream have no plans to add BSD's GLOB_LIMIT or similar." # go https://nvd.nist.gov/vuln/detail/CVE-2020-29511 CVE_STATUS_GROUPS += "CVE_STATUS_GO" CVE_STATUS_GO = "CVE-2020-29509 CVE-2020-29511" -CVE_STATUS_GO[status] = "not-applicable-config: \ +CVE_STATUS_GO[status] = "not-applicable-config: cpe:golang:go: \ The encoding/xml package in go can potentially be used for security exploits if not used correctly \ CVE applies to a netapp product as well as flagging a general issue. We don't ship anything \ exposing this interface in an exploitable way" @@ -50,7 +50,7 @@ CVE-2015-2656 CVE-2015-4754 CVE-2015-4764 CVE-2015-4774 CVE-2015-4775 CVE-2015-4 CVE-2015-4778 CVE-2015-4779 CVE-2015-4780 CVE-2015-4781 CVE-2015-4782 CVE-2015-4783 CVE-2015-4784 \ CVE-2015-4785 CVE-2015-4786 CVE-2015-4787 CVE-2015-4788 CVE-2015-4789 CVE-2015-4790 CVE-2016-0682 \ CVE-2016-0689 CVE-2016-0692 CVE-2016-0694 CVE-2016-3418 CVE-2020-2981" -CVE_STATUS_DB[status] = "upstream-wontfix: Since Oracle relicensed bdb, the open source community is slowly but surely \ +CVE_STATUS_DB[status] = "upstream-wontfix: cpe:*:berkeley_db: Since Oracle relicensed bdb, the open source community is slowly but surely \ replacing bdb with supported and open source friendly alternatives. As a result this CVE is unlikely to ever be fixed." # Kernel CVEs that are generic but can't be added to the kernel's hand-maintained cve-exclusion.inc @@ -60,25 +60,25 @@ replacing bdb with supported and open source friendly alternatives. As a result # For OE-Core our policy is to stay as close to the kernel stable releases as we can. This should # ensure the bulk of the major kernel CVEs are fixed and we don't dive into each individual issue # as the stable maintainers are much more able to do that. -CVE_STATUS[CVE-1999-0524] = "ignored: issue is that ICMP exists, can be filewalled if required" -CVE_STATUS[CVE-2008-4609] = "ignored: describes design flaws in TCP" -CVE_STATUS[CVE-2010-4563] = "ignored: low impact, only enables detection of hosts which are sniffing network traffic" -CVE_STATUS[CVE-2011-0640] = "ignored: requires physical access and any mitigation would mean USB is impractical to use" +CVE_STATUS[CVE-1999-0524] = "ignored: cpe:*:linux_kernel: issue is that ICMP exists, can be filewalled if required" +CVE_STATUS[CVE-2008-4609] = "ignored: cpe:*:linux_kernel: describes design flaws in TCP" +CVE_STATUS[CVE-2010-4563] = "ignored: cpe:*:linux_kernel: low impact, only enables detection of hosts which are sniffing network traffic" +CVE_STATUS[CVE-2011-0640] = "ignored: cpe:*:linux_kernel: requires physical access and any mitigation would mean USB is impractical to use" # qemu:qemu-native:qemu-system-native https://nvd.nist.gov/vuln/detail/CVE-2021-20255 -CVE_STATUS[CVE-2021-20255] = "upstream-wontfix: \ +CVE_STATUS[CVE-2021-20255] = "upstream-wontfix: cpe:*:qemu: \ There was a proposed patch https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06098.html \ qemu maintainers say the patch is incorrect and should not be applied \ The issue is of low impact, at worst sitting in an infinite loop rather than exploitable." # qemu:qemu-native:qemu-system-native https://nvd.nist.gov/vuln/detail/CVE-2019-12067 -CVE_STATUS[CVE-2019-12067] = "upstream-wontfix: \ +CVE_STATUS[CVE-2019-12067] = "upstream-wontfix: cpe:*:qemu: \ There was a proposed patch but rejected by upstream qemu. It is unclear if the issue can \ still be reproduced or where exactly any bug is. \ We'll pick up any fix when upstream accepts one." # nasm:nasm-native https://nvd.nist.gov/vuln/detail/CVE-2020-18974 -CVE_STATUS[CVE-2020-18974] = "upstream-wontfix: \ +CVE_STATUS[CVE-2020-18974] = "upstream-wontfix: cpe:*:netwide_assembler: \ It is a fuzzing related buffer overflow. It is of low impact since most devices \ wouldn't expose an assembler. The upstream is inactive and there is little to be \ done about the bug, ignore from an OE perspective."