Tool call limit bypass in Pydantic AI CodeMode run_code
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-770.
Summary
Pydantic AI before 0.59.0 fails to enforce tool call limits on nested tool calls made from run_code in the CodeMode toolset, a missing resource limit (CWE-770). A user, or prompt-injected content, can make the sandboxed program invoke tools without the usage check, exceeding operator limits on costly or side-effecting tools.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pydantic | pydantic-ai-harness | before 0.59.0 | 0.59.0 | Patch available | CNA |
| — | pydantic-ai-harness (PyPI) | before 0.59.0 | 0.59.0 | Patch available | GHSA-3589-pxp7-3gj8 |
- pydantic-ai-harness Vendorpydantic Affected before 0.59.0 Fixed in 0.59.0 Patch available CNA
- pydantic-ai-harness (PyPI) Vendor— Affected before 0.59.0 Fixed in 0.59.0 Patch available GHSA-3589-pxp7-3gj8
Remediation
Upgrade to version 0.59.0, which fixes this flaw.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
- Fix · CNA pydantic-ai-harness (pydantic) Fixed in 0.59.0
- Fix · GHSA-3589-pxp7-3gj8 pydantic-ai-harness (PyPI) Fixed in 0.59.0 Advisory →
Timeline
- 2026-10-21 Threatist record created from CVE-2026-114386
- 2026-10-21 Alias added: GHSA-3589-pxp7-3gj8
- 2026-10-21 CISA SSVC decision points changed
- 2026-10-21 Priority changed: MEDIUM → LOW
- 2026-10-23 Fix available: PyPI/[email protected] · GHSA-3589-pxp7-3gj8
- 2026-10-23 CVSS score added · GHSA-3589-pxp7-3gj8
- 2026-10-23 Weakness changed · GHSA-3589-pxp7-3gj8
- 2026-10-23 7 new references · GHSA-3589-pxp7-3gj8
References
Patch 2
Other 5
- pydantic-ai-harness v2.59.0 Release Notes
- https://github.com/pydantic/pydantic-ai/blob/v2.58.0/src/pydantic_ai_harness/pydantic_ai_harness/code_mode/_toolset.py#L642-L680
- https://pypi.org/project/pydantic-ai-harness/0.59.0/
- https://github.com/pydantic/pydantic-ai
- https://pypi.org/project/pydantic-ai-harness/0.59.0
More pydantic vulnerabilities
- TI-2024-03518 Regular expression denial of service in Pydantic < 2.4.0 CVSS 3.1HIGH 7.5
- TI-2026-57990 HTTPX2: Multipart part header injection via unvalidated file Content-Type and custom headers CVSS 3.1MEDIUM 5.3
- TI-2026-41916 Path traversal in pydantic-settings CVSS 3.1MEDIUM 5.3
- TI-2026-20687 Pydantic AI Affected by Server-Side Request Forgery (SSRF) in URL Download Handling CVSS 3.1HIGH 8.6
- TI-2026-57993 HTTPX2: Streaming response decompression does not bound peak memory (decompression amplification) CVSS 3.1HIGH 7.5
- TI-2026-69551 Pydantic AI keeps concurrency slots after streams end early CVSS 3.1HIGH 7.5
Sources
- CVE-2026-114386 · CVE Program
- CVE-2026-114386 · NVD
- FIRST EPSS
- GHSA-3589-pxp7-3gj8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences