Skip to main content

Pydantic AI CVE-2026-107286

| EUVDEUVD-2026-95039 HIGH
Missing Release of Resource after Effective Lifetime (CWE-772)
2026-10-08 security-advisories@github.com GHSA-6fqq-452j-qhrp
7.5
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach app sharing long-lived model limiter
  2. Delivery
    Start streamed model requests then cancel or abort early
  3. Exploit
    Cleanup on different task leaves slot unreleased
  4. Execution
    Leaked slots exhaust limiter capacity
  5. Impact
    Later 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pydantic-ai-slim 2.10.0, < 2.53.0
pydantic-ai 2.10.0, < 2.53.0

Affected Packages

pypi pydantic-ai fix: 2.53.0
pypi pydantic-ai-slim fix: 2.53.0

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

Vendor (github) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.9 MEDIUM

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).

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 7.5 HIGH

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Oct 08, 2026 - 16:18 EUVD
CVE Published
Oct 08, 2026 - 15:17 cve.org
HIGH 7.5

DescriptionCVE.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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 63% exploitable
Prevalence
Medium
popular Python GenAI agent framework; vulnerable concurrency feature is opt-in
Threat Intel
1
1 sources
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA MSRC Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2026-25580 HIGH POC
8.6 Feb 06

Pydantic AI versions 0.0.26 through 1.55.x contain a server-side request forgery vulnerability in URL download functiona

CVE-2026-107295 HIGH
7.6 Oct 08

Cross-site request forgery in Pydantic AI's development web chat UI allows any website a developer happens to visit whil

CVE-2026-48782 MEDIUM
6.8 Jun 16

Server-Side Request Forgery in Pydantic AI (versions 1.56.0-1.101.0, 2.0.0b1, 2.0.0b2) allows unauthenticated network at

CVE-2026-107289 MEDIUM
6.8 Oct 08

Server-side request forgery in Pydantic AI's URL-fetching guards lets an application that has explicitly opted a URL int

CVE-2026-54249 MEDIUM POC
6.8 Jul 29

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

CVE-2026-107294 MEDIUM
6.5 Oct 08

Pydantic AI, a Python framework for building Generative AI agents, buffers complete HTTP response bodies before applying

CVE-2026-107290 MEDIUM
6.5 Oct 08

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

CVE-2026-107287 MEDIUM
6.5 Oct 08

Denial of service in Pydantic AI's local web_fetch_tool and WebFetch local fallback allows an attacker-controlled HTML p

CVE-2026-65975 MEDIUM
6.5 Jul 29

Tool call injection in Pydantic AI's UI adapters (AG-UI via Agent.to_ag_ui()/AGUIAdapter, and Vercel AI via VercelAIAdap

CVE-2026-107292 MEDIUM
6.4 Oct 08

DNS rebinding against the Pydantic AI development web chat server (Agent.to_web() and `clai web`) lets a hostile website

CVE-2026-133505 MEDIUM
5.9 Nov 20

Deserialization type confusion in Pydantic AI (pydantic-ai and pydantic-ai-slim) lets third-party-controlled tool result

CVE-2026-25640 MEDIUM
5.4 Feb 06

Pydantic AI versions 1.34.0 through 1.50.x contain a path traversal vulnerability in the web UI that allows unauthentica

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy