CVE-2026-107286 is a high-severity (CVSS 7.5) CWE-772 vulnerability in pydantic-ai. A fix is available for pydantic-ai — see the affected versions and patch details below.
Pydantic AI: Concurrency-limited models can keep their slot when a streamed request ends early
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- 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-107286.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-107286 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
pydantic-ai🐍pydantic-ai-slimReal-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
This issue was posted by Codex Desktop using gpt-6.1-sol on behalf of David.
Summary
Applications that wrap a model with ConcurrencyLimitedModel or limit_model_concurrency can permanently lose shared concurrency capacity when a streamed request releases its slot from a different task than the one that acquired it. This can happen when a stream ends early, and also when a stream is fully consumed using the default stream_text() debouncing.
In an application that exposes an affected streaming endpoint to network clients and shares a long-lived model limiter across requests, a client can repeatedly start a stream and disconnect. The completed requests retain their slots, eventually preventing subsequent requests that share the limiter from proceeding.
Agent-level max_concurrency and non-streaming model requests are not affected by this defect.
Details
The built-in limiter uses anyio.CapacityLimiter, which associates each acquired slot with its borrowing task. Pydantic AI's streaming lifecycle can acquire the slot on the task consuming the stream and run cleanup on another internal task. The limiter rejects that release, so the slot remains occupied even after the request has ended. Cleanup can raise a RuntimeError; a later request on the borrowing task can also fail because that task still holds a slot.
Early termination includes stopping iteration, a consumer exception, and cancellation. Fully consuming stream_text() with its default debounce_by=0.1 can also reach the cross-task release path. Fully consumed streams must therefore not be assumed safe.
Mitigation
Upgrade to a patched release of pydantic-ai or pydantic-ai-slim. If you cannot upgrade yet, use the agent-level max_concurrency setting instead of a concurrency-limited model, or avoid streaming runs through a concurrency-limited model.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | pydantic-ai | ≥ 2.10.0&&< 2.53.0 | 2.53.0pip install --upgrade 'pydantic-ai==2.53.0' |
| 🐍PyPI | pydantic-ai-slim | ≥ 2.10.0&&< 2.53.0 | 2.53.0pip install --upgrade 'pydantic-ai-slim==2.53.0' |
Affected Products
pydantic aipydanticDetection & mitigation playbook
Open-source dependencyDetect
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.
Fix
Update pydantic-ai to 2.53.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-107286 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
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.
An IMPORTANT severity denial-of-service flaw was found in pydantic-ai, a Python agent framework for building generative AI applications, which is shipped in Red Hat Enterprise Linux AI and Lightspeed Core. When streamed requests are processed through model-level concurrency limiting (ConcurrencyLimitedModel or…
Applications using pydantic-ai can avoid this issue by not applying model-level concurrency limiting to streamed requests: configure concurrency limits through the agent-level max_concurrency setting or use non-streaming model requests, as those code paths are not affected. Where possible, upgrading to pydantic-ai 2.53.0 or later, which contains the upstream fix, is recommended. For Red Hat Enterprise Linux AI and Lightspeed Core, apply the updated containers and packages when they become available through the respective product releases.Source: Red Hat security advisory for CVE-2026-107286 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-107286 in your dependencies?
Find it across PyPI, including transitive dependencies.