Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pydantic | pydantic-ai-harness | < 0.59.0 | 0.59.0 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | pydantic-ai-harness | < 0.59.0 | 0.59.0 | GHSA-3589-pxp7-3gj8 |
References
- https://github.com/pydantic/pydantic-ai/pull/10362 issue-tracking patch
- https://github.com/pydantic/pydantic-ai/commit/eb27b2b89fe76ae23ee9b6fc9eb4b227a4967949 patch
- pydantic-ai-harness v2.59.0 Release Notes 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 technical-description
- https://pypi.org/project/pydantic-ai-harness/0.59.0/ product
- VulnCheck Advisory: Pydantic AI Harness before 0.59.0 CodeMode Tool Call Limit Bypass via run_code third-party-advisory