Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2026-107287 — pydantic-ai

MEDIUMFix: pydantic/pydantic-ai@2b247ad

CVE-2026-107287 is a medium-severity (CVSS 6.5) Uncontrolled Resource Consumption vulnerability in pydantic-ai. A fix is available for pydantic-ai — see the affected versions and patch details below.

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

Also known asGHSA-v36g-jcw9-x7cwPYSEC-2026-4281PYSEC-2026-4290
Published
Updated
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-107287.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs19th percentile — riskier than 19% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2026-107287 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

4 pkgs affected
🐍pydantic-ai🐍pydantic-ai🐍pydantic-ai-slim🐍pydantic-ai-slim

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

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.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIpydantic-ai≥ 1.77.0&&< 1.107.71.107.7pip install --upgrade 'pydantic-ai==1.107.7'
🐍PyPIpydantic-ai≥ 2.0.0b1&&< 2.52.02.52.0pip install --upgrade 'pydantic-ai==2.52.0'
🐍PyPIpydantic-ai-slim≥ 1.77.0&&< 1.107.71.107.7pip install --upgrade 'pydantic-ai-slim==1.107.7'
🐍PyPIpydantic-ai-slim≥ 2.0.0b1&&< 2.52.02.52.0pip install --upgrade 'pydantic-ai-slim==2.52.0'

Affected Products

1 product · 2 configurations
Application
pydantic aipydantic
≥ 2.0.0 && < 2.52.0
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pydantic-ai, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update pydantic-ai to 1.107.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-107287 is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

Red Hat has rated this flaw as MODERATE severity. The pydantic-ai package, as shipped in Red Hat Enterprise Linux AI and Lightspeed Core container images, is affected by a denial-of-service flaw in its local web fetching. When the local web_fetch_tool or the WebFetch local fallback processes attacker-controlled HTML…

Workaround published by Red Hat
A workaround is available: configure agents to use provider-native web fetching, which is not affected by this issue, instead of the local web_fetch_tool or the WebFetch local fallback. Disabling or restricting the local web fetch tool so it cannot be used for model-directed fetches of untrusted URLs also reduces exposure. Upstream has fixed this issue in pydantic-ai 1.107.7 and 2.52.0; however, the fix for the Red Hat delivered products is currently deferred.
Source: Red Hat security advisory for CVE-2026-107287 (CC BY 4.0)

Frequently Asked Questions

### 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 subst
O3 Security · Impact-Aware SCA

Is CVE-2026-107287 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2026-107287: pydantic-ai — Fixed in 1.107.7