Patch review
cover Patch review
Please review this set of changes for kirkstone and have comments back by end of day Thursday, April 17
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/1401
The following changes since commit 7399cf17590204f8289f356cce4575592d6e3536:
ghostscript: Fix CVE-2025-27836 (2025-04-08 08:36:03 -0700)
are available in the Git repository at:
https://git.openembedded.org/openembedded-core-contrib stable/kirkstone-nut
https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/kirkstone-nut
Divya Chellam (1):
ruby: fix CVE-2024-43398
Hitendra Prajapati (1):
go: fix CVE-2025-22871
Peter Marko (2):
cve-update-nvd2-native: add workaround for json5 style list
systemd: ignore CVEs which reappeared after upgrade to 250.14
.../meta/cve-update-nvd2-native.bb | 5 + meta/recipes-core/systemd/systemd.inc | 3 + meta/recipes-devtools/go/go-1.17.13.inc | 1 + .../go/go-1.21/CVE-2025-22871.patch | 172 ++++++++++++++++++ .../ruby/ruby/CVE-2024-43398.patch | 81 +++++++++ meta/recipes-devtools/ruby/ruby_3.1.3.bb | 1 + 6 files changed, 263 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.21/CVE-2025-22871.patch create mode 100644 meta/recipes-devtools/ruby/ruby/CVE-2024-43398.patch
Signature · 1 line
2.43.0
PATCH 1/4 cve-update-nvd2-native: add workaround for json5 style list
From: Peter Marko <[email protected]>
NVD responses changed to an invalid json between:
* April 5, 2025 at 3:03:44 AM GMT+2
* April 5, 2025 at 4:19:48 AM GMT+2
The last response is since then in format
{
"resultsPerPage": 625,
"startIndex": 288000,
"totalResults": 288625,
"format": "NVD_CVE",
"version": "2.0",
"timestamp": "2025-04-07T07:17:17.534",
"vulnerabilities": [
{...},
...
{...}, ]
}
Json does not allow trailing , in responses, that is json5 format. So cve-update-nvd2-native do_Fetch task fails with log backtrace ending:
...
File: '/builds/ccp/meta-siemens/projects/ccp/../../poky/meta/recipes-core/meta/cve-update-nvd2-native.bb', lineno: 234, function: update_db_file
0230: if raw_data is None:
0231: # We haven't managed to download data
0232: return False
0233:
*** 0234: data = json.loads(raw_data)
0235:
0236: index = data["startIndex"]
0237: total = data["totalResults"]
0238: per_page = data["resultsPerPage"]
...
File: '/usr/lib/python3.11/json/decoder.py', lineno: 355, function: raw_decode
0351: """
0352: try:
0353: obj, end = self.scan_once(s, idx)
0354: except StopIteration as err:
*** 0355: raise JSONDecodeError("Expecting value", s, err.value) from None
0356: return obj, end
Exception: json.decoder.JSONDecodeError: Expecting value: line 1 column 1442633 (char 1442632)
...
There was no announcement about json format of API v2.0 by nvd. Also this happens only if whole database is queried (database update is fine, even when multiple pages as queried).
And lastly it's only the cve list, all other lists inside are fine. So this looks like a bug in NVD 2.0 introduced with some update.
Patch this with simple character deletion for now and let's monitor the situation and possibly switch to json5 in the future.
Note that there is no native json5 support in python, we'd have to use one of external libraries for it.
--- meta/recipes-core/meta/cve-update-nvd2-native.bb | 5 +++++ 1 file changed, 5 insertions(+)
meta/recipes-core/meta/cve-update-nvd2-native.bb +5 -0
@@ -226,6 +226,11 @@ def update_db_file(db_tmp_file, d, database_time): # We haven't managed to download data return False + # hack for json5 style responses + if raw_data[-3:] == ',]}': + bb.note("Removing trailing ',' from nvd response") + raw_data = raw_data[:-3] + ']}' + data = json.loads(raw_data) index = data["startIndex"]
Signature · 1 line
2.43.0
PATCH 2/4 systemd: ignore CVEs which reappeared after upgrade to 250.14
In reply to Steve SakomanFrom: Peter Marko <[email protected]>
Upgrade from 250.5 to 250.14 removed patches for these CVEs because they were interated in the new version.
However NVD DB does not contain information about these backports to v250 branch, so they need to be ignored.
--- meta/recipes-core/systemd/systemd.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-core/systemd/systemd.inc +3 -0
@@ -19,3 +19,6 @@ SRCBRANCH = "v250-stable" SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH}" S = "${WORKDIR}/git" + +# cpe-stable-backport: patches were backported to v250 stable branch +CVE_CHECK_IGNORE += "CVE-2022-3821 CVE-2022-4415 CVE-2022-45873"
Signature · 1 line
2.43.0
PATCH 3/4 go: fix CVE-2025-22871
In reply to Steve SakomanFrom: Hitendra Prajapati <[email protected]>
Upstream-Status: Backport from https://github.com/golang/go/commit/15e01a2e43ecb8c7e15ff7e9d62fe3f10dcac931
--- meta/recipes-devtools/go/go-1.17.13.inc | 1 + .../go/go-1.21/CVE-2025-22871.patch | 172 ++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.21/CVE-2025-22871.patch
meta/recipes-devtools/go/go-1.17.13.inc +1 -0
@@ -62,6 +62,7 @@ SRC_URI += "\ file://CVE-2024-34156.patch \ file://CVE-2024-34158.patch \ file://CVE-2024-45336.patch \ + file://CVE-2025-22871.patch \ " SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd"
meta/recipes-devtools/go/go-1.21/CVE-2025-22871.patch new file +172 -0
172 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 4/4 ruby: fix CVE-2024-43398
In reply to Steve SakomanFrom: Divya Chellam <[email protected]>
REXML is an XML toolkit for Ruby. The REXML gem before 3.3.6 has a DoS vulnerability when it parses an XML that has many deep elements that have same local name attributes. If you need to parse untrusted XMLs with tree parser API like REXML::Document.new, you may be impacted to this vulnerability. If you use other parser APIs such as stream parser API and SAX2 parser API, this vulnerability is not affected. The REXML gem 3.3.6 or later include the patch to fix the vulnerability.
Reference:
https://security-tracker.debian.org/tracker/CVE-2024-43398
Upstream-patch:
https://github.com/ruby/rexml/commit/7cb5eaeb221c322b9912f724183294d8ce96bae3
--- .../ruby/ruby/CVE-2024-43398.patch | 81 +++++++++++++++++++ meta/recipes-devtools/ruby/ruby_3.1.3.bb | 1 + 2 files changed, 82 insertions(+) create mode 100644 meta/recipes-devtools/ruby/ruby/CVE-2024-43398.patch
meta/recipes-devtools/ruby/ruby/CVE-2024-43398.patch new file +81 -0
@@ -0,0 +1,81 @@ +From 7cb5eaeb221c322b9912f724183294d8ce96bae3 Mon Sep 17 00:00:00 2001 +From: Sutou Kouhei <[email protected]> +Date: Sat, 17 Aug 2024 17:45:52 +0900 +Subject: [PATCH] parser tree: improve namespace conflicted attribute check + performance + +It was slow for deep element. + +Reported by l33thaxor. Thanks!!! + +The changes to the test folder files are not included in this patch +because the test folder was not generated during the devtool source build. + +CVE: CVE-2024-43398 + +Upstream-Status: Backport [https://github.com/ruby/rexml/commit/7cb5eaeb221c322b9912f724183294d8ce96bae3] + +Signed-off-by: Divya Chellam <[email protected]> +--- + .bundle/gems/rexml-3.2.5/lib/rexml/element.rb | 11 ----------- + .../rexml-3.2.5/lib/rexml/parsers/baseparser.rb | 15 +++++++++++++++ + 2 files changed, 15 insertions(+), 11 deletions(-) + +diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/element.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/element.rb +index 4c21dbd..78e78c2 100644 +--- a/.bundle/gems/rexml-3.2.5/lib/rexml/element.rb ++++ b/.bundle/gems/rexml-3.2.5/lib/rexml/element.rb +@@ -2388,17 +2388,6 @@ module REXML + elsif old_attr.kind_of? Hash + old_attr[value.prefix] = value + elsif old_attr.prefix != value.prefix +- # Check for conflicting namespaces +- if value.prefix != "xmlns" and old_attr.prefix != "xmlns" +- old_namespace = old_attr.namespace +- new_namespace = value.namespace +- if old_namespace == new_namespace +- raise ParseException.new( +- "Namespace conflict in adding attribute \"#{value.name}\": "+ +- "Prefix \"#{old_attr.prefix}\" = \"#{old_namespace}\" and "+ +- "prefix \"#{value.prefix}\" = \"#{new_namespace}\"") +- end +- end + store value.name, {old_attr.prefix => old_attr, + value.prefix => value} + else +diff --git a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +index e32c7f4..154f2ac 100644 +--- a/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb ++++ b/.bundle/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +@@ -634,6 +634,7 @@ module REXML + + def parse_attributes(prefixes, curr_ns) + attributes = {} ++ expanded_names = {} + closed = false + match_data = @source.match(/^(.*?)(\/)?>/um, true) + if match_data.nil? +@@ -641,6 +642,20 @@ module REXML + raise REXML::ParseException.new(message, @source) + end + ++ unless prefix == "xmlns" ++ uri = @namespaces[prefix] ++ expanded_name = [uri, local_part] ++ existing_prefix = expanded_names[expanded_name] ++ if existing_prefix ++ message = "Namespace conflict in adding attribute " + ++ "\"#{local_part}\": " + ++ "Prefix \"#{existing_prefix}\" = \"#{uri}\" and " + ++ "prefix \"#{prefix}\" = \"#{uri}\"" ++ raise REXML::ParseException.new(message, @source, self) ++ end ++ expanded_names[expanded_name] = prefix ++ end ++ + raw_attributes = match_data[1] + closed = !match_data[2].nil? + return attributes, closed if raw_attributes.nil? +-- +2.40.0 +
meta/recipes-devtools/ruby/ruby_3.1.3.bb +1 -0
@@ -48,6 +48,7 @@ SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \ file://CVE-2024-41946.patch \ file://CVE-2025-27220.patch \ file://CVE-2025-27219.patch \ + file://CVE-2024-43398.patch \ " UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
Signature · 1 line
2.43.0