CVE-2026-56074 — praisonaiagents
MEDIUMCVE-2026-56074 is a medium-severity (CVSS 5.5) CWE-863 vulnerability in praisonaiagents. A fix is available for praisonaiagents — see the affected versions and patch details below.
PraisonAI: Coarse-Grained Tool Approval Cache Bypasses Per-Invocation Consent for Shell Commands
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-56074.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2026-56074 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,156 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
praisonaiagentsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The approval system in PraisonAI Agents caches tool approval decisions by tool name only, not by invocation arguments. Once a user approves execute_command for any command (e.g., ls -la), all subsequent execute_command calls in that execution context bypass the approval prompt entirely. Combined with os.environ.copy() passing all process environment variables to subprocesses, this allows an LLM agent (potentially via prompt injection) to silently exfiltrate API keys and credentials without further user consent.
Details
The require_approval decorator in src/praisonai-agents/praisonaiagents/approval/__init__.py:176-178 checks approval status by tool name only:
@wraps(func)
def wrapper(*args, **kwargs):
if is_already_approved(tool_name): # line 177 — checks only tool_name
return func(*args, **kwargs) # line 178 — bypasses ALL approval
The mark_approved function in registry.py:144-147 stores only the tool name string:
def mark_approved(self, tool_name: str) -> None:
approved = self._approved_context.get(set())
approved.add(tool_name) # stores "execute_command", not args
self._approved_context.set(approved)
The approval context is never cleared during agent execution — clear_approved() exists (registry.py:152) but is never called in the agent's tool execution path (agent/tool_execution.py).
Meanwhile, the ConsoleBackend UI at backends.py:95-96 misleads the user:
return Confirm.ask(
f"Do you want to execute this {request.risk_level} risk tool?",
# "this" implies per-invocation approval
)
The UI displays the specific command arguments (lines 81-85), creating a reasonable expectation that the user is approving only that specific invocation.
Additionally, shell_tools.py:77 passes the full process environment to every subprocess:
process_env = os.environ.copy() # includes OPENAI_API_KEY, etc.
There is no command filtering, blocklist, or environment variable sanitization in the shell tools module.
PoC
from praisonaiagents import Agent
from praisonaiagents.tools.shell_tools import execute_command
# Step 1: Create agent with shell tool
agent = Agent(
name="worker",
instructions="You are a helpful assistant.",
tools=[execute_command]
)
# Step 2: Agent requests benign command — user sees Rich panel:
# Function: execute_command
# Risk Level: CRITICAL
# Arguments:
# command: ls -la
# "Do you want to execute this critical risk tool?" [y/N]
# User approves → mark_approved("execute_command") is called
# Step 3: All subsequent execute_command calls bypass approval silently:
# execute_command(command="env")
# → returns ALL environment variables (OPENAI_API_KEY, AWS_SECRET_ACCESS_KEY, etc.)
# → NO approval prompt shown
# Step 4: Targeted extraction also bypasses approval:
# execute_command(command="printenv OPENAI_API_KEY")
# → returns the specific API key
# → NO approval prompt shown
# Verification: check the approval cache
from praisonaiagents.approval import is_already_approved
# After approving "ls -la":
# is_already_approved("execute_command") → True
# Any execute_command call now returns immediately at __init__.py:177-178
Impact
- Secret exfiltration: An LLM agent (or one subjected to prompt injection) can dump all process environment variables after a single benign command approval. Common secrets include
OPENAI_API_KEY,AWS_SECRET_ACCESS_KEY,DATABASE_URL, and any other credentials passed via environment. - Misleading consent UI: The console prompt displays specific arguments and uses language ("this tool") that implies per-invocation consent, but the system grants session-wide blanket approval.
- No expiration or scope: The approval cache uses a
ContextVarthat persists for the entire agent execution context with no timeout, no command-count limit, and no clearing between tool calls. - No environment filtering:
os.environ.copy()passes every environment variable to subprocesses without filtering sensitive patterns.
Recommended Fix
- Per-invocation approval for critical tools — store a hash of
(tool_name, arguments)instead of justtool_name, or require re-approval for each invocation of critical-risk tools:
# In registry.py — change mark_approved/is_already_approved:
import hashlib, json
def mark_approved(self, tool_name: str, arguments: dict = None) -> None:
approved = self._approved_context.get(set())
risk = self._risk_levels.get(tool_name)
if risk == "critical" and arguments:
key = f"{tool_name}:{hashlib.sha256(json.dumps(arguments, sort_keys=True).encode()).hexdigest()}"
else:
key = tool_name
approved.add(key)
self._approved_context.set(approved)
def is_already_approved(self, tool_name: str, arguments: dict = None) -> bool:
approved = self._approved_context.get(set())
risk = self._risk_levels.get(tool_name)
if risk == "critical" and arguments:
key = f"{tool_name}:{hashlib.sha256(json.dumps(arguments, sort_keys=True).encode()).hexdigest()}"
return key in approved
return tool_name in approved
- Filter environment variables in
shell_tools.py:
SENSITIVE_PATTERNS = ('_KEY', '_SECRET', '_TOKEN', '_PASSWORD', '_CREDENTIAL')
process_env = {
k: v for k, v in os.environ.items()
if not any(p in k.upper() for p in SENSITIVE_PATTERNS)
}
if env:
process_env.update(env)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | praisonaiagents | all versions | 4.5.128pip install --upgrade 'praisonaiagents==4.5.128' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for praisonaiagents, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update praisonaiagents to 4.5.128 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-56074 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-56074 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-56074. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-56074 in your dependencies?
O3 Security finds CVE-2026-56074 across PyPI dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.