From 8d5231e0bfd366b37149113e3ebf64fcd4715ebc6cf4d0f45244ea1404d15d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Wed, 4 Feb 2026 20:54:27 +0100 Subject: [PATCH] Fix bsc#1257041 (CVE-2025-15367) Add CVE-2025-15367-poplib-ctrl-chars.patch fixing bsc#1257041 (CVE-2025-15367) using gh#python/cpython!143924 and doing basically the same as the previous patch for poplib library. --- .gitignore | 1 + CVE-2025-15367-poplib-ctrl-chars.patch | 56 ++++++++++++++++++++++++++ python314.changes | 3 ++ python314.spec | 3 ++ 4 files changed, 63 insertions(+) create mode 100644 CVE-2025-15367-poplib-ctrl-chars.patch diff --git a/.gitignore b/.gitignore index d6ad743..f6861bd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.obscpio _build.* .pbuild +*.orig python314-*-build/ diff --git a/CVE-2025-15367-poplib-ctrl-chars.patch b/CVE-2025-15367-poplib-ctrl-chars.patch new file mode 100644 index 0000000..5fe8248 --- /dev/null +++ b/CVE-2025-15367-poplib-ctrl-chars.patch @@ -0,0 +1,56 @@ +From b6f733b285b1c4f27dacb5c2e1f292c914e8b933 Mon Sep 17 00:00:00 2001 +From: Seth Michael Larson +Date: Fri, 16 Jan 2026 10:54:09 -0600 +Subject: [PATCH 1/2] Add 'test.support' fixture for C0 control characters + +--- + Lib/poplib.py | 2 ++ + Lib/test/test_poplib.py | 8 ++++++++ + Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst | 1 + + 3 files changed, 11 insertions(+) + +Index: Python-3.14.2/Lib/poplib.py +=================================================================== +--- Python-3.14.2.orig/Lib/poplib.py 2026-02-04 22:23:00.168506856 +0100 ++++ Python-3.14.2/Lib/poplib.py 2026-02-04 22:23:04.642467762 +0100 +@@ -122,6 +122,8 @@ + def _putcmd(self, line): + if self._debugging: print('*cmd*', repr(line)) + line = bytes(line, self.encoding) ++ if re.search(b'[\x00-\x1F\x7F]', line): ++ raise ValueError('Control characters not allowed in commands') + self._putline(line) + + +Index: Python-3.14.2/Lib/test/test_poplib.py +=================================================================== +--- Python-3.14.2.orig/Lib/test/test_poplib.py 2026-02-04 22:23:01.857420849 +0100 ++++ Python-3.14.2/Lib/test/test_poplib.py 2026-02-04 22:23:04.642886463 +0100 +@@ -17,6 +17,7 @@ + from test.support import threading_helper + from test.support import asynchat + from test.support import asyncore ++from test.support import control_characters_c0 + + + test_support.requires_working_socket(module=True) +@@ -395,6 +396,13 @@ + self.assertIsNone(self.client.sock) + self.assertIsNone(self.client.file) + ++ def test_control_characters(self): ++ for c0 in control_characters_c0(): ++ with self.assertRaises(ValueError): ++ self.client.user(f'user{c0}') ++ with self.assertRaises(ValueError): ++ self.client.pass_(f'{c0}pass') ++ + @requires_ssl + def test_stls_capa(self): + capa = self.client.capa() +Index: Python-3.14.2/Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ Python-3.14.2/Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst 2026-02-04 22:23:04.643241399 +0100 +@@ -0,0 +1 @@ ++Reject control characters in POP3 commands. diff --git a/python314.changes b/python314.changes index f394510..ffd92ba 100644 --- a/python314.changes +++ b/python314.changes @@ -9,6 +9,9 @@ Wed Feb 4 00:53:37 UTC 2026 - Matej Cepl (CVE-2026-0865) rejecting control characters in wsgiref.headers.Headers, which could be abused for injecting false HTTP headers. +- Add CVE-2025-15367-poplib-ctrl-chars.patch fixing bsc#1257041 + (CVE-2025-15367) using gh#python/cpython!143924 and doing + basically the same as the previous patch for poplib library. ------------------------------------------------------------------- Thu Jan 29 12:58:15 UTC 2026 - Matej Cepl diff --git a/python314.spec b/python314.spec index c845b7c..d444e61 100644 --- a/python314.spec +++ b/python314.spec @@ -240,6 +240,9 @@ Patch49: CVE-2025-12781-b64decode-alt-chars.patch # PATCH-FIX-UPSTREAM CVE-2026-0865-wsgiref-ctrl-chars.patch bsc#1257042 mcepl@suse.com # Reject control characters in wsgiref.headers.Headers Patch50: CVE-2026-0865-wsgiref-ctrl-chars.patch +# PATCH-FIX-UPSTREAM CVE-2025-15367-poplib-ctrl-chars.patch bsc#1257041 mcepl@suse.com +# Reject control characters in poplib +Patch51: CVE-2025-15367-poplib-ctrl-chars.patch #### Python 3.14 END OF PATCHES BuildRequires: autoconf-archive BuildRequires: automake