Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python313 for openSUSE:Factory 
checked in at 2026-11-25 16:12:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python313 (Old)
 and      /work/SRC/openSUSE:Factory/.python313.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python313"

Wed Nov 25 16:12:06 2026 rev:50 rq:1400209 version:3.13.18

Changes:
--------
--- /work/SRC/openSUSE:Factory/python313/python313.changes      2026-11-17 
17:16:11.100958500 +0100
+++ /work/SRC/openSUSE:Factory/.python313.new.1340718/python313.changes 
2026-11-25 16:12:39.047607841 +0100
@@ -1,0 +2,14 @@
+Mon Nov 23 14:41:46 UTC 2026 - Matej Cepl <[email protected]>
+
+- CVE-2026-103995: gh-150751: validate http.client
+  Content-Length and chunk-size (bsc#1288328)
+  CVE-2026-103995-http-client-framing.patch
+
+-------------------------------------------------------------------
+Fri Nov 20 14:23:44 UTC 2026 - Matej Cepl <[email protected]>
+
+- CVE-2026-116566: Reject null bytes in socket.getaddrinfo()
+  host and port (bsc#1289106)
+  CVE-2026-116566-socket-getaddrinfo-null-bytes.patch
+
+-------------------------------------------------------------------

New:
----
  CVE-2026-103995-http-client-framing.patch
  CVE-2026-116566-socket-getaddrinfo-null-bytes.patch

----------(New B)----------
  New:  Content-Length and chunk-size (bsc#1288328)
  CVE-2026-103995-http-client-framing.patch
  New:  host and port (bsc#1289106)
  CVE-2026-116566-socket-getaddrinfo-null-bytes.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python313.spec ++++++
--- /var/tmp/diff_new_pack.j3qpF8/_old  2026-11-25 16:12:40.243658586 +0100
+++ /var/tmp/diff_new_pack.j3qpF8/_new  2026-11-25 16:12:40.245658671 +0100
@@ -245,6 +245,12 @@
 # PATCH-FIX-UPSTREAM CVE-2025-15366-pop3-ctrl-chars.patch bsc#1257041 
[email protected]
 # Reject control characters in POP3 commands
 Patch55:        CVE-2025-15366-pop3-ctrl-chars.patch
+# PATCH-FIX-UPSTREAM CVE-2026-116566-socket-getaddrinfo-null-bytes.patch 
bsc#1289106 [email protected]
+# Reject null bytes in socket.getaddrinfo() host and port
+Patch56:        CVE-2026-116566-socket-getaddrinfo-null-bytes.patch
+# PATCH-FIX-UPSTREAM CVE-2026-103995-http-client-framing.patch bsc#1288328 
[email protected]
+# gh-150751: validate http.client Content-Length and chunk-size
+Patch57:        CVE-2026-103995-http-client-framing.patch
 #### END OF PATCHES
 BuildRequires:  autoconf-archive
 BuildRequires:  automake

++++++ CVE-2026-103995-http-client-framing.patch ++++++
>From 7a4b8aeb642970bc5bed1edba762440abe8b80b2 Mon Sep 17 00:00:00 2001
From: metsw24-max <[email protected]>
Date: Thu, 8 Oct 2026 18:10:51 +0530
Subject: [PATCH 1/3] gh-150751: validate http.client Content-Length and
 chunk-size (GH-150752)

RFC 9112 defines Content-Length as 1*DIGIT and chunk-size as 1*HEXDIG, but 
int() also accepts a sign, underscores, surrounding whitespace and an 0x 
prefix, so malformed framing values were parsed instead of rejected.
(cherry picked from commit 2eb2af805c156ca52b316bb4ced5e0ab3971d0ae)

Co-authored-by: metsw24-max <[email protected]>
---
 Lib/http/client.py                            | 18 +++++++------
 Lib/test/test_httplib.py                      | 27 +++++++++++++++++++
 ...-06-02-13-10-00.gh-issue-150751.Hk2Vw9.rst |  5 ++++
 3 files changed, 42 insertions(+), 8 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Library/2026-06-02-13-10-00.gh-issue-150751.Hk2Vw9.rst

Index: Python-3.13.18/Lib/http/client.py
===================================================================
--- Python-3.13.18.orig/Lib/http/client.py      2026-10-25 19:31:23.000000000 
+0100
+++ Python-3.13.18/Lib/http/client.py   2026-11-23 22:44:15.300705377 +0100
@@ -165,6 +165,11 @@
 # to prevent http header injection.
 _contains_disallowed_method_pchar_re = re.compile('[\x00-\x1f]')
 
+# RFC 9112: Content-Length = 1*DIGIT and chunk-size = 1*HEXDIG.
+# int() is more permissive, so we match against the grammar before calling it.
+_is_legal_content_length = re.compile(r'[0-9]+').fullmatch
+_is_legal_chunk_size = re.compile(rb'[0-9a-fA-F]+').fullmatch
+
 # We always set the Content-Length header for these methods because some
 # servers will otherwise respond with a 411
 _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}
@@ -383,14 +388,12 @@
         # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
         self.length = None
         length = self.headers.get("content-length")
-        if length and not self.chunked:
-            try:
-                self.length = int(length)
-            except ValueError:
-                self.length = None
-            else:
-                if self.length < 0:  # ignore nonsensical negative lengths
-                    self.length = None
+        if length is not None:
+            # RFC 9112, section 5.1: optional whitespace (SP / HTAB) around
+            # the field value is not part of the value.
+            length = length.strip(' \t')
+        if length and not self.chunked and _is_legal_content_length(length):
+            self.length = int(length)
         else:
             self.length = None
 
@@ -557,7 +560,10 @@
         i = line.find(b";")
         if i >= 0:
             line = line[:i] # strip chunk-extensions
+        line = line.rstrip()
         try:
+            if not _is_legal_chunk_size(line):
+                raise ValueError("invalid chunk size")
             return int(line, 16)
         except ValueError:
             # close the connection as protocol synchronisation is
Index: Python-3.13.18/Lib/test/test_httplib.py
===================================================================
--- Python-3.13.18.orig/Lib/test/test_httplib.py        2026-10-25 
19:31:23.000000000 +0100
+++ Python-3.13.18/Lib/test/test_httplib.py     2026-11-23 22:44:15.300950930 
+0100
@@ -1263,6 +1263,49 @@
         self.assertEqual(resp.read(), b'Hello\r\n')
         self.assertTrue(resp.isclosed())
 
+    def test_malformed_content_length(self):
+        # RFC 9112: Content-Length = 1*DIGIT.  Values that int() accepts but
+        # the grammar forbids must not be used to frame the body.
+        for value in ('+5', '5_0', '5 0'):
+            with self.subTest(value=value):
+                sock = FakeSocket(
+                    'HTTP/1.1 200 OK\r\nContent-Length: %s\r\n\r\nHello\r\n' % 
value)
+                resp = client.HTTPResponse(sock, method="GET")
+                resp.begin()
+                self.assertIsNone(resp.length)
+                self.assertEqual(resp.read(), b'Hello\r\n')
+                resp.close()
+
+    def test_content_length_with_whitespace(self):
+        # RFC 9112, section 5.1: optional whitespace (SP / HTAB) around
+        # the field value is not part of the value, so it must not
+        # prevent the Content-Length from being used to frame the body.
+        for value in ('7 ', '7\t', '7 \t ', ' 7 '):
+            with self.subTest(value=value):
+                sock = FakeSocket(
+                    'HTTP/1.1 200 OK\r\nContent-Length: %s\r\n\r\n'
+                    'Hello\r\nextra' % value)
+                resp = client.HTTPResponse(sock, method="GET")
+                resp.begin()
+                self.assertEqual(resp.length, 7)
+                self.assertEqual(resp.read(), b'Hello\r\n')
+                self.assertTrue(resp.isclosed())
+                resp.close()
+
+    def test_malformed_chunk_size(self):
+        # RFC 9112: chunk-size = 1*HEXDIG.  Reject sizes that int(_, 16) 
accepts
+        # but the grammar forbids (a sign, an "0x" prefix, underscores or
+        # leading whitespace).
+        start = 'HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n'
+        for size in ('-5', '+5', '0x5', '1_f', ' 5'):
+            with self.subTest(size=size):
+                sock = FakeSocket(start + '%s\r\nHELLO\r\n0\r\n\r\n' % size)
+                resp = client.HTTPResponse(sock, method="GET")
+                resp.begin()
+                self.assertRaises(client.IncompleteRead, resp.read)
+                self.assertTrue(resp.isclosed())
+                resp.close()
+
     def test_incomplete_read(self):
         sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: 
10\r\n\r\nHello\r\n')
         resp = client.HTTPResponse(sock, method="GET")
Index: 
Python-3.13.18/Misc/NEWS.d/next/Library/2026-06-02-13-10-00.gh-issue-150751.Hk2Vw9.rst
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ 
Python-3.13.18/Misc/NEWS.d/next/Library/2026-06-02-13-10-00.gh-issue-150751.Hk2Vw9.rst
      2026-11-23 22:44:15.301662396 +0100
@@ -0,0 +1,5 @@
+:mod:`http.client` now validates the ``Content-Length`` header and the
+chunked ``chunk-size`` against the RFC 9112 grammar (``1*DIGIT`` and
+``1*HEXDIG``) before parsing them, rejecting values such as ``+5``, ``5_0``
+or a ``0x``-prefixed or negative chunk size that :func:`int` would otherwise
+accept. This avoids framing a response differently from a strict peer.

++++++ CVE-2026-116566-socket-getaddrinfo-null-bytes.patch ++++++
>From 589379e4f11e07c15269dfc00dae2bd648e2b4da Mon Sep 17 00:00:00 2001
From: Seth Larson <[email protected]>
Date: Thu, 29 Oct 2026 12:15:29 -0500
Subject: [PATCH] [3.13] gh-160898: Reject null bytes in `socket.getaddrinfo()`
 host and port (GH-160899) (cherry picked from commit
 131a3a66c5f400b588f9fd2732a5ed4e89623ee3) (cherry picked from commit
 ee60d5db8f1668db57f3fc46b97ecf6cd0e251ac)

Co-authored-by: Seth Larson <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
---
 Doc/library/socket.rst                        |  3 ++
 Lib/test/test_socket.py                       | 33 +++++++++++++++++++
 ...-10-27-16-25-40.gh-issue-160898.epi53X.rst |  4 +++
 Modules/socketmodule.c                        | 20 +++++++++--
 4 files changed, 57 insertions(+), 3 deletions(-)
 create mode 100644 
Misc/NEWS.d/next/Security/2026-10-27-16-25-40.gh-issue-160898.epi53X.rst

Index: Python-3.13.18/Doc/library/socket.rst
===================================================================
--- Python-3.13.18.orig/Doc/library/socket.rst  2026-10-25 19:31:23.000000000 
+0100
+++ Python-3.13.18/Doc/library/socket.rst       2026-11-20 15:14:10.581526639 
+0100
@@ -943,6 +943,9 @@
       for IPv6 multicast addresses, string representing an address will not
       contain ``%scope_id`` part.
 
+   .. versionchanged:: next
+      Null characters are now rejected in the *host* and *port* parameters.
+
 .. _Happy Eyeballs: https://en.wikipedia.org/wiki/Happy_Eyeballs
 
 .. function:: getfqdn([name])
Index: Python-3.13.18/Lib/test/test_socket.py
===================================================================
--- Python-3.13.18.orig/Lib/test/test_socket.py 2026-11-20 15:14:03.605592820 
+0100
+++ Python-3.13.18/Lib/test/test_socket.py      2026-11-20 15:14:10.585711568 
+0100
@@ -2042,6 +2042,39 @@
         nameinfo = socket.getnameinfo(sockaddr, socket.NI_NUMERICHOST | 
socket.NI_NUMERICSERV)
         self.assertEqual(nameinfo, ('ff02::1de:c0:face:8d%' + str(ifindex), 
'1234'))
 
+    def test_getaddrinfo_null_bytes(self):
+        # getaddrinfo() must reject embedded null bytes instead of silently
+        # truncating the host or port at the C boundary.  The checks run
+        # before any name resolution, so no network access is needed.
+        hosts = [
+            # embedded
+            'local\0host', b'local\0host',
+            # trailing
+            'localhost\0', b'localhost\0',
+            # leading (truncates to '')
+            '\0localhost', b'\0localhost',
+            '\0', b'\0',
+            # non-ASCII, goes through IDNA
+            'b\xfccher\0.example',
+        ]
+        for host in hosts:
+            with self.subTest(host=host):
+                with self.assertRaisesRegex(ValueError, 'host'):
+                    socket.getaddrinfo(host, 80)
+
+        ports = [
+            '8\x000',
+            b'8\x000',
+            'http\0',
+            b'http\0',
+            '\0',
+            b'\0'
+        ]
+        for port in ports:
+            with self.subTest(port=port):
+                with self.assertRaisesRegex(ValueError, 'port'):
+                    socket.getaddrinfo("localhost", port)
+
     def test_str_for_enums(self):
         # Make sure that the AF_* and SOCK_* constants have enum-like string
         # reprs.
Index: 
Python-3.13.18/Misc/NEWS.d/next/Security/2026-10-27-16-25-40.gh-issue-160898.epi53X.rst
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ 
Python-3.13.18/Misc/NEWS.d/next/Security/2026-10-27-16-25-40.gh-issue-160898.epi53X.rst
     2026-11-20 15:14:10.587628641 +0100
@@ -0,0 +1,4 @@
+.. cve: CVE-2026-116566
+
+:func:`socket.getaddrinfo` now rejects null bytes within *host* and *port*
+parameters as this previously caused the values to be silently truncated.
Index: Python-3.13.18/Modules/socketmodule.c
===================================================================
--- Python-3.13.18.orig/Modules/socketmodule.c  2026-10-25 19:31:23.000000000 
+0100
+++ Python-3.13.18/Modules/socketmodule.c       2026-11-20 15:14:10.591711670 
+0100
@@ -6755,6 +6755,7 @@
     PyObject *pobj = (PyObject *)NULL;
     PyObject *pstr = NULL;
     const char *hptr, *pptr;
+    Py_ssize_t hlen = 0, plen = 0;
     int family, socktype, protocol, flags;
     int error;
     PyObject *all = (PyObject *)NULL;
@@ -6775,33 +6776,46 @@
             return NULL;
         assert(PyBytes_Check(idna));
         hptr = PyBytes_AS_STRING(idna);
+        hlen = PyBytes_GET_SIZE(idna);
     } else if (PyBytes_Check(hobj)) {
-        hptr = PyBytes_AsString(hobj);
+        hptr = PyBytes_AS_STRING(hobj);
+        hlen = PyBytes_GET_SIZE(hobj);
     } else {
         PyErr_SetString(PyExc_TypeError,
                         "getaddrinfo() argument 1 must be string or None");
         return NULL;
     }
+    if (hptr != NULL && strlen(hptr) != (size_t)hlen) {
+        PyErr_SetString(PyExc_ValueError,
+                        "getaddrinfo() host must not contain null characters");
+        goto err;
+    }
     if (PyLong_CheckExact(pobj)) {
         pstr = PyObject_Str(pobj);
         if (pstr == NULL)
             goto err;
         assert(PyUnicode_Check(pstr));
-        pptr = PyUnicode_AsUTF8(pstr);
+        pptr = PyUnicode_AsUTF8AndSize(pstr, &plen);
         if (pptr == NULL)
             goto err;
     } else if (PyUnicode_Check(pobj)) {
-        pptr = PyUnicode_AsUTF8(pobj);
+        pptr = PyUnicode_AsUTF8AndSize(pobj, &plen);
         if (pptr == NULL)
             goto err;
     } else if (PyBytes_Check(pobj)) {
         pptr = PyBytes_AS_STRING(pobj);
+        plen = PyBytes_GET_SIZE(pobj);
     } else if (pobj == Py_None) {
         pptr = (char *)NULL;
     } else {
         PyErr_SetString(PyExc_OSError, "Int or String expected");
         goto err;
     }
+    if (pptr != NULL && strlen(pptr) != (size_t)plen) {
+        PyErr_SetString(PyExc_ValueError,
+                        "getaddrinfo() port must not contain null characters");
+        goto err;
+    }
 #if defined(__APPLE__) && defined(AI_NUMERICSERV)
     if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && 
pptr[1] == 0))) {
         /* On OSX up to at least OSX 10.8 getaddrinfo crashes

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.j3qpF8/_old  2026-11-25 16:12:40.352663211 +0100
+++ /var/tmp/diff_new_pack.j3qpF8/_new  2026-11-25 16:12:40.354663296 +0100
@@ -1,6 +1,6 @@
-mtime: 1794523982
-commit: 7636b58688a3f05daee80cd2d783138de5471c11df8dd5f60dee3cae91482e22
+mtime: 1795471038
+commit: 5daeef7fd78f9cea628916e3439bc2e2860c50be8880c23d5eb51a2d29e1a0f7
 url: https://src.opensuse.org/python-interpreters/python313
-revision: 7636b58688a3f05daee80cd2d783138de5471c11df8dd5f60dee3cae91482e22
+revision: 5daeef7fd78f9cea628916e3439bc2e2860c50be8880c23d5eb51a2d29e1a0f7
 projectscmsync: https://src.opensuse.org/python-interpreters/_ObsPrj
 

++++++ build.specials.obscpio ++++++

++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore      1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore      2026-11-23 22:57:18.000000000 +0100
@@ -0,0 +1,6 @@
+.osc
+*.obscpio
+*.osc
+_build.*
+.pbuild
+python313-*-build/

Reply via email to