public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pydantic] f45: Backport fix for CVE-2026-133422
Date: Fri, 20 Nov 2026 20:33:24 GMT	[thread overview]
Message-ID: <179520680499.1.11960241807812674156.rpms-python-pydantic-32b0d6d03278@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-pydantic
Branch : f45
Commit : 32b0d6d03278f0dd97cd7eb30c667a056c7d69ef
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-11-20T20:19:35+00:00
Stats  : +124/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pydantic/c/32b0d6d03278f0dd97cd7eb30c667a056c7d69ef?branch=f45

Log:
Backport fix for CVE-2026-133422

---
diff --git a/dd139b5ddc2fbbb63cb1a178104d35f5076ef550.patch b/dd139b5ddc2fbbb63cb1a178104d35f5076ef550.patch
new file mode 100644
index 0000000..e0bfea2
--- /dev/null
+++ b/dd139b5ddc2fbbb63cb1a178104d35f5076ef550.patch
@@ -0,0 +1,117 @@
+From dd139b5ddc2fbbb63cb1a178104d35f5076ef550 Mon Sep 17 00:00:00 2001
+From: Viicos <65306057+Viicos@users.noreply.github.com>
+Date: Thu, 29 Oct 2026 16:36:03 +0100
+Subject: [PATCH] Bump `pydantic.v1` namespace to v1.10.27
+
+Backport of: #14114
+---
+ pydantic/v1/dataclasses.py    |  7 +++++--
+ pydantic/v1/datetime_parse.py |  8 ++++----
+ pydantic/v1/mypy.py           |  3 ++-
+ pydantic/v1/types.py          | 14 +++++++++++---
+ pydantic/v1/version.py        |  2 +-
+ 5 files changed, 23 insertions(+), 11 deletions(-)
+
+diff --git a/pydantic/v1/dataclasses.py b/pydantic/v1/dataclasses.py
+index bd1670291d6..7da57131eaf 100644
+--- a/pydantic/v1/dataclasses.py
++++ b/pydantic/v1/dataclasses.py
+@@ -229,7 +229,8 @@ def wrap(cls: Type[Any]) -> 'DataclassClassOrWrapper':
+ 
+         should_validate_on_init = default_validate_on_init if validate_on_init is None else validate_on_init
+         _add_pydantic_validation_attributes(cls, the_config, should_validate_on_init, dc_cls_doc)
+-        dc_cls.__pydantic_model__.__try_update_forward_refs__(**{cls.__name__: cls})
++        localns = {cls.__name__: cls}
++        dc_cls.__pydantic_model__.__try_update_forward_refs__(**localns)
+         return dc_cls
+ 
+     if _cls is None:
+@@ -294,7 +295,9 @@ def handle_extra_init(self: 'Dataclass', *args: Any, **kwargs: Any) -> None:
+ 
+         elif config.extra == Extra.allow:
+             for k, v in kwargs.items():
+-                self.__dict__.setdefault(k, v)
++                # internal attributes are not valid extra fields, and should not be set from user input:
++                if not k.startswith('__pydantic'):
++                    self.__dict__.setdefault(k, v)
+             init(self, *args, **{k: v for k, v in kwargs.items() if k in self.__dataclass_fields__})
+ 
+         else:
+diff --git a/pydantic/v1/datetime_parse.py b/pydantic/v1/datetime_parse.py
+index a7598fc6c56..4ba3a040000 100644
+--- a/pydantic/v1/datetime_parse.py
++++ b/pydantic/v1/datetime_parse.py
+@@ -45,11 +45,11 @@
+ iso8601_duration_re = re.compile(
+     r'^(?P<sign>[-+]?)'
+     r'P'
+-    r'(?:(?P<days>\d+(.\d+)?)D)?'
++    r'(?:(?P<days>\d+(\.\d+)?)D)?'
+     r'(?:T'
+-    r'(?:(?P<hours>\d+(.\d+)?)H)?'
+-    r'(?:(?P<minutes>\d+(.\d+)?)M)?'
+-    r'(?:(?P<seconds>\d+(.\d+)?)S)?'
++    r'(?:(?P<hours>\d+(\.\d+)?)H)?'
++    r'(?:(?P<minutes>\d+(\.\d+)?)M)?'
++    r'(?:(?P<seconds>\d+(\.\d+)?)S)?'
+     r')?'
+     r'$'
+ )
+diff --git a/pydantic/v1/mypy.py b/pydantic/v1/mypy.py
+index 0a77569218c..e83b08edb22 100644
+--- a/pydantic/v1/mypy.py
++++ b/pydantic/v1/mypy.py
+@@ -593,7 +593,8 @@ def get_config_update(self, substmt: AssignmentStmt) -> Optional['ModelConfigDat
+                 has_alias_generator = False
+             return ModelConfigData(has_alias_generator=has_alias_generator)
+         if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname in ('builtins.True', 'builtins.False'):
+-            return ModelConfigData(**{lhs.name: substmt.rvalue.fullname == 'builtins.True'})
++            config_data = {lhs.name: substmt.rvalue.fullname == 'builtins.True'}
++            return ModelConfigData(**config_data)
+         error_invalid_config_value(lhs.name, self._ctx.api, substmt)
+         return None
+ 
+diff --git a/pydantic/v1/types.py b/pydantic/v1/types.py
+index e1840d99f79..34f7317b2f7 100644
+--- a/pydantic/v1/types.py
++++ b/pydantic/v1/types.py
+@@ -572,6 +572,9 @@ def confrozenset(
+ 
+ 
+ # This types superclass should be List[T], but cython chokes on that...
++_HASHABLE_SCALAR_TYPES = {int, float, str, bytes, bool, type(None)}
++
++
+ class ConstrainedList(list):  # type: ignore
+     # Needed for pydantic to detect that this is a list
+     __origin__ = list
+@@ -613,9 +616,14 @@ def unique_items_validator(cls, v: 'Optional[List[T]]') -> 'Optional[List[T]]':
+         if v is None:
+             return None
+ 
+-        for i, value in enumerate(v, start=1):
+-            if value in v[i:]:
+-                raise errors.ListUniqueItemsError()
++        if all(type(value) in _HASHABLE_SCALAR_TYPES for value in v):
++            # builtin scalars have well-behaved hashing, duplicates can be detected in linear time:
++            has_duplicates = len(set(v)) != len(v)
++        else:
++            has_duplicates = any(value in v[i:] for i, value in enumerate(v, start=1))
++
++        if has_duplicates:
++            raise errors.ListUniqueItemsError()
+ 
+         return v
+ 
+diff --git a/pydantic/v1/version.py b/pydantic/v1/version.py
+index 6ba1cb08332..d7c63f0a941 100644
+--- a/pydantic/v1/version.py
++++ b/pydantic/v1/version.py
+@@ -1,6 +1,6 @@
+ __all__ = 'compiled', 'VERSION', 'version_info'
+ 
+-VERSION = '1.10.26'
++VERSION = '1.10.27'
+ 
+ try:
+     import cython  # type: ignore

diff --git a/python-pydantic.spec b/python-pydantic.spec
index 3fc49b5..ee417b8 100644
--- a/python-pydantic.spec
+++ b/python-pydantic.spec
@@ -12,9 +12,14 @@ URL:            https://github.com/pydantic/pydantic
 Source:         %{url}/archive/v%{version}/pydantic-%{version}.tar.gz
 
 # Fix test failures with pytest >= 9.1.0 (non-Collection iterables in parametrize)
-Patch:          https://github.com/pydantic/pydantic/commit/53706f8f95585f2ae0cee43c1df944956dd2a31f.patch
+Patch:          %{url}/commit/53706f8f95585f2ae0cee43c1df944956dd2a31f.patch
 # Fix use of pytest.warns(match=...) with pytest >= 9.1.0
-Patch:          https://github.com/pydantic/pydantic/commit/e3fe82eba47c78758a21d8413c52063fc105550e.patch
+Patch:          %{url}/commit/e3fe82eba47c78758a21d8413c52063fc105550e.patch
+# Bump `pydantic.v1` namespace to v1.10.27
+# https://github.com/pydantic/pydantic/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550
+# Fixes https://www.cve.org/CVERecord?id=CVE-2026-133422:
+# https://bugzilla.redhat.com/show_bug.cgi?id=2578018
+Patch:          %{url}/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550.patch
 
 BuildArch:      noarch
 

                 reply	other threads:[~2026-11-20 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179520680499.1.11960241807812674156.rpms-python-pydantic-32b0d6d03278@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox