Skip to content
CriticalVulnerability

CVE-2026-40111: PraisonAIAgents command injection in memory hooks executor via shell=True

Identifier
CVE-2026-40111
Published
Record updated
View JSON
Affected
  • praisonaiagents <= 1.5.126
Fixed in
1.5.128
  • released April 9, 2026, on the day of disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

PraisonAIAgents, prior to 1.5.128, passes a user-controlled command string directly to subprocess.run() with shell=True in the memory hooks executor at src/praisonai-agents/praisonaiagents/memory/hooks.py, with no sanitization, so /bin/sh interprets shell metacharacters. Two attack surfaces exist: the pre_run_command and post_run_command hook event types, and the .praisonai/hooks.json lifecycle configuration, where BEFORE_TOOL and AFTER_TOOL hooks fire automatically. An agent that gains file-write access through prompt injection can overwrite hooks.json and run its payload silently at later lifecycle events.

Mitigation

Fixed in 1.5.128.