diff mbox series

[meta-python,scarthgap,9/9] python3-aiohttp: fix CVE-2026-34518

Message ID 20260831045744.3321483-10-dkelaiya@cisco.com
State New
Headers show
Series python3-aiohttp: fix multiple CVEs | expand

Commit Message

From: Darsh Kelaiya <dkelaiya@cisco.com>

This patch applies the reviewed upstream fix commits shown in
[1] and [2]. The advisory identifying the fix is referenced in
[3].

[1] https://github.com/aio-libs/aiohttp/commit/5351c980dcec7ad385730efdf4e1f4338b24fdb6
[2] https://github.com/aio-libs/aiohttp/commit/6e8f393330f9bd6d7b24a146124ebc42eaa727b9
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-34518

Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
---
 .../python3-aiohttp/CVE-2026-34518.patch      | 64 +++++++++++++++++++
 .../python/python3-aiohttp_3.9.5.bb           |  1 +
 2 files changed, 65 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-aiohttp/CVE-2026-34518.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2026-34518.patch b/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2026-34518.patch
new file mode 100644
index 0000000000..98417f13e9
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-aiohttp/CVE-2026-34518.patch
@@ -0,0 +1,64 @@ 
+From 528611956c8ea77e8dddc312b64baa3549697bdf Mon Sep 17 00:00:00 2001
+From: Sam Bull <git@sambull.org>
+Date: Fri, 27 Feb 2026 01:31:07 +0000
+Subject: [PATCH] Drop additional headers on redirect (#12146) (#12150)
+
+CVE: CVE-2026-34518
+Upstream-Status: Backport [https://github.com/aio-libs/aiohttp/commit/5351c980dcec7ad385730efdf4e1f4338b24fdb6]
+
+(cherry picked from commit 6e8f393330f9bd6d7b24a146124ebc42eaa727b9)
+
+(cherry picked from commit 5351c980dcec7ad385730efdf4e1f4338b24fdb6)
+Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
+---
+ aiohttp/client.py               | 2 ++
+ tests/test_client_functional.py | 9 ++++++++-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/aiohttp/client.py b/aiohttp/client.py
+index e30b880e9..0b87d7eec 100644
+--- a/aiohttp/client.py
++++ b/aiohttp/client.py
+@@ -684,6 +684,8 @@ class ClientSession:
+                         if url.origin() != parsed_url.origin():
+                             auth = None
+                             headers.pop(hdrs.AUTHORIZATION, None)
++                            headers.pop(hdrs.COOKIE, None)
++                            headers.pop(hdrs.PROXY_AUTHORIZATION, None)
+ 
+                         url = parsed_url
+                         params = {}
+diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
+index c8d4e0aab..3ca1716ba 100644
+--- a/tests/test_client_functional.py
++++ b/tests/test_client_functional.py
+@@ -2604,6 +2604,8 @@ async def test_drop_auth_on_redirect_to_other_host(
+     async def srv_to(request):
+         assert request.host == url_to.host
+         assert "Authorization" not in request.headers, "Header wasn't dropped"
++        assert "Proxy-Authorization" not in request.headers
++        assert "Cookie" not in request.headers
+         return web.Response()
+ 
+     server_from = await create_server_for_url_and_handler(url_from, srv_from)
+@@ -2646,11 +2648,16 @@ async def test_drop_auth_on_redirect_to_other_host(
+         resp = await client.get(
+             url_from,
+             auth=aiohttp.BasicAuth("user", "pass"),
++            headers={"Proxy-Authorization": "Basic dXNlcjpwYXNz", "Cookie": "a=b"},
+         )
+         assert resp.status == 200
+         resp = await client.get(
+             url_from,
+-            headers={"Authorization": "Basic dXNlcjpwYXNz"},
++            headers={
++                "Authorization": "Basic dXNlcjpwYXNz",
++                "Proxy-Authorization": "Basic dXNlcjpwYXNz",
++                "Cookie": "a=b",
++            },
+         )
+         assert resp.status == 200
+ 
+-- 
+2.35.6
+
diff --git a/meta-python/recipes-devtools/python/python3-aiohttp_3.9.5.bb b/meta-python/recipes-devtools/python/python3-aiohttp_3.9.5.bb
index 245abe4b89..3e4513b811 100644
--- a/meta-python/recipes-devtools/python/python3-aiohttp_3.9.5.bb
+++ b/meta-python/recipes-devtools/python/python3-aiohttp_3.9.5.bb
@@ -20,6 +20,7 @@  SRC_URI += "file://CVE-2024-52304.patch \
            file://CVE-2026-34514.patch \
            file://CVE-2026-34513.patch \
            file://CVE-2026-34993.patch \
+           file://CVE-2026-34518.patch \
            "
 
 PYPI_PACKAGE = "aiohttp"