Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach app sharing long-lived model limiter
-
DeliveryStart streamed model requests then cancel or abort early
-
ExploitCleanup on different task leaves slot unreleased
-
ExecutionLeaked slots exhaust limiter capacity
-
ImpactLater requests block indefinitely (DoS)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource cleanup on lifecycle end
|
| Exploitation Conditions | Requires the target application to wrap its model with ConcurrencyLimitedModel (or use limit_model_concurrency) and share a single long-lived ConcurrencyLimiter/anyio.CapacityLimiter instance across multiple requests, AND to use streaming model responses. The slot leak is then triggered by early stream termination, cancellation, consumer exceptions, or even full stream_text() consumption with debounce_by=0.1. LIMITING FACTORS: affects only pydantic-ai 2.10.0 through 2.52.x; Agent-level max_concurrency and all non-streaming model requests are explicitly NOT affected; a short-lived or per-request limiter never accumulates enough leaked slots to deadlock, so impact is confined to long-running services reusing one limiter. |
| Impact | The GitHub-assigned CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, 7.5 HIGH) scores this as a remotely triggerable, unauthenticated availability-only issue (C:N/I:N), which aligns with CWE-772 (missing release of a resource - here, anyio.CapacityLimiter concurrency slots). However, the raw score overstates practical priority for most deployments: the flaw only manifests when an application opts into ConcurrencyLimitedModel or limit_model_concurrency AND shares one long-lived limiter across streaming requests, so the AV:N/PR:N signals are gated by a non-default, developer-chosen configuration rather than attacker reach. No EPSS probability was provided, the CVE is NOT in CISA KEV, and no public exploit code is referenced - the only artifacts are the vendor fix commit, PR #9478, release v2.53.0, and advisory GHSA-6fqq-452j-qhrp. Notably the description states that even complete, normal stream_text() consumption with debounce_by=0.1 can leak a slot, so this behaves as much as a self-inflicted reliability/resource-exhaustion bug as an attacker-driven DoS. Net: a legitimately HIGH-impact availability bug for the specific population running the shared-limiter streaming configuration, but low urgency for the broad user base that uses Agent-level max_concurrency or non-streaming requests (explicitly unaffected). Treat as 'patch on normal cadence' unless you operate a long-lived service on the vulnerable configuration. |
| Exploit ScenarioDerived | A service exposes a long-running pydantic-ai application that wraps its model in ConcurrencyLimitedModel sharing a single process-lifetime limiter, and streams responses to clients. A client (or ordinary traffic) repeatedly starts streamed model requests and terminates, cancels, or errors out of them early; each leaks a concurrency slot that is never released because cleanup runs on a different task than the one that borrowed the CapacityLimiter slot. After enough leaks the limiter is fully occupied and all subsequent requests block indefinitely, producing a denial of service. No public exploit code is identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Concurrency slot exhaustion in Pydantic AI 2.10.0 through 2.52.x lets streamed model requests permanently occupy slots in a shared ConcurrencyLimiter, progressively starving later requests until a service that reuses one long-lived limiter can no longer make model calls - an availability-only denial of service (C:N/I:N/A:H) with no confidentiality or integrity impact. The issue is remotely reachable and unauthenticated (PR:N), but our independent assessment rates it AC:H rather than GitHub's AC:L because exploitation requires a specific deployment pattern: model requests wrapped in ConcurrencyLimitedModel (or covered by limit_model_concurrency) that share a single long-lived limiter across streamed responses; agent-level max_concurrency and all non-streaming model requests are explicitly unaffected, and a short-lived or per-request limiter never accumulates enough leaked slots to deadlock. Slots are leaked by early stream termination, cancellation, consumer exceptions, or even full stream_text() consumption with debounce_by=0.1, and the vendor-released fix in 2.53.0 is available; no public exploit code identified at time of analysis.
RemediationAI
Vendor-released patch: upgrade to Pydantic AI 2.53.0 or later (pip install --upgrade "pydantic-ai>=2.53.0", or the equivalent for pydantic-ai-slim), which is the version that resolves this advisory; see https://github.com/pydantic/pydantic-ai/releases/tag/v2.53.0 and GHSA-6fqq-452j-qhrp. If upgrading is not immediately possible, the most effective compensating control is to stop reusing one long-lived ConcurrencyLimiter: construct a fresh limiter per request or per bounded batch so leaked slots are discarded with the object, accepting the trade-off that a per-request limiter no longer provides cross-request back-pressure and can let upstream provider rate limits be exceeded. Alternatively, wrap model calls in your own anyio.Semaphore (which is not task-affine) instead of using ConcurrencyLimitedModel/limit_model_concurrency, at the cost of losing the library's built-in statistics and observability. Where streaming is optional, switching to non-streaming model requests avoids the vulnerable path entirely (availability-first trade-off), and applications that only use Agent(max_concurrency=...) need no change since that path is unaffected. Because leaked slots cannot be reclaimed in-process, also plan operational containment: schedule periodic worker/process recycling to clear accumulated capacity, and monitor the limiter counters (available_count/waiting_count) to detect slot depletion before requests begin hanging indefinitely. After upgrading, note the new behavioral requirement that an Agent(max_concurrency=...) and a ConcurrencyLimitedModel - and any nested ConcurrencyLimitedModel wrappers - must each use separate limiter instances, otherwise the library raises UserError or RuntimeError on re-entry, so review existing limiter wiring as part of the upgrade.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is CWE-772 (Missing Release of Resource) at the intersection of Pydantic AI's concurrency wrapper and anyio's task-scoped limiter semantics. Pydantic AI's ConcurrencyLimitedModel and limit_model_concurrency helper implemented back-pressure with anyio.CapacityLimiter, which associates each borrowed token with the specific task that acquired it and expects release() from that same task. For streamed responses, however, the async generator is iterated and closed on whichever task consumes the stream, so cleanup (release) frequently runs on a different task than the one that called acquire(). Each such mismatch - triggered by early stream termination, task cancellation, an exception in the consumer, or by the debounce_by=0.1 path during normal stream_text() consumption - leaves a slot permanently borrowed; because the limiter is long-lived and shared, occupancy monotonically increases until requests block indefinitely. The upstream fix (commit 453f19feeb7ab1d789f9393b1723c6a73b3d77b2, PR 9478) replaces anyio.CapacityLimiter with anyio.Semaphore(max_running, max_value=max_running), which has no task affinity and can be released from any task, and reworks the statistics accessors (available_count, total_count, running_count) to read from the semaphore's value. The same commit adds a contextvar-based guard (_ACTIVE_AGENT_LIMITERS, keyed by task id) that raises RuntimeError when an agent re-enters the same limiter on the same task, wraps token counting in set_current_run_context, and documents that an Agent(max_concurrency=...) and a ConcurrencyLimitedModel must use separate limiter instances (raising UserError otherwise) and that nested ConcurrencyLimitedModel wrappers likewise need distinct limiters.
Know when Pydantic Ai gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
AC:H because exploitation depends on a non-default shared long-lived limiter plus streaming configuration outside attacker control; PR:N/UI:N as triggering needs no auth; impact is availability-only (A:H).
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
Pydantic AI is a Python agent framework for building applications and workflows with Generative AI. From 2.10.0 until 2.53.0, streamed requests made through ConcurrencyLimitedModel or limit_model_concurrency can retain shared concurrency slots because anyio.CapacityLimiter associates an acquired slot with the borrowing task while streaming cleanup can run in a different task. Early stream termination, cancellation, consumer exceptions, or complete stream_text() consumption with debounce_by=0.1 can therefore leave capacity occupied, eventually preventing later requests that share the long-lived limiter from proceeding and causing a denial of service. Agent-level max_concurrency and non-streaming model requests are not affected. This issue is fixed in version 2.53.0.
Blast Radius
ecosystem impact- 1 pypi packages depend on pydantic-ai (1 direct, 0 indirect)
- 5 pypi packages depend on pydantic-ai-slim (4 direct, 1 indirect)
Ecosystem-wide dependent count for version 2.10.0 and other introduced versions.
Articles & Coverage 1
Technical POC Analysis
CWE-772 - Missing Release of Resource after Effective Lifetime, in pydantic-ai / pydantic-ai-slim versions = 2.10.0, < 2.53.0.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
Pydantic AI versions 2.10.0 through 2.52.x contain a concurrency slot exhaustion flaw that can cause denial of service for streamed model requests, potentially disrupting AI-powered services that rely on this library. The vulnerability is remotely reachable and unauthenticated, but exploitation requires a specific deployment pattern involving a shared long-lived concurrency limiter for streamed responses. With no vendor patch available, leadership should prioritize identifying affected deployments and implementing interim mitigations to prevent service outages.
No vendor-released patch identified at time of analysis; interim mitigations include avoiding shared long-lived ConcurrencyLimiter for streamed model requests, using short-lived or per-request limiters, disabling streaming where feasible, enforcing agent-level max_concurrency, implementing monitoring and automatic restarts for slot exhaustion, and applying network-level rate limiting or authentication to reduce exposure.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
More in Pydantic Ai
View allPydantic AI versions 0.0.26 through 1.55.x contain a server-side request forgery vulnerability in URL download functiona
Cross-site request forgery in Pydantic AI's development web chat UI allows any website a developer happens to visit whil
Server-Side Request Forgery in Pydantic AI (versions 1.56.0-1.101.0, 2.0.0b1, 2.0.0b2) allows unauthenticated network at
Server-side request forgery in Pydantic AI's URL-fetching guards lets an application that has explicitly opted a URL int
Server-Side Request Forgery in Pydantic AI's UI adapter layer (versions 1.65.0-1.105.0 and 2.0.0b1-2.0.0b5) allows unaut
Pydantic AI, a Python framework for building Generative AI agents, buffers complete HTTP response bodies before applying
Denial of service in Pydantic AI (pydantic-ai and pydantic-ai-slim) versions 1.77.0 through 1.107.5 and 2.0.0b1 through
Denial of service in Pydantic AI's local web_fetch_tool and WebFetch local fallback allows an attacker-controlled HTML p
Tool call injection in Pydantic AI's UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdap
DNS rebinding against the Pydantic AI development web chat server (Agent.to_web() and `clai web`) lets a hostile website
Deserialization type confusion in Pydantic AI (pydantic-ai and pydantic-ai-slim) lets third-party-controlled tool result
Pydantic AI versions 1.34.0 through 1.50.x contain a path traversal vulnerability in the web UI that allows unauthentica
EUVD-2026-95039
GHSA-6fqq-452j-qhrp
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB