CVE-2026-40111: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in MervinPraison PraisonAIAgents
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.
AI Analysis
Technical Summary
PraisonAIAgents before version 1.5.128 contains an OS command injection vulnerability (CWE-78) due to improper neutralization of special elements in user-controlled command strings passed to subprocess.run() with shell=True. The vulnerability exists in the memory hooks executor component, specifically at src/praisonai-agents/praisonaiagents/memory/hooks.py. Two independent attack vectors exist: hooks registered via configuration events (pre_run_command and post_run_command) and lifecycle hooks defined in the .praisonai/hooks.json file. The latter allows an attacker with file-write access to persistently execute arbitrary shell commands during agent lifecycle events without user interaction. The vulnerability has a CVSS 4.0 score of 9.3, indicating critical severity. No official remediation level or patch link is provided in the data, but the issue is fixed in version 1.5.128.
Potential Impact
Successful exploitation allows an attacker with limited privileges to execute arbitrary OS commands with the privileges of the PraisonAIAgents process. The most severe impact is persistent, silent command execution triggered automatically during agent lifecycle events via the .praisonai/hooks.json configuration. This can lead to full system compromise depending on the agent's privileges. The vulnerability does not require user interaction for the persistent attack vector and has high vector complexity and impact metrics per CVSS 4.0.
Mitigation Recommendations
Upgrade PraisonAIAgents to version 1.5.128 or later, where this vulnerability is fixed. Since no official patch link or remediation level is provided beyond the version fix, users should verify the upgrade from the vendor's official sources. Until upgraded, restrict file-write access to the .praisonai/hooks.json file and avoid registering untrusted hooks. Monitor for unauthorized modifications to hook configurations. Patch status is not explicitly confirmed beyond the fixed version; check vendor advisories for current remediation guidance.
CVE-2026-40111: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in MervinPraison PraisonAIAgents
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
PraisonAIAgents before version 1.5.128 contains an OS command injection vulnerability (CWE-78) due to improper neutralization of special elements in user-controlled command strings passed to subprocess.run() with shell=True. The vulnerability exists in the memory hooks executor component, specifically at src/praisonai-agents/praisonaiagents/memory/hooks.py. Two independent attack vectors exist: hooks registered via configuration events (pre_run_command and post_run_command) and lifecycle hooks defined in the .praisonai/hooks.json file. The latter allows an attacker with file-write access to persistently execute arbitrary shell commands during agent lifecycle events without user interaction. The vulnerability has a CVSS 4.0 score of 9.3, indicating critical severity. No official remediation level or patch link is provided in the data, but the issue is fixed in version 1.5.128.
Potential Impact
Successful exploitation allows an attacker with limited privileges to execute arbitrary OS commands with the privileges of the PraisonAIAgents process. The most severe impact is persistent, silent command execution triggered automatically during agent lifecycle events via the .praisonai/hooks.json configuration. This can lead to full system compromise depending on the agent's privileges. The vulnerability does not require user interaction for the persistent attack vector and has high vector complexity and impact metrics per CVSS 4.0.
Mitigation Recommendations
Upgrade PraisonAIAgents to version 1.5.128 or later, where this vulnerability is fixed. Since no official patch link or remediation level is provided beyond the version fix, users should verify the upgrade from the vendor's official sources. Until upgraded, restrict file-write access to the .praisonai/hooks.json file and avoid registering untrusted hooks. Monitor for unauthorized modifications to hook configurations. Patch status is not explicitly confirmed beyond the fixed version; check vendor advisories for current remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-09T01:41:38.536Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69d843751cc7ad14da3fb55c
Added to database: 4/10/2026, 12:25:25 AM
Last enriched: 4/17/2026, 12:02:20 PM
Last updated: 5/25/2026, 12:21:47 PM
Views: 113
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.