Validating an untrusted ISO 8601 duration string into a timedelta field with Pydantic V1 takes quadratic time: an input of a few dozen kilobytes takes seconds to validate.

The iso8601_duration_re regular expression used to parse ISO 8601 durations (in pydantic/datetime_parse.py) contains an unescaped ".", which also matches digits. On a string of digits, the repeated groups overlap and the regex engine backtracks in quadratic time.

The issue was fixed in commit 62791e66a9f8f118e465ed760c9e2ede9ae3055e. Users relying on the pydantic.v1 namespace in Pydantic V2 should upgrade to 2.14.2 or later.

Impact: denial of service through validation of untrusted input. Affected are applications validating untrusted strings into timedelta fields.

Project Subscriptions

Vendors Products
Pydantic Subscribe
Pydantic Subscribe
Advisories

No advisories yet.

Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Fri, 20 Nov 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Pydantic
Pydantic pydantic
Vendors & Products Pydantic
Pydantic pydantic

Fri, 20 Nov 2026 07:45:00 +0000

Type Values Removed Values Added
Description Validating an untrusted ISO 8601 duration string into a timedelta field with Pydantic V1 takes quadratic time: an input of a few dozen kilobytes takes seconds to validate. The iso8601_duration_re regular expression used to parse ISO 8601 durations (in pydantic/datetime_parse.py) contains an unescaped ".", which also matches digits. On a string of digits, the repeated groups overlap and the regex engine backtracks in quadratic time. The issue was fixed in commit 62791e66a9f8f118e465ed760c9e2ede9ae3055e. Users relying on the pydantic.v1 namespace in Pydantic V2 should upgrade to 2.14.2 or later. Impact: denial of service through validation of untrusted input. Affected are applications validating untrusted strings into timedelta fields.
Title Quadratic time timedelta validation in Pydantic V1
Weaknesses CWE-1333
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: Pydantic

Published:

Updated: 2026-11-20T17:21:34.429Z

Reserved: 2026-11-19T19:25:01.883Z

Link: CVE-2026-133421

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-20T08:18:32.037

Modified: 2026-11-20T18:18:47.700

Link: CVE-2026-133421

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-20T20:30:21Z

Weaknesses