From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/6] python3-requests: backport fix for CVE-2026-25645
Date: Tue, 14 Apr 2026 16:56:49 +0100 [thread overview]
Message-ID: <20260414155652.1214302-3-ross.burton@arm.com> (raw)
In-Reply-To: <20260414155652.1214302-1-ross.burton@arm.com>
When unpacking zip files requests uses predictable paths. Backport a fix
to use randomly generated pathnames to mitigate injection attacks.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../python3-requests/CVE-2026-25645.patch | 46 +++++++++++++++++++
.../python/python3-requests_2.32.5.bb | 1 +
2 files changed, 47 insertions(+)
create mode 100644 meta/recipes-devtools/python/python3-requests/CVE-2026-25645.patch
diff --git a/meta/recipes-devtools/python/python3-requests/CVE-2026-25645.patch b/meta/recipes-devtools/python/python3-requests/CVE-2026-25645.patch
new file mode 100644
index 00000000000..c3eedf005f2
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-requests/CVE-2026-25645.patch
@@ -0,0 +1,46 @@
+From 66d21cb07bd6255b1280291c4fafb71803cdb3b7 Mon Sep 17 00:00:00 2001
+From: Nate Prewitt <nate.prewitt@gmail.com>
+Date: Wed, 25 Mar 2026 08:57:56 -0600
+Subject: [PATCH] Merge commit from fork
+
+Prior to version 2.33.0, the `requests.utils.extract_zipped_paths()` utility function
+uses a predictable filename when extracting files from zip archives into the system
+temporary directory. If the target file already exists, it is reused without validation.
+A local attacker with write access to the temp directory could pre-create a malicious
+file that would be loaded in place of the legitimate one. Standard usage of the Requests
+library is not affected by this vulnerability. Only applications that call
+`extract_zipped_paths()` directly are impacted. Starting in version 2.33.0, the library
+extracts files to a non-deterministic location. If developers are unable to upgrade,
+they can set `TMPDIR` in their environment to a directory with restricted write access.
+
+CVE: CVE-2026-25645
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ src/requests/utils.py | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/requests/utils.py b/src/requests/utils.py
+index d8803e6e91..54959bb8ab 100644
+--- a/src/requests/utils.py
++++ b/src/requests/utils.py
+@@ -282,12 +282,13 @@ def extract_zipped_paths(path):
+ return path
+
+ # we have a valid zip archive and a valid member of that archive
+- tmp = tempfile.gettempdir()
+- extracted_path = os.path.join(tmp, member.split("/")[-1])
+- if not os.path.exists(extracted_path):
+- # use read + write to avoid the creating nested folders, we only want the file, avoids mkdir racing condition
+- with atomic_open(extracted_path) as file_handler:
+- file_handler.write(zip_file.read(member))
++ suffix = os.path.splitext(member.split("/")[-1])[-1]
++ fd, extracted_path = tempfile.mkstemp(suffix=suffix)
++ try:
++ os.write(fd, zip_file.read(member))
++ finally:
++ os.close(fd)
++
+ return extracted_path
+
+
diff --git a/meta/recipes-devtools/python/python3-requests_2.32.5.bb b/meta/recipes-devtools/python/python3-requests_2.32.5.bb
index 43b63e32b1f..273c92d180a 100644
--- a/meta/recipes-devtools/python/python3-requests_2.32.5.bb
+++ b/meta/recipes-devtools/python/python3-requests_2.32.5.bb
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
SRC_URI:append:class-nativesdk = " \
file://environment.d-python3-requests.sh \
+ file://CVE-2026-25645.patch \
"
SRC_URI[sha256sum] = "dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"
--
2.43.0
next prev parent reply other threads:[~2026-04-14 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 15:56 [PATCH 1/6] graphene: ignore CVE-2024-1984 Ross Burton
2026-04-14 15:56 ` [PATCH 2/6] re2c: backport fix for CVE-2026-2903 Ross Burton
2026-04-14 15:56 ` Ross Burton [this message]
2026-04-14 15:56 ` [PATCH 4/6] libexif: backport fixes for CVE-2026-40385/CVE-2026-40386/CVE-2026-32775 Ross Burton
2026-04-15 19:10 ` [OE-core] " Marko, Peter
2026-04-15 21:13 ` Ross Burton
2026-04-14 15:56 ` [PATCH 5/6] perl: link to the system zlib instead of a vendored copy Ross Burton
2026-04-14 15:56 ` [PATCH 6/6] perl: link to the system bzip2 " Ross Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260414155652.1214302-3-ross.burton@arm.com \
--to=ross.burton@arm.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox