{"id":"CVE-2026-60087","aliases":["GHSA-29r9-67vg-qj56"],"title":"PraisonAI: Human-in-the-loop tool approval is cached by tool name and silently reused for all subsequent calls with arbitrary arguments","summary":"PraisonAI: Human-in-the-loop tool approval is cached by tool name and silently reused for all subsequent calls with arbitrary arguments","severity":"medium","cvss":6.1,"cwe":["CWE-863"],"vendor":"praisonaiagents","product":"praisonaiagents","ecosystem":"pip","affected":["praisonaiagents <= 1.6.77"],"patched":["praisonaiagents 1.6.78"],"published":"2026-10-08","updated":"2026-10-08","sourceUpdated":"2026-10-08T16:43:46Z","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-29r9-67vg-qj56","references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-29r9-67vg-qj56"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-60087"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62164"},{"url":"https://www.vulncheck.com/advisories/praisonai-before-tool-approval-cache-bypass"},{"url":"https://github.com/advisories/GHSA-29r9-67vg-qj56"}],"tags":["ghsa","pip"],"epss":0.00148,"epssPercentile":0.03502,"ingestedAt":"2026-10-08T16:52:14.780Z","slug":"CVE-2026-60087","body":"## Overview\n\n## Summary\n\nPraisonAI gates dangerous tools (file writes, deletes, shell/code execution) behind an interactive approval prompt. The first approval of a tool is cached for the remainder of the run and silently reused for all later invocations of that tool with arbitrary, unreviewed arguments.\n\n## Root cause\n\n`ApprovalRegistry.is_already_approved` (`src/praisonai-agents/praisonaiagents/approval/registry.py`, around line 181) returns `True` whenever the tool name is present in a per-run context set. The cache is keyed on tool name only — arguments are not part of the key.\n\n`approve_sync` / `approve_async` (around lines 224-226 / 278-279) short-circuit on that cache before the approval backend is consulted.\n\n`clear_approved` (around lines 186-187) is the only routine that clears the cache, but it is never invoked in the shipped library (only in tests). The cache persists for the entire agent run and is inherited by child tasks via `contextvars`.\n\nCritical-tier tools (`execute_command`, `execute_code`) are exempt from the cache. But high-risk tools like `write_file` are not.\n\n## Proof of concept\n\n```python\nfrom praisonaiagents.approval.registry import ApprovalRegistry\nfrom praisonaiagents.approval.protocols import ApprovalDecision, ApprovalRequest\n\nclass CountingBackend:\n    def __init__(self): self.prompts = []\n    def request_approval_sync(self, request):\n        self.prompts.append((request.tool_name, dict(request.arguments)))\n        return ApprovalDecision(approved=True, reason=\"human approved\")\n\nbackend = CountingBackend()\nreg = ApprovalRegistry()\nreg.set_backend(backend)\nreg.add_requirement(\"write_file\", \"high\")\n\nd1 = reg.approve_sync(\"agent\", \"write_file\", {\"path\": \"/tmp/safe.txt\", \"content\": \"hi\"})\n# Human prompted — approves a benign write\n\nd2 = reg.approve_sync(\"agent\", \"write_file\", {\"path\": \"/etc/crontab\", \"content\": \"* * * * * root evil\"})\n# NO prompt — auto-approved from cache\n\nassert len(backend.prompts) == 1\nassert d2.reason == \"Already approved in context\"\n```\n\nNegative control: `execute_command` (critical) re-prompts on every call — 2 prompts for 2 calls.\n\n## Impact\n\nA `write_file` approval for a benign path authorizes every later `write_file` call in the session with arbitrary arguments. A model steered by malicious input can write to sensitive locations with no further human prompt.\n\n## Suggested fix\n\n- Include arguments in the approval cache key, or re-prompt on argument change.\n- Expire the cache per-call or per-turn.\n- Do not inherit the cache into child tasks.\n\n## Affected packages\n\n- `praisonaiagents <= 1.6.77`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `praisonaiagents 1.6.78`","depth":"sunlit","depthScore":34,"depthScoreParts":{"impact":33.6,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}