Skip to main content

Pydantic AI Harness CVE-2026-114386

| EUVDEUVD-2026-107233 MEDIUM
Allocation of Resources Without Limits or Throttling (CWE-770)
2026-10-21 VulnCheck GHSA-3589-pxp7-3gj8
6.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Supply prompt-injected input to agent
  2. Exploit
    Sandboxed snippet invokes run_nested_call()
  3. Execution
    Nested calls skip check_before_tool_call
  4. Impact
    Exceed tool_calls_limit on costly tools

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the target application to deploy the pydantic-ai-harness CodeMode toolset with run_code enabled AND to rely on an operator-configured UsageLimits.tool_calls_limit for cost or safety control - without that limit there is nothing to bypass. The attacker must be able to influence the sandboxed program's behavior, either as a user of the agent or through prompt-injected content that reaches the agent, causing it to call run_nested_call(). Limiting factors: the flaw only matters where tool_calls_limit is set as a guardrail; impact is bounded to exceeding call counts on costly or side-effecting tools (no data exposure); and it affects only versions before 0.59.0. The AT:P metric reflects this feature-and-configuration dependency.

Impact

This is a moderate-risk resource/limit-enforcement flaw (CWE-770), not a code-execution or data-disclosure bug. The vendor CVSS 4.0 score is 6.3 with vector AV:N/AC:L/AT:P/PR:N/UI:N and impact limited to VI:L/VA:L (no confidentiality, no subsequent-system impact), which aligns well with the description: the only consequence is that an operator-configured UsageLimits.tool_calls_limit is bypassed for nested tool calls, allowing more invocations of costly or side-effecting tools than intended. The AT:P (attack requirements present) metric is significant - it signals that exploitation is conditional on the application actually using the CodeMode toolset's run_code feature with a tool_calls_limit configured, which tempers the PR:N/UI:N 'unauthenticated remote' framing. No EPSS score, no CISA KEV listing, and no public exploit were provided, so this is best characterized as no public exploit identified at time of analysis; the Denial Of Service tag reflects the resource/cost-exhaustion nature rather than any evidence of active exploitation. Net: a genuine guardrail-bypass worth patching for teams relying on tool_calls_limit as a cost or safety control, but not an urgent widespread-exploitation emergency. One data note: the input tags omit the prompt-injection/LLM-agent context that the description makes central - verify threat model against your own agent deployment.

Exploit ScenarioDerived

An application exposes a pydantic-ai agent with the CodeMode toolset and sets UsageLimits.tool_calls_limit to cap invocations of an expensive or side-effecting tool. An attacker supplies input to the agent (directly, or via prompt-injected content the agent ingests) that causes the sandboxed snippet to call run_nested_call() repeatedly; because these nested calls skip check_before_tool_call, the operator's limit is never enforced and the tool runs well past the intended cap. No public exploit code was identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 21, 2026

Pydantic AI Harness versions before 0.59.0 fail to enforce the operator-configured UsageLimits.tool_calls_limit for nested tool invocations dispatched from inside a sandboxed run_code snippet in the CodeMode toolset, letting a program call run_nested_call() repeatedly and reach costly or side-effecting tools far beyond the intended ceiling. Unauthenticated remote attackers who can shape the agent's execution - as a user of the agent or through prompt-injected content - can therefore bypass a guardrail that operators rely on for cost and safety control, with impact bounded to resource exhaustion/limit violation rather than data exposure or code execution. This is a moderate CWE-770 resource-throttling flaw; no public exploit code or active exploitation was identified at time of analysis, and the vendor has released 0.59.0 to correct it.

RemediationAI

Upgrade pydantic-ai-harness to 0.59.0 (PyPI) or later, which corresponds to repository tag v2.59.0; the fix lands via PR https://github.com/pydantic/pydantic-ai/pull/10362 and commit https://github.com/pydantic/pydantic-ai/commit/eb27b2b89fe76ae23ee9b6fc9eb4b227a4967949, and the vendor advisory is at https://www.vulncheck.com/advisories/pydantic-ai-harness-before-0.59.0-codemode-tool-call-limit-bypass-via-run-code. After upgrading, verify that nested calls now count toward tool_calls_limit together with the run_code call and terminate the run with UsageLimitExceeded even if the snippet swallows the exception; also be aware that speculatively launched calls count from the moment they start, so budgets may be consumed earlier than before. If upgrading is not immediately possible, treat tool_calls_limit as unreliable for CodeMode and add compensating controls: disable the CodeMode/run_code toolset entirely (removes the sandboxed-program capability and any agent workflows that depend on it), remove high-cost or side-effecting tools from the toolset exposed to CodeMode so nested dispatch cannot reach them (degrades agent capability for those tools), and enforce spend/time ceilings outside the agent - per-request token and tool-invocation quotas at the API gateway or application layer plus outbound rate limits on the tools' downstream APIs (adds latency and needs its own tuning, but caps damage from a runaway loop). Monitor agent runs for abnormal tool-call counts per run_code invocation as a detection backstop, and treat untrusted or prompt-injected content reaching the agent as a potential trigger.

Affected VersionsENISA

pydantic-ai-harness 0 <0.59.0

Affected Packages

pypi pydantic-ai-harness fix: 0.59.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

pydantic-ai-harness ships a CodeMode toolset that lets an agent emit a Python-like program which runs inside a restricted executor (the harness's _monty_exec sandbox, with eager and speculative scheduling components in code_mode/_eager.py and code_mode/_speculation.py) and reaches back out to real tools through run_nested_call(). The intended contract is that every tool call - including nested ones - is validated through check_before_tool_call and counted against UsageLimits.tool_calls_limit, alongside the run_code call that made it. Versions before 0.59.0 checked only top-level dispatch, so nested calls bypassed both the pre-call check and the counter, and catching the resulting error inside the snippet was unnecessary because no error was raised at all. This is CWE-770 (Allocation of Resources Without Limits or Throttling): the throttle is advisory rather than enforced on one code path. The upstream fix (PR #10362, commit eb27b2b8) adds a per-execution usage_limit_exceeded state that is raised from the eager call path, makes the limit count calls still pending so an over-limit nested call terminates the run with UsageLimitExceeded even if the snippet catches it, and documents that a call launched eagerly by speculate counts from the moment it starts. Note this is a guardrail-bypass class issue: it changes nothing about the sandbox's memory/duration resource_limits, which are separate controls.

Know when Pydantic 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 (VulnCheck) PRIMARY 6.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
vuln.today AI 6.5 MEDIUM

Reachable over the network via agent input with no auth (PR:N), but only low integrity/availability impact from exceeding tool-call caps; no confidentiality impact and no scope change.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Pydantic AI Harness before 0.59.0 fails to enforce UsageLimits.tool_calls_limit on nested tool calls dispatched from run_code in the CodeMode toolset. Users or prompt-injected content can make the sandboxed program invoke tools via run_nested_call() without check_before_tool_call, exceeding operator limits on costly or side-effecting tools.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
Low
niche, recently-introduced AI agent harness; CodeMode is a specialized feature
Data Quality
6 sources
Confidence: High

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
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-2025-55526 CRITICAL POC
9.1 Aug 26

n8n-workflows Main Commit ee25413 allows attackers to execute a directory traversal via the download_workflow function w

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-2024-3772 HIGH POC
7.5 Apr 15

Regular expression denial of service in Pydanic < 2.4.0, < 1.10.13 allows remote attackers to cause denial of service vi

CVE-2026-84381 HIGH
8.1 Sep 02

HTTPX2's SOCKS5 proxy implementation omits TLS negotiation for WebSocket Secure (wss://) origins, exposing the full WebS

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-107286 HIGH
7.5 Oct 08

Concurrency slot exhaustion in Pydantic AI 2.10.0 through 2.52.x lets streamed model requests permanently occupy slots i

CVE-2026-84382 HIGH
7.5 Sep 02

Memory exhaustion via unbounded decompression in HTTPX2 (all versions before 2.12.0) allows any HTTP server the client c

CVE-2021-29510 HIGH
7.5 May 13

Pydantic is a data validation and settings management using Python type hinting. Rated high severity (CVSS 7.5), this vu

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

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