# CVE-2026-107287: Pydantic AI excessive resource consumption in HTML-to-Markdown conversion

Source: https://junglewise.ai/threats/cve-2026-107287-pydantic-ai-excessive-resource-use-when-local-web-fetching  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-08. Updated: 2026-10-08  
License: CC BY 4.0 with a link back

CVE-2026-107287 · Severity: medium · CVSS 6.5 · Published 2026-10-08

Pydantic AI is a framework for building AI agents. When the local web-fetching tool processes attacker-controlled HTML with deeply nested elements, it consumes excessive CPU and memory during conversion to Markdown, potentially causing application slowdown or denial of service. The vulnerability only affects applications using the local web-fetch tool; external web fetching is not impacted.

Technologies: [Pydantic AI](https://junglewise.ai/threats/technologies/pydantic-pydantic-ai), [Pydantic AI Slim](https://junglewise.ai/threats/technologies/ai-slim), [pydantic-ai (PyPI)](https://junglewise.ai/threats/technologies/pydantic-ai), [pydantic-ai-slim (PyPI)](https://junglewise.ai/threats/technologies/pydantic-ai-slim). Vendors: [Pydantic](https://junglewise.ai/threats/vendors/pydantic), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-107287 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-107287 being exploited in the wild.

**How severe is CVE-2026-107287?** Medium severity, with a CVSS score of 6.5, published 8 October 2026.

**Which products and versions are affected?** Pydantic AI >=1.77.0, <1.107.7; >=2.0.0b1, <2.52.0; Pydantic AI Slim >=1.77.0, <1.107.7; >=2.0.0b1, <2.52.0; pydantic-ai (PyPI) ECOSYSTEM:introduced=1.77.0,fixed=1.107.7,introduced=2.0.0b1,fixed=2.52.0; pydantic-ai-slim (PyPI) ECOSYSTEM:introduced=1.77.0,fixed=1.107.7,introduced=2.0.0b1,fixed=2.52.0.

**Is there a fix for CVE-2026-107287?** Yes. pydantic-ai (PyPI): upgrade to 2.52.0 or later; pydantic-ai-slim (PyPI): upgrade to 2.52.0 or later. Until then: Avoid using local web fetching for untrusted or attacker-controlled HTML until you can upgrade to a patched release.</anigation>
<parameter name="timeline">[
  {
    "kind": "disclosed",
    "at": "2026-09-30"
  },
  {
    "kind": "advisory",
    "at": "2026-10-08"
  }
] Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-107287 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-107287?** Check whether you run Pydantic AI, Pydantic AI Slim, pydantic-ai (PyPI) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pydantic-ai (PyPI): upgrade to 2.52.0 or later

  ```sh
  pip install "pydantic-ai>=2.52.0"
  ```

- pydantic-ai-slim (PyPI): upgrade to 2.52.0 or later

  ```sh
  pip install "pydantic-ai-slim>=2.52.0"
  ```


Avoid using local web fetching for untrusted or attacker-controlled HTML until you can upgrade to a patched release.</anigation>
<parameter name="timeline">[
  {
    "kind": "disclosed",
    "at": "2026-09-30"
  },
  {
    "kind": "advisory",
    "at": "2026-10-08"
  }
]

## Technical details

The HTML-to-Markdown conversion algorithm reprocesses accumulated text at each nesting level, causing quadratic complexity and memory expansion with nested block elements. The response-body size limit applies only to downloaded bytes, while the returned-content limit is applied post-conversion, leaving the conversion process itself unconstrained. Exploitation requires an agent to fetch the attacker-controlled HTML page; no authentication or special privileges are needed.

## Affected products

- Pydantic pydantic-ai >=1.77.0, <1.107.7; >=2.0.0b1, <2.52.0
- Pydantic pydantic-ai-slim >=1.77.0, <1.107.7; >=2.0.0b1, <2.52.0

## Identifiers

- CVE-2026-107287
- GHSA-v36g-jcw9-x7cw
- PYSEC-2026-4281
- PYSEC-2026-4290

## References

- [https://api.github.com/users/SounLabs](https://api.github.com/users/SounLabs)

## Related threats

- [Pydantic AI concurrency slot leak in streamed requests](https://junglewise.ai/threats/cve-2026-107286-pydantic-ai-concurrency-limited-models-can-keep-their-slot-when)
- [Pydantic AI web chat UI Host header validation bypass](https://junglewise.ai/threats/cve-2026-107292-pydantic-ai-web-chat-ui-agent-to-web-clai-web-the-local-chat)
- [Pydantic AI missing content-type validation in chat endpoint](https://junglewise.ai/threats/cve-2026-107295-pydantic-ai-web-chat-ui-agent-to-web-clai-web-a-website-visited)
- [Pydantic AI OpenTelemetry instrumentation: retry prompt content is not redacted when `include_content=False`](https://junglewise.ai/threats/cve-2026-107293-pydantic-ai-opentelemetry-instrumentation-retry-prompt-content)
- [Pydantic AI unbounded memory use in remote content download](https://junglewise.ai/threats/cve-2026-107294-pydantic-ai-unbounded-memory-use-when-downloading-remote-content)
