public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pydantic] f45: Backport fix for CVE-2026-133424
@ 2026-11-21  7:54 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-11-21  7:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-pydantic
Branch : f45
Commit : 3462d86104ff15af7be0f333ec16e76b641020d1
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-11-21T07:50:08+00:00
Stats  : +74/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-pydantic/c/3462d86104ff15af7be0f333ec16e76b641020d1?branch=f45

Log:
Backport fix for CVE-2026-133424

---
diff --git a/0001-Ignore-extra-data-matching-a-field-name-in-TypedDict.patch b/0001-Ignore-extra-data-matching-a-field-name-in-TypedDict.patch
new file mode 100644
index 0000000..d4aa001
--- /dev/null
+++ b/0001-Ignore-extra-data-matching-a-field-name-in-TypedDict.patch
@@ -0,0 +1,61 @@
+From 02710b29afcaa1d441a2bb9482d1b574352e31ed Mon Sep 17 00:00:00 2001
+From: Victorien <65306057+Viicos@users.noreply.github.com>
+Date: Thu, 29 Oct 2026 11:27:34 +0100
+Subject: [PATCH] Ignore extra data matching a field name in `TypedDict` and
+ dataclasses with `extra=allow` (#14090)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is only the Pydantic (testing) portion of the fix. Furthermore, it
+doesn’t include tests that would require the `py_and_json` fixture that
+was added in https://github.com/pydantic/pydantic/pull/13275.
+---
+ tests/test_dataclasses.py     | 10 ++++++++++
+ tests/test_types_typeddict.py |  9 +++++++++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/tests/test_dataclasses.py b/tests/test_dataclasses.py
+index e367b854c..034437790 100644
+--- a/tests/test_dataclasses.py
++++ b/tests/test_dataclasses.py
+@@ -1542,6 +1542,16 @@ def test_new_not_called():
+     assert pyd_instance.a == test_string
+ 
+ 
++def test_runtime_extra_allow_field_override_ignored() -> None:
++    @pydantic.dataclasses.dataclass
++    class Foo:
++        a: int = Field(0, alias='b')
++
++    ta = TypeAdapter(Foo)
++    assert ta.validate_python({'b': 1, 'a': 'not_an_int', 'c': 2}, extra='allow').__dict__ == {'a': 1, 'c': 2}
++    assert ta.validate_json('{"b": 1, "a": "not_an_int", "c": 2}', extra='allow').__dict__ == {'a': 1, 'c': 2}
++
++
+ def test_ignore_extra():
+     @pydantic.dataclasses.dataclass(config=ConfigDict(extra='ignore'))
+     class Foo:
+diff --git a/tests/test_types_typeddict.py b/tests/test_types_typeddict.py
+index f4acd2ebf..735b41596 100644
+--- a/tests/test_types_typeddict.py
++++ b/tests/test_types_typeddict.py
+@@ -1053,6 +1053,15 @@ def test_typeddict_extraitems_generic() -> None:
+     assert exc.value.errors()[0]['loc'] == ('extra',)
+ 
+ 
++def test_typeddict_runtime_extra_allow_cannot_override_field() -> None:
++    class TD(TypedDict):
++        a: Annotated[int, Field(alias='b')]
++
++    ta = TypeAdapter(TD)
++    assert ta.validate_python({'b': 1, 'a': 'not_an_int', 'c': 2}, extra='allow') == {'a': 1, 'c': 2}
++    assert ta.validate_json('{"b": 1, "a": "not_an_int", "c": 2}', extra='allow') == {'a': 1, 'c': 2}
++
++
+ def test_typeddict_incompatible_extra_config_warning() -> None:
+     @with_config(extra='allow')
+     class TD1(TypedDict, closed=True):
+-- 
+2.56.1
+

diff --git a/python-pydantic.spec b/python-pydantic.spec
index 8385bdf..328bc99 100644
--- a/python-pydantic.spec
+++ b/python-pydantic.spec
@@ -22,6 +22,16 @@ Patch:          %{url}/commit/e3fe82eba47c78758a21d8413c52063fc105550e.patch
 # Fixes https://www.cve.org/CVERecord?id=CVE-2026-133276:
 # https://bugzilla.redhat.com/show_bug.cgi?id=2578238
 Patch:          %{url}/commit/dd139b5ddc2fbbb63cb1a178104d35f5076ef550.patch
+# Ignore extra data matching a field name in TypedDict and dataclasses with
+# extra=allow (#14090)
+# https://github.com/pydantic/pydantic/commit/34491f5328f168f14e3769cd5f0f83c0af0f4778
+# Fixes https://www.cve.org/CVERecord?id=CVE-2026-133424:
+# https://bugzilla.redhat.com/show_bug.cgi?id=2578015
+# Cherry-picked to v2.13.5. This is only the Pydantic (testing) portion of the
+# fix. An accompanying pydantic-core patch is required. Furthermore, it doesn’t
+# include tests that would require the `py_and_json` fixture that was added in
+# https://github.com/pydantic/pydantic/pull/13275.
+Patch:          0001-Ignore-extra-data-matching-a-field-name-in-TypedDict.patch
 
 BuildArch:      noarch
 
@@ -64,6 +74,9 @@ Data validation and settings management using python type hinting.}
 Summary:        %{summary}
 Recommends:     python3-pydantic+email
 
+# Need the release with the backported fix for CVE-2026-133424
+Requires:       python3-pydantic-core >= 2.46.5-8
+
 %description -n python3-pydantic %{_description}
 
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-21  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-21  7:54 [rpms/python-pydantic] f45: Backport fix for CVE-2026-133424 Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox