new file mode 100644
@@ -0,0 +1,52 @@
+From b33c317397db195f9584082be835f051d56bb163 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Mon, 29 Jun 2026 18:32:02 +0200
+Subject: [PATCH] * src/metalink.c (clean_metalink_string): Fix buffer
+ underflow
+
+Reported-by: TristanInSec@gmail.com
+
+CVE: CVE-2026-58469
+Upstream-Status: Backport [https://gitlab.com/gnuwget/wget/-/commit/37a40fcb450153f69537c7cbc2a7a4fb0b6f7826]
+
+Signed-off-by: Amaury Couderc <amaury.couderc@est.tech>
+---
+ src/metalink.c | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/src/metalink.c b/src/metalink.c
+index eca839c2..10d58cf7 100644
+--- a/src/metalink.c
++++ b/src/metalink.c
+@@ -1041,7 +1041,6 @@ void
+ clean_metalink_string (char **str)
+ {
+ int c;
+- size_t len;
+ char *new, *beg, *end;
+
+ if (!str || !*str)
+@@ -1049,7 +1048,7 @@ clean_metalink_string (char **str)
+
+ beg = *str;
+
+- while ((c = *beg) && (c == '\n' || c == '\r' || c == '\t' || c == ' '))
++ while (isspace(*beg))
+ beg++;
+
+ end = beg;
+@@ -1062,12 +1061,10 @@ clean_metalink_string (char **str)
+ /* If we are at the end of the string, search the first legit
+ character going backward. */
+ if (*end == '\0')
+- while ((c = *(end - 1)) && (c == '\n' || c == '\r' || c == '\t' || c == ' '))
++ while (end > beg && !isspace(*(end - 1)))
+ end--;
+
+- len = end - beg;
+-
+- new = xmemdup0 (beg, len);
++ new = xmemdup0 (beg, end - beg);
+ xfree (*str);
+ *str = new;
+ }
@@ -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-58469.patch \
file://CVE-2026-58470.patch \
"