GHSA-29r9-67vg-qj56: Medium severity pip/praisonaiagents vulnerability

Published Oct 8, 2026
·
Updated

Summary

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

Root cause

ApprovalRegistry.isalreadyapproved (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.

approvesync / approveasync (around lines 224-226 / 278-279) short-circuit on that cache before the approval backend is consulted.

clearapproved (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.

Critical-tier tools (executecommand, executecode) are exempt from the cache. But high-risk tools like writefile are not.

Proof of concept

python from praisonaiagents.approval.registry import ApprovalRegistry from praisonaiagents.approval.protocols import ApprovalDecision, ApprovalRequest

class CountingBackend: def init(self): self.prompts = [] def requestapprovalsync(self, request): self.prompts.append((request.toolname, dict(request.arguments))) return ApprovalDecision(approved=True, reason="human approved")

backend = CountingBackend() reg = ApprovalRegistry() reg.setbackend(backend) reg.addrequirement("writefile", "high")

d1 = reg.approvesync("agent", "writefile", {"path": "/tmp/safe.txt", "content": "hi"}) Human prompted — approves a benign write

d2 = reg.approvesync("agent", "writefile", {"path": "/etc/crontab", "content": " root evil"}) NO prompt — auto-approved from cache

assert len(backend.prompts) == 1 assert d2.reason == "Already approved in context"

Negative control: executecommand (critical) re-prompts on every call — 2 prompts for 2 calls.

Impact

A writefile approval for a benign path authorizes every later writefile call in the session with arbitrary arguments. A model steered by malicious input can write to sensitive locations with no further human prompt.

Suggested fix

- Include arguments in the approval cache key, or re-prompt on argument change. - Expire the cache per-call or per-turn. - Do not inherit the cache into child tasks.

Affected Software

1 affected componentFixes available
pip/praisonaiagents<=1.6.77
1.6.78

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/praisonaiagents to a version that resolves this vulnerability.

    Fixed in 1.6.78
  2. Configuration

    Do not inherit the approval cache into child tasks.

    PraisonAI ApprovalRegistry cache inheritance = disabled for child tasks
  3. Configuration

    Expire the approval cache per call or per turn instead of retaining approvals for the entire agent run.

    PraisonAI ApprovalRegistry cache expiration = per-call or per-turn
  4. Configuration

    Include arguments in the approval cache key, or re-prompt when arguments change, so approval of a benign write_file path does not authorize later calls with arbitrary arguments.

    PraisonAI ApprovalRegistry approval cache key = include tool arguments

Event History

Oct 8, 2026
Advisory Published
via GitHub·04:43 PM
Data Sourced
via GitHub·04:43 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What must happen before unreviewed tool invocations can proceed?

A user must approve the tool once during an agent run. After that first approval, later invocations of the same tool can use arbitrary arguments without another approval prompt.

2

Which tools are affected by approval reuse?

High-risk tools that are not exempt from the cache are affected; the advisory specifically identifies write_file. Critical-tier execute_command and execute_code are exempt from the cache.

3

How long does an approval remain reusable?

The approval cache persists for the entire agent run. It is also inherited by child tasks through contextvars.

4

Can the cached approval be cleared?

ApprovalRegistry.clear_approved is the routine that clears the cache. The shipped library does not invoke it; it is used only in tests.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203