CVE-2026-107287
JSON

6.5medium

Pydantic AI: Excessive resource use when local web fetching converts nested HTML

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.28% (higher than 21% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-v36g-jcw9-x7cwPYSEC-2026-4281PYSEC-2026-4290

Description

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.77.0 until 1.107.7 and 2.52.0, the local web_fetch_tool and the WebFetch local fallback can consume excessive CPU and memory during HTML-to-Markdown conversion of attacker-controlled HTML containing deeply nested block elements. Conversion repeatedly reprocesses accumulated text and can greatly expand intermediate output before the returned-content limit is applied, allowing a model-directed fetch to delay other work in the process. Provider-native web fetching is not affected. This issue is fixed in versions 1.107.7 and 2.52.0.

Affected

Product or packageVersionsReported by
pydantic pydantic-ai>= 1.77.0, < 1.107.7, >= 2.0.0b1, < 2.52.0CVE List
pydantic pydantic-ai-slim>= 1.77.0, < 1.107.7, >= 2.0.0b1, < 2.52.0CVE List
pydantic-ai (PyPI)from 1.77.0 before 1.107.7, from 2.0.0b1 before 2.52.0GitHub Advisory Database, PyPA Advisory Database
pydantic-ai-slim (PyPI)from 1.77.0 before 1.107.7, from 2.0.0b1 before 2.52.0GitHub Advisory Database, PyPA Advisory Database
pydantic pydantic_aifrom 1.77.0 before 1.107.7, from 2.0.0 before 2.52.0NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
PyPA Advisory Database6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Classification

CWE-400CWE-407

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 1.77.0 until 1.107.7 and 2.52.0, the local web_fetch_tool and the WebFetch local fallback can consume excessive CPU and memory during HTML-to-Markdown conversion of attacker-controlled HTML containing deeply nested block elements. Conversion repeatedly reprocesses accumulated text and can greatly expand intermediate output before the returned-content limit is applied, allowing a model-directed fetch to delay other work in the process. Provider-native web fetching is not affected. This issue is fixed in versions 1.107.7 and 2.52.0.

GitHub Advisory Database
Summary

Applications using Pydantic AI's local web-fetch tool can experience excessive CPU and memory use when it converts attacker-controlled HTML. An agent must fetch the affected page; provider-native web fetching is not affected.

Details

Nested block elements cause HTML-to-Markdown conversion to reprocess accumulated text at each level and can greatly expand the intermediate output. The response-body limit bounds downloaded bytes, while the returned-content limit is applied only after conversion. On current releases, conversion runs in a worker thread but can still consume substantial resources and delay other work in the process. Older releases performed conversion on the event loop.

Mitigation

Upgrade to a patched release of pydantic-ai or pydantic-ai-slim. If you cannot upgrade yet, avoid using local web fetching for attacker-controlled HTML.

References

https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-v36g-jcw9-x7cwvendor-advisory, web
https://github.com/pydantic/pydantic-ai/pull/8984patch, vendor-advisory, web
https://github.com/pydantic/pydantic-ai/pull/8985patch, vendor-advisory, web
https://github.com/pydantic/pydantic-ai/commit/2b247add4950bef61d352e7ca8aefbd20539180cpatch, web
https://github.com/pydantic/pydantic-ai/commit/2fd38792693da00a3ca5412aeffb436787af3545patch, web
https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.7patch, release-notes, vendor-advisory, web
https://github.com/pydantic/pydantic-ai/releases/tag/v2.52.0patch, release-notes, vendor-advisory, web
https://github.com/pydantic/pydantic-aipackage
https://pypi.org/project/pydantic-aipackage
https://github.com/advisories/GHSA-v36g-jcw9-x7cwadvisory
https://nvd.nist.gov/vuln/detail/CVE-2026-107287advisory
https://pypi.org/project/pydantic-ai-slimpackage

Sources

SourceRecordLicence
CVE ListCVE-2026-107287 changed 2026-10-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-v36g-jcw9-x7cw changed 2026-10-15CC-BY-4.0
NVDCVE-2026-107287 changed 2026-10-14Public domain
PyPA Advisory DatabasePYSEC-2026-4281 changed 2026-10-15CC-BY-4.0
PyPA Advisory DatabasePYSEC-2026-4290 changed 2026-10-15CC-BY-4.0