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 package | Versions | Reported by |
|---|---|---|
| pydantic pydantic-ai | >= 1.77.0, < 1.107.7, >= 2.0.0b1, < 2.52.0 | CVE List |
| pydantic pydantic-ai-slim | >= 1.77.0, < 1.107.7, >= 2.0.0b1, < 2.52.0 | CVE List |
| pydantic-ai (PyPI) | from 1.77.0 before 1.107.7, from 2.0.0b1 before 2.52.0 | GitHub Advisory Database, PyPA Advisory Database |
| pydantic-ai-slim (PyPI) | from 1.77.0 before 1.107.7, from 2.0.0b1 before 2.52.0 | GitHub Advisory Database, PyPA Advisory Database |
| pydantic pydantic_ai | from 1.77.0 before 1.107.7, from 2.0.0 before 2.52.0 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
Classification
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-x7cw | vendor-advisory, web | |
| https://github.com/pydantic/pydantic-ai/pull/8984 | patch, vendor-advisory, web | |
| https://github.com/pydantic/pydantic-ai/pull/8985 | patch, vendor-advisory, web | |
| https://github.com/pydantic/pydantic-ai/commit/2b247add4950bef61d352e7ca8aefbd20539180c | patch, web | |
| https://github.com/pydantic/pydantic-ai/commit/2fd38792693da00a3ca5412aeffb436787af3545 | patch, web | |
| https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.7 | patch, release-notes, vendor-advisory, web | |
| https://github.com/pydantic/pydantic-ai/releases/tag/v2.52.0 | patch, release-notes, vendor-advisory, web | |
| https://github.com/pydantic/pydantic-ai | package | |
| https://pypi.org/project/pydantic-ai | package | |
| https://github.com/advisories/GHSA-v36g-jcw9-x7cw | advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-107287 | advisory | |
| https://pypi.org/project/pydantic-ai-slim | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-107287 changed 2026-10-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-v36g-jcw9-x7cw changed 2026-10-15 | CC-BY-4.0 |
| NVD | CVE-2026-107287 changed 2026-10-14 | Public domain |
| PyPA Advisory Database | PYSEC-2026-4281 changed 2026-10-15 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-4290 changed 2026-10-15 | CC-BY-4.0 |