CVE-2026-107287: Pydantic AI Remote Code Execution Vulnerability
MODERATECVE-2026-107287 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Pydantic AI libraries in the PyPI ecosystem. The issue involves excessive resource use when local web fetching converts nested html. Remediation is available by upgrading affected packages to version 1.107.7, 2.52.0.
CVE-2026-107287 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-107287
To remediate this vulnerability, upgrade all affected Pydantic AI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pydantic-ai>=1.107.7
pip install pydantic-ai>=2.52.0
pip install pydantic-ai-slim>=1.107.7
pip install pydantic-ai-slim>=2.52.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pydantic-ai
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-107287, inspect your installed packages using pip:
pip show pydantic-ai
Analyze the terminal output to locate any version of Pydantic AI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.107.7), your application is affected.
Note: The pip show pydantic-ai command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Pydantic AI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-107287 Affected Pydantic AI Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pydantic-ai
|
PyPI |
≥ 1.77.0
< 1.107.7
|
1.107.7
|
|
pydantic-ai
|
PyPI |
≥ 2.0.0b1
< 2.52.0
|
2.52.0
|
|
pydantic-ai-slim
|
PyPI |
≥ 1.77.0
< 1.107.7
|
1.107.7
|
|
pydantic-ai-slim
|
PyPI |
≥ 2.0.0b1
< 2.52.0
|
2.52.0
|
References
Frequently Asked Questions
What is CVE-2026-107287?
Which Pydantic AI versions are affected?
What version fixes CVE-2026-107287?
Is pydantic-ai affected?
Is pydantic-ai-slim affected?
What is the CVSS score of CVE-2026-107287?
What CWE is associated with CVE-2026-107287?
How can I check PyPI dependencies for CVE-2026-107287?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v36g-jcw9-x7cw",
"modified" : "2026-10-08T17:40:50Z",
"published" : "2026-10-08T17:40:50Z",
"aliases" : [ "CVE-2026-107287" ],
"summary" : "Pydantic AI: Excessive resource use when local web fetching converts nested HTML",
"details" : "### Summary\n\nApplications 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.\n\n### Details\n\nNested 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.\n\n### Mitigation\n\nUpgrade 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pydantic-ai"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.77.0"
}, {
"fixed" : "1.107.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "pydantic-ai"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0b1"
}, {
"fixed" : "2.52.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "pydantic-ai-slim"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.77.0"
}, {
"fixed" : "1.107.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "pydantic-ai-slim"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0b1"
}, {
"fixed" : "2.52.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-v36g-jcw9-x7cw"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/pull/8984"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/pull/8985"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/commit/2b247add4950bef61d352e7ca8aefbd20539180c"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/commit/2fd38792693da00a3ca5412aeffb436787af3545"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pydantic/pydantic-ai"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.7"
}, {
"type" : "WEB",
"url" : "https://github.com/pydantic/pydantic-ai/releases/tag/v2.52.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-407" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-08T17:40:50Z",
"nvd_published_at" : null
}
}