mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-13 17:39:57 +00:00
python3-aiohttp: patch CVE-2025-69230
Details: https://nvd.nist.gov/vuln/detail/CVE-2025-69230 Backport the patch referenced by the NVD advisory. The tests were only partially backported, as the original patch touched some tests that don't exist in this version. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
committed by
Anuj Mittal
parent
4814f0631c
commit
9bc066079f
@@ -0,0 +1,85 @@
|
|||||||
|
From 811f8df8521b0850f5c79931e2e8c17113dda421 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||||
|
Date: Sat, 3 Jan 2026 02:53:03 +0000
|
||||||
|
Subject: [PATCH] Log once per cookie header (#11909)
|
||||||
|
|
||||||
|
From: patchback[bot] <45432694+patchback[bot]@users.noreply.github.com>
|
||||||
|
|
||||||
|
**This is a backport of PR #11890 as merged into master
|
||||||
|
(384a173022c9d057110c1418c5c4ff83a321900f).**
|
||||||
|
|
||||||
|
Co-authored-by: Sam Bull <git@sambull.org>
|
||||||
|
|
||||||
|
CVE: CVE-2025-69230
|
||||||
|
Upstream-Status: Backport [https://github.com/aio-libs/aiohttp/commit/64629a0834f94e46d9881f4e99c41a137e1f3326]
|
||||||
|
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||||
|
---
|
||||||
|
aiohttp/_cookie_helpers.py | 8 +++++++-
|
||||||
|
tests/test_cookie_helpers.py | 8 ++++++--
|
||||||
|
tests/test_web_request.py | 17 +++++++++++++++++
|
||||||
|
3 files changed, 30 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/aiohttp/_cookie_helpers.py b/aiohttp/_cookie_helpers.py
|
||||||
|
index 4e9fc96..4edaa31 100644
|
||||||
|
--- a/aiohttp/_cookie_helpers.py
|
||||||
|
+++ b/aiohttp/_cookie_helpers.py
|
||||||
|
@@ -181,6 +181,7 @@ def parse_cookie_header(header: str) -> List[Tuple[str, Morsel[str]]]:
|
||||||
|
i = 0
|
||||||
|
n = len(header)
|
||||||
|
|
||||||
|
+ invalid_names = []
|
||||||
|
while i < n:
|
||||||
|
# Use the same pattern as parse_set_cookie_headers to find cookies
|
||||||
|
match = _COOKIE_PATTERN.match(header, i)
|
||||||
|
@@ -193,7 +194,7 @@ def parse_cookie_header(header: str) -> List[Tuple[str, Morsel[str]]]:
|
||||||
|
|
||||||
|
# Validate the name
|
||||||
|
if not key or not _COOKIE_NAME_RE.match(key):
|
||||||
|
- internal_logger.warning("Can not load cookie: Illegal cookie name %r", key)
|
||||||
|
+ invalid_names.append(key)
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Create new morsel
|
||||||
|
@@ -209,6 +210,11 @@ def parse_cookie_header(header: str) -> List[Tuple[str, Morsel[str]]]:
|
||||||
|
|
||||||
|
cookies.append((key, morsel))
|
||||||
|
|
||||||
|
+ if invalid_names:
|
||||||
|
+ internal_logger.debug(
|
||||||
|
+ "Cannot load cookie. Illegal cookie names: %r", invalid_names
|
||||||
|
+ )
|
||||||
|
+
|
||||||
|
return cookies
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/tests/test_cookie_helpers.py b/tests/test_cookie_helpers.py
|
||||||
|
index 6deef65..28addb2 100644
|
||||||
|
--- a/tests/test_cookie_helpers.py
|
||||||
|
+++ b/tests/test_cookie_helpers.py
|
||||||
|
@@ -1,5 +1,7 @@
|
||||||
|
"""Tests for internal cookie helper functions."""
|
||||||
|
|
||||||
|
+import logging
|
||||||
|
+
|
||||||
|
from http.cookies import (
|
||||||
|
CookieError,
|
||||||
|
Morsel,
|
||||||
|
@@ -1374,14 +1376,16 @@ def test_parse_cookie_header_illegal_names(caplog: pytest.LogCaptureFixture) ->
|
||||||
|
"""Test parse_cookie_header warns about illegal cookie names."""
|
||||||
|
# Cookie name with comma (not allowed in _COOKIE_NAME_RE)
|
||||||
|
header = "good=value; invalid,cookie=bad; another=test"
|
||||||
|
- result = parse_cookie_header(header)
|
||||||
|
+ with caplog.at_level(logging.DEBUG):
|
||||||
|
+ result = parse_cookie_header(header)
|
||||||
|
# Should skip the invalid cookie but continue parsing
|
||||||
|
assert len(result) == 2
|
||||||
|
assert result[0][0] == "good"
|
||||||
|
assert result[0][1].value == "value"
|
||||||
|
assert result[1][0] == "another"
|
||||||
|
assert result[1][1].value == "test"
|
||||||
|
- assert "Can not load cookie: Illegal cookie name 'invalid,cookie'" in caplog.text
|
||||||
|
+ assert "Cannot load cookie. Illegal cookie name" in caplog.text
|
||||||
|
+ assert "'invalid,cookie'" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
@@ -11,6 +11,7 @@ SRC_URI += "file://CVE-2025-69224.patch \
|
|||||||
file://CVE-2025-69228.patch \
|
file://CVE-2025-69228.patch \
|
||||||
file://CVE-2025-69229-1.patch \
|
file://CVE-2025-69229-1.patch \
|
||||||
file://CVE-2025-69229-2.patch \
|
file://CVE-2025-69229-2.patch \
|
||||||
|
file://CVE-2025-69230.patch \
|
||||||
"
|
"
|
||||||
SRC_URI[sha256sum] = "4fc61385e9c98d72fcdf47e6dd81833f47b2f77c114c29cd64a361be57a763a2"
|
SRC_URI[sha256sum] = "4fc61385e9c98d72fcdf47e6dd81833f47b2f77c114c29cd64a361be57a763a2"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user