{"id":"CVE-2026-107287","aliases":["CVE-2026-107287","GHSA-v36g-jcw9-x7cw","PYSEC-2026-4281","PYSEC-2026-4290"],"related":[],"kind":"vulnerability","state":"published","title":"Pydantic AI: Excessive resource use when local web fetching converts nested HTML","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"}],"published":"2026-10-08T15:15:05.417Z","modified":"2026-10-15T14:56:19.955Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-407"],"affected":[{"ranges":[{"version":">= 1.77.0, < 1.107.7","status":"affected"},{"version":">= 2.0.0b1, < 2.52.0","status":"affected"}],"vendor":"pydantic","product":"pydantic-ai","source":"cvelist"},{"ranges":[{"version":">= 1.77.0, < 1.107.7","status":"affected"},{"version":">= 2.0.0b1, < 2.52.0","status":"affected"}],"vendor":"pydantic","product":"pydantic-ai-slim","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.77.0","status":"affected","fixed":"1.107.7"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.52.0"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.77.0","status":"affected","fixed":"1.107.7"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.52.0"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.77.0","fixed":"1.107.7"},{"status":"affected","introduced":"2.0.0","fixed":"2.52.0"}],"vendor":"pydantic","product":"pydantic_ai","cpe":"cpe:2.3:a:pydantic:pydantic_ai:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"1.77.0","status":"affected","fixed":"1.107.7"},{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.52.0"}],"ecosystem":"PyPI","package":"pydantic-ai","purl":"pkg:pypi/pydantic-ai","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"1.77.0","status":"affected","fixed":"1.107.7"},{"type":"ecosystem","introduced":"2.0.0b1","status":"affected","fixed":"2.52.0"}],"ecosystem":"PyPI","package":"pydantic-ai-slim","purl":"pkg:pypi/pydantic-ai-slim","source":"pysec"}],"references":[{"url":"https://github.com/pydantic/pydantic-ai/security/advisories/GHSA-v36g-jcw9-x7cw","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/pull/8984","tags":["patch","vendor-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/pull/8985","tags":["patch","vendor-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/commit/2b247add4950bef61d352e7ca8aefbd20539180c","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/commit/2fd38792693da00a3ca5412aeffb436787af3545","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/releases/tag/v1.107.7","tags":["patch","release-notes","vendor-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai/releases/tag/v2.52.0","tags":["patch","release-notes","vendor-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/pydantic-ai","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pydantic-ai","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-v36g-jcw9-x7cw","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-107287","tags":["advisory"],"sources":["pysec"]},{"url":"https://pypi.org/project/pydantic-ai-slim","tags":["package"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-14T00:58:47.200Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-107287","url":"https://www.cve.org/CVERecord?id=CVE-2026-107287","licence":"CVE Terms of Use","modified":"2026-10-14T00:58:57.237Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v36g-jcw9-x7cw","url":"https://github.com/advisories/GHSA-v36g-jcw9-x7cw","licence":"CC-BY-4.0","modified":"2026-10-15T14:56:19.955Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-107287","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-107287","licence":"Public domain","modified":"2026-10-14T01:17:04.887Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4281","url":"https://osv.dev/vulnerability/PYSEC-2026-4281","licence":"CC-BY-4.0","modified":"2026-10-15T14:56:19.955Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4290","url":"https://osv.dev/vulnerability/PYSEC-2026-4290","licence":"CC-BY-4.0","modified":"2026-10-15T14:56:19.955Z"}],"updatedAt":"2026-11-25T22:59:43.182Z","epss":{"score":0.00277,"percentile":0.21547,"date":"2026-12-01T12:00:22.000Z"}}