From patchwork Tue Jun 23 13:13:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 90722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABE97CDE003 for ; Tue, 23 Jun 2026 13:14:36 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.20835.1782220474880924451 for ; Tue, 23 Jun 2026 06:14:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=E/67sAf3; spf=pass (domain: smile.fr, ip: 209.85.128.49, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4924f8db066so15389705e9.2 for ; Tue, 23 Jun 2026 06:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1782220473; x=1782825273; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0MraQ6tvhm2y7hfkdi90CD4uwdt6iTPHXX5P2IRgoHY=; b=E/67sAf3stX65RdVi0xaUnKBtKV0t7+ae90TlF9gK48zSG8vl4zi8GVYl6ru1hQfoL DtVP+ZH8P5PqI/kH0Tz3pk9q+yYtmk0sES3517M6FOjRnCMWTEdiFmaTDUUjOCbBwf7U eK6laF32XC0YjzdshZhXvL+EDKLV5CBl7SYZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782220473; x=1782825273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0MraQ6tvhm2y7hfkdi90CD4uwdt6iTPHXX5P2IRgoHY=; b=igOxilqEttbgSeYQlX/orQA8aKYyYJr1snHFSJBgjptdfLzLUwCC3Bv+2hST5MyoLa RJLjxgPJO8rILPw4Gl8oC2c8x3kaa9GrMWaiVRyRBkTMuOD/7Z+IqBa17DEMadIlQ5QL vJJ90shzXFCplF3LSRqZUO4qKMNtFWE1LzzRJtwZrS61nyoluqCPBr7gWoB5KI/xBM8e N5oK0DsAxdjXf2MdEKEdrfFF9ZxZYwH3WQF36h3MCjMXXyDFBYYCKjUbP/cxKBf28t+9 IQElOI9rDC8PKFpxzQODNuv+Wig0AhB3hcV06VZzr7iB4aosBcV5IQR2XCn+iCpuCtfh XArg== X-Gm-Message-State: AOJu0YyCCEe9upjcpKnRL/0Ntpp8Rtl07uNLg+e4QlBwHycvFWiqvo+F whW+1xLctsPe3DJtf/Ab2P4jIyL1ri0OOumWGxI8QolIRzPR0fSGtXeovhWknXpee5GXVRu+MH7 0Jpqz X-Gm-Gg: AfdE7ckgr5nZq9QDSuAeYrdSzH11ZZFMigo9uGgUtYVeobwazcIo5B0QeBtME2YNrzL ynVLg5mGsphEh8BlzlEeUsxobHeCJbSAKlMXXtmHYdfOtXycXnpSD0Ar5WSL5UZj9tuWuGidfJG EbU0QShdTKqhkvfi72E0+Jawo6THEymgJTG/1fqj6Ke95AXS02pixcgdBJz1//Efx4coc9RCXx1 ygHcOssVKnmsgtQitv9WD8MqT2i1YKYvG3bsx9uOtz9WFwxnAbWJLRKKOQE9svK9c2euSTfl0k3 Hr0T5tiHJiITyqpBF0SASg6CQUrXjSJBlL1SZv8diIYDveXHgTjqh3TYybt7OKRY7tw0WFdgML1 Mm7i64gAvQO4NggshsjtK35DoHyzZFxbGrjkL1Qklnrc6nZwIY9Ztb1yvNqD7iKOhFvFyGw5KOn mjSJJoJdfYfxu2ToT9//hSOnVb8PbY2jvqSR1cu+g3b3Kd29K9SkCyP9gI3l2704gIGlegP4soE +w8xSaQ1tH4uJrczw== X-Received: by 2002:a05:600c:c4a5:b0:490:bcf6:469f with SMTP id 5b1f17b1804b1-4925b316213mr42882435e9.0.1782220473075; Tue, 23 Jun 2026 06:14:33 -0700 (PDT) Received: from FRSMI25-LASER.home (2a01cb001331aa008234f3c115adbb1a.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:8234:f3c1:15ad:bb1a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4925d013a69sm24334285e9.3.2026.06.23.06.14.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 06:14:32 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Subject: [OE-core][scarthgap 10/26] python3: Fix CVE-2026-6019 Date: Tue, 23 Jun 2026 15:13:51 +0200 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 23 Jun 2026 13:14:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/239376 From: Sudhir Dumbhare This patch applies the upstream fix [1] and follow-up fix [2], as referenced in [3] and [4], to address an http.cookies.Morsel.js_output() flaw where inline JavaScript output escaped quotes but did not neutralize the HTML parser-sensitive sequence. [1] https://github.com/python/cpython/commit/3c59b8b53fc75c7f9578d16fb8201ceb43e8f76c [2] https://github.com/python/cpython/commit/e7d4c3ff421916986223690a8425d2383f6f3802 [3] https://github.com/python/cpython/issues/149144 [4] https://security-tracker.debian.org/tracker/CVE-2026-6019 Reference: https://nvd.nist.gov/vuln/detail/CVE-2026-6019 Signed-off-by: Sudhir Dumbhare Signed-off-by: Yoann Congal --- .../python/python3/CVE-2026-6019_p1.patch | 133 ++++++++++++++++++ .../python/python3/CVE-2026-6019_p2.patch | 129 +++++++++++++++++ .../python/python3_3.12.13.bb | 2 + 3 files changed, 264 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/CVE-2026-6019_p1.patch create mode 100644 meta/recipes-devtools/python/python3/CVE-2026-6019_p2.patch diff --git a/meta/recipes-devtools/python/python3/CVE-2026-6019_p1.patch b/meta/recipes-devtools/python/python3/CVE-2026-6019_p1.patch new file mode 100644 index 00000000000..78b01574c91 --- /dev/null +++ b/meta/recipes-devtools/python/python3/CVE-2026-6019_p1.patch @@ -0,0 +1,133 @@ +From be751c3f3a11d40c2133bee5fb6ab6931df31936 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Thu, 23 Apr 2026 15:05:17 +0200 +Subject: [PATCH] [3.13] gh-90309: Base64-encode cookie values embedded in + JS (GH-148888) + +CVE: CVE-2026-6019 +Upstream-Status: Backport [https://github.com/python/cpython/commit/3c59b8b53fc75c7f9578d16fb8201ceb43e8f76c] + +Backport Changes: +- This file is not present in the current version and is therefore omitted. + Misc/NEWS.d/next/Security/2026-04-21-13-46-30.gh-issue-90309.srvj9q.rst + +(cherry picked from commit 76b3923d688c0efc580658476c5f525ec8735104) + +Co-authored-by: Seth Larson +(cherry picked from commit 3c59b8b53fc75c7f9578d16fb8201ceb43e8f76c) +Signed-off-by: Sudhir Dumbhare +--- + Lib/http/cookies.py | 8 ++++++-- + Lib/test/test_http_cookies.py | 29 ++++++++++++++++++----------- + 2 files changed, 24 insertions(+), 13 deletions(-) + +diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py +index 63d119ad46c..aebc2a163e4 100644 +--- a/Lib/http/cookies.py ++++ b/Lib/http/cookies.py +@@ -389,17 +389,21 @@ class Morsel(dict): + return '<%s: %s>' % (self.__class__.__name__, self.OutputString()) + + def js_output(self, attrs=None): ++ import base64 + # Print javascript + output_string = self.OutputString(attrs) + if _has_control_character(output_string): + raise CookieError("Control characters are not allowed in cookies") ++ # Base64-encode value to avoid template ++ # injection in cookie values. ++ output_encoded = base64.b64encode(output_string.encode('utf-8')).decode("ascii") + return """ + +- """ % (output_string.replace('"', r'\"')) ++ """ % (output_encoded,) + + def OutputString(self, attrs=None): + # Build up our result +diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py +index 2478a6c630f..6aa5df068f9 100644 +--- a/Lib/test/test_http_cookies.py ++++ b/Lib/test/test_http_cookies.py +@@ -1,5 +1,5 @@ + # Simple test suite for http/cookies.py +- ++import base64 + import copy + import unittest + import doctest +@@ -152,17 +152,19 @@ class CookieTests(unittest.TestCase): + + self.assertEqual(C.output(['path']), + 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') +- self.assertEqual(C.js_output(), r""" ++ cookie_encoded = base64.b64encode(b'Customer="WILE_E_COYOTE"; Path=/acme; Version=1').decode('ascii') ++ self.assertEqual(C.js_output(), fr""" + + """) +- self.assertEqual(C.js_output(['path']), r""" ++ cookie_encoded = base64.b64encode(b'Customer="WILE_E_COYOTE"; Path=/acme').decode('ascii') ++ self.assertEqual(C.js_output(['path']), fr""" + + """) +@@ -259,17 +261,19 @@ class CookieTests(unittest.TestCase): + + self.assertEqual(C.output(['path']), + 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') +- self.assertEqual(C.js_output(), r""" ++ expected_encoded_cookie = base64.b64encode(b'Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1').decode('ascii') ++ self.assertEqual(C.js_output(), fr""" + + """) +- self.assertEqual(C.js_output(['path']), r""" ++ expected_encoded_cookie = base64.b64encode(b'Customer=\"WILE_E_COYOTE\"; Path=/acme').decode('ascii') ++ self.assertEqual(C.js_output(['path']), fr""" + + """) +@@ -360,13 +364,16 @@ class MorselTests(unittest.TestCase): + self.assertEqual( + M.output(), + "Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i)) ++ expected_encoded_cookie = base64.b64encode( ++ ("%s=%s; Path=/foo" % (i, "%s_coded_val" % i)).encode("ascii") ++ ).decode('ascii') + expected_js_output = """ + +- """ % (i, "%s_coded_val" % i) ++ """ % (expected_encoded_cookie,) + self.assertEqual(M.js_output(), expected_js_output) + for i in ["foo bar", "foo@bar"]: + # Try some illegal characters +-- +2.35.6 + diff --git a/meta/recipes-devtools/python/python3/CVE-2026-6019_p2.patch b/meta/recipes-devtools/python/python3/CVE-2026-6019_p2.patch new file mode 100644 index 00000000000..0646bd2133f --- /dev/null +++ b/meta/recipes-devtools/python/python3/CVE-2026-6019_p2.patch @@ -0,0 +1,129 @@ +From de449bbc6ff4ce869c17fb551dacc69de25d73a9 Mon Sep 17 00:00:00 2001 +From: Stan Ulbrych +Date: Mon, 8 Jun 2026 20:15:21 +0100 +Subject: [PATCH] [3.13] gh-149144: Use `decodeURIComponent()` for UTF-8 + support in `js_output()` (GH-149157) (#150949) + +CVE: CVE-2026-6019 +Upstream-Status: Backport [https://github.com/python/cpython/commit/e7d4c3ff421916986223690a8425d2383f6f3802] + +Co-authored-by: Seth Larson +(cherry picked from commit e7d4c3ff421916986223690a8425d2383f6f3802) +Signed-off-by: Sudhir Dumbhare +--- + Lib/http/cookies.py | 6 +++--- + Lib/test/test_http_cookies.py | 27 ++++++++++++++------------- + 2 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py +index aebc2a163e4..2cffa2a9ad6 100644 +--- a/Lib/http/cookies.py ++++ b/Lib/http/cookies.py +@@ -389,18 +389,18 @@ class Morsel(dict): + return '<%s: %s>' % (self.__class__.__name__, self.OutputString()) + + def js_output(self, attrs=None): +- import base64 ++ import urllib.parse + # Print javascript + output_string = self.OutputString(attrs) + if _has_control_character(output_string): + raise CookieError("Control characters are not allowed in cookies") + # Base64-encode value to avoid template + # injection in cookie values. +- output_encoded = base64.b64encode(output_string.encode('utf-8')).decode("ascii") ++ output_encoded = urllib.parse.quote(output_string, safe='', encoding='utf-8') + return """ + + """ % (output_encoded,) +diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py +index 6aa5df068f9..b9cc59cd1db 100644 +--- a/Lib/test/test_http_cookies.py ++++ b/Lib/test/test_http_cookies.py +@@ -1,10 +1,10 @@ + # Simple test suite for http/cookies.py +-import base64 + import copy + import unittest + import doctest + from http import cookies + import pickle ++import urllib.parse + from test import support + + +@@ -152,19 +152,19 @@ class CookieTests(unittest.TestCase): + + self.assertEqual(C.output(['path']), + 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') +- cookie_encoded = base64.b64encode(b'Customer="WILE_E_COYOTE"; Path=/acme; Version=1').decode('ascii') ++ cookie_encoded = urllib.parse.quote('Customer="WILE_E_COYOTE"; Path=/acme; Version=1', safe='', encoding='utf-8') + self.assertEqual(C.js_output(), fr""" + + """) +- cookie_encoded = base64.b64encode(b'Customer="WILE_E_COYOTE"; Path=/acme').decode('ascii') ++ cookie_encoded = urllib.parse.quote('Customer="WILE_E_COYOTE"; Path=/acme', safe='', encoding='utf-8') + self.assertEqual(C.js_output(['path']), fr""" + + """) +@@ -261,19 +261,19 @@ class CookieTests(unittest.TestCase): + + self.assertEqual(C.output(['path']), + 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') +- expected_encoded_cookie = base64.b64encode(b'Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1').decode('ascii') ++ expected_encoded_cookie = urllib.parse.quote('Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1', safe='', encoding='utf-8') + self.assertEqual(C.js_output(), fr""" + + """) +- expected_encoded_cookie = base64.b64encode(b'Customer=\"WILE_E_COYOTE\"; Path=/acme').decode('ascii') ++ expected_encoded_cookie = urllib.parse.quote('Customer=\"WILE_E_COYOTE\"; Path=/acme', safe='', encoding='utf-8') + self.assertEqual(C.js_output(['path']), fr""" + + """) +@@ -364,13 +364,14 @@ class MorselTests(unittest.TestCase): + self.assertEqual( + M.output(), + "Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i)) +- expected_encoded_cookie = base64.b64encode( +- ("%s=%s; Path=/foo" % (i, "%s_coded_val" % i)).encode("ascii") +- ).decode('ascii') ++ expected_encoded_cookie = urllib.parse.quote( ++ "%s=%s; Path=/foo" % (i, "%s_coded_val" % i), ++ safe='', encoding='utf-8', ++ ) + expected_js_output = """ + + """ % (expected_encoded_cookie,) +-- +2.35.6 + diff --git a/meta/recipes-devtools/python/python3_3.12.13.bb b/meta/recipes-devtools/python/python3_3.12.13.bb index ec9ea94824e..be080c6a362 100644 --- a/meta/recipes-devtools/python/python3_3.12.13.bb +++ b/meta/recipes-devtools/python/python3_3.12.13.bb @@ -40,6 +40,8 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://CVE-2026-4519_p1.patch \ file://CVE-2026-4519_p2.patch \ file://CVE-2026-4519_CVE-2026-4786.patch \ + file://CVE-2026-6019_p1.patch \ + file://CVE-2026-6019_p2.patch \ " SRC_URI:append:class-native = " \