Security Digest · Vulnerability record
CVE-2026-40111: PraisonAIAgents has an OS Command Injection via shell=True in Memory Hooks Executor (memory/hooks.py)
PraisonAIAgents is a multi-agent teams system.
CVSS 9.3 Critical EPSS 0.3% · p26
Should you act?
Critical, preconditions apply
Severe if exploited, but exploitation needs conditions that may not apply to you. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
- EPSS 0.3%, percentile 26: FIRST’s model estimates a 0.3% chance of exploitation activity in the next 30 days, higher than 26% of all scored CVEs (low). EPSS is a probability, not a verdict.
- Needs local access needed. Lower urgency for most teams unless an attacker could already run code on the machine.
- Only applies if your dependency tree includes
praisonaiagents(PyPI) <= 1.5.126, fixed in 1.5.128. Check your lockfile, including transitive dependencies.
What it is
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 preruncommand and postruncommand 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 BEFORETOOL and AFTERTOOL 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.
From the GitHub advisory
Summary
The 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 lines 303 to 305. No sanitization, no shlex.quote(), no character filter, and no allowlist check exists anywhere in this file. Shell metacharacters including semicolons, pipes, ampersands, backticks, dollar-sign substitutions, and newlines are interpreted by /bin/sh before the intended command executes.
Two independent attack surfaces exist. The first is via preruncommand and postruncommand 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 BEFORETOOL and AFTERTOOL 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 file and these surfaces are not covered by any existing published advisory.
Vulnerability Description
Weakness type: CWE-78.
Product: praisonaiagents (PyPI) · Assigned by: GitHub_M · Published: 2026-04-09
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| PyPI | praisonaiagents | <= 1.5.126 | 1.5.128 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| MervinPraison | PraisonAIAgents | < 1.5.128 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_M | 4.0 | 9.3 Critical | 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 |
| GitHub | 4.0 | 9.3 | 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 |
- Attack vector: local access needed
- Attack complexity: low
- Attack requirements: none
- Privileges required: low (any account)
- User interaction: none
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation poc, automatable no, technical impact total.
- FIRST EPSS (model of 2026-10-21): 0.34% probability of exploitation activity in the next 30 days; percentile 26.
Timeline
- — CVE record published by GitHub_M
- — GitHub-reviewed advisory GHSA-v7px-3835-7gjx published (critical)
- — CVE record last updated
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-v7px-3835-7gjx github.com
- CVE.org record CVE-2026-40111 cve.org
- NVD entry CVE-2026-40111 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com