wget: fix CVE-2026-58470
PATCH 1/5 wget: fix CVE-2026-58470
From: Amaury Couderc <[email protected]>
Backport patch to fix CVE-2026-58470.
References:
https://nvd.nist.gov/vuln/detail/CVE-2026-58470
https://www.cve.org/CVERecord?id=CVE-2026-58470
https://security-tracker.debian.org/tracker/CVE-2026-58470
https://ubuntu.com/security/CVE-2026-58470
https://osv.dev/list?q=CVE-2026-58470
Upstream fix:
https://gitlab.com/gnuwget/wget/-/commit/43d3ba9336bc94937e6fae2365c6ffd30c34ffcf [nvd]
--- .../wget/wget/CVE-2026-58470.patch | 78 +++++++++++++++++++ meta/recipes-extended/wget/wget_1.21.4.bb | 1 + 2 files changed, 79 insertions(+) create mode 100644 meta/recipes-extended/wget/wget/CVE-2026-58470.patch
meta/recipes-extended/wget/wget/CVE-2026-58470.patch new file +78 -0
@@ -0,0 +1,78 @@ +From 1edd2898a9b041ededdf92caebd6f707cc9f192d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim=20R=C3=BChsen?= <[email protected]> +Date: Mon, 29 Jun 2026 18:57:54 +0200 +Subject: [PATCH] * src/http.c (parse_content_range): Fix integer overflow + +Reported-by: [email protected] + +CVE: CVE-2026-58470 +Upstream-Status: Backport [https://gitlab.com/gnuwget/wget/-/commit/43d3ba9336bc94937e6fae2365c6ffd30c34ffcf] + +Signed-off-by: Amaury Couderc <[email protected]> +--- + src/http.c | 35 ++++++++++++++++++++++++----------- + 1 file changed, 24 insertions(+), 11 deletions(-) + +diff --git a/src/http.c b/src/http.c +index 116a93a3..4dc6b70f 100644 +--- a/src/http.c ++++ b/src/http.c +@@ -914,6 +914,7 @@ parse_content_range (const char *hdr, wgint *first_byte_ptr, + wgint *last_byte_ptr, wgint *entity_length_ptr) + { + wgint num; ++ char *end; + + /* Ancient versions of Netscape proxy server, presumably predating + rfc2068, sent out `Content-Range' without the "bytes" +@@ -932,27 +933,39 @@ parse_content_range (const char *hdr, wgint *first_byte_ptr, + } + if (!c_isdigit (*hdr)) + return false; +- for (num = 0; c_isdigit (*hdr); hdr++) +- num = 10 * num + (*hdr - '0'); +- if (*hdr != '-' || !c_isdigit (*(hdr + 1))) ++ ++ errno = 0; ++ num = strtol(hdr, &end, 10); ++ if (errno == ERANGE) ++ return false; ++ hdr = end; ++ ++ if (*hdr++ != '-' || !c_isdigit (*hdr)) + return false; + *first_byte_ptr = num; +- ++hdr; +- for (num = 0; c_isdigit (*hdr); hdr++) +- num = 10 * num + (*hdr - '0'); +- if (*hdr != '/') ++ ++ errno = 0; ++ num = strtol(hdr, &end, 10); ++ if (errno == ERANGE) ++ return false; ++ hdr = end; ++ ++ if (*hdr++ != '/') + return false; + *last_byte_ptr = num; +- if (!(c_isdigit (*(hdr + 1)) || *(hdr + 1) == '*')) ++ if (!(c_isdigit (*hdr) || *hdr == '*')) + return false; + if (*last_byte_ptr < *first_byte_ptr) + return false; +- ++hdr; + if (*hdr == '*') + num = -1; + else +- for (num = 0; c_isdigit (*hdr); hdr++) +- num = 10 * num + (*hdr - '0'); ++ { ++ errno = 0; ++ num = strtol(hdr, NULL, 10); ++ if (errno == ERANGE) ++ return false; ++ } + *entity_length_ptr = num; + if ((*entity_length_ptr <= *last_byte_ptr) && *entity_length_ptr != -1) + return false;
meta/recipes-extended/wget/wget_1.21.4.bb +1 -0
@@ -2,6 +2,7 @@ SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \ file://0002-improve-reproducibility.patch \ file://CVE-2024-38428.patch \ file://CVE-2024-10524.patch \ + file://CVE-2026-58470.patch \ " SRC_URI[sha256sum] = "81542f5cefb8faacc39bbbc6c82ded80e3e4a88505ae72ea51df27525bcde04c"
Signature · 1 line
2.34.1
Quoted 14 lines · Amaury Couderc via lists.openembedded.org
From: Amaury Couderc <[email protected]>
Backport patch to fix CVE-2026-58470.
References:
https://nvd.nist.gov/vuln/detail/CVE-2026-58470
https://www.cve.org/CVERecord?id=CVE-2026-58470
https://security-tracker.debian.org/tracker/CVE-2026-58470
https://ubuntu.com/security/CVE-2026-58470
https://osv.dev/list?q=CVE-2026-58470Upstream fix:
https://gitlab.com/gnuwget/wget/-/commit/43d3ba9336bc94937e6fae2365c6ffd30c34ffcf [nvd]
Quoted 6 lines
Signed-off-by Amaury Couderc <[email protected]>--- .../wget/wget/CVE-2026-58470.patch | 78 +++++++++++++++++++ meta/recipes-extended/wget/wget_1.21.4.bb | 1 + 2 files changed, 79 insertions(+) create mode 100644 meta/recipes-extended/wget/wget/CVE-2026-58470.patch
Review from Hetvi Thakar:
Quoted 6 lines · On Thu Jul 23, 2026 at 10:44 AM CEST, Hetvi Thakar -X (hthakar - E INFOCHIPS…
I reviewed the earlier series.
It looks like the follow-up upstream regression fixes for CVE-2026-58469 and CVE-2026-58472 were not included in the backport. These follow-up commits are required to complete the backport, and I have included them in my series .
I kindly request you to review my series as well.
Signature · 2 lines
Yoann Congal Smile ECS