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

- Severity: Critical 9.3 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-09T21:14:55.352Z
- Modified: 2026-11-16T16:15:05.490Z
- Also known as: GHSA-v7px-3835-7gjx, PYSEC-2026-487
- Weaknesses: CWE-78
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- MervinPraison PraisonAIAgents: < 1.5.128
- praisonaiagents (PyPI): before 1.5.128
- praison praisonaiagents: before 1.5.128

## Every score

- GitHub_M: CVSS: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: CVSS:4.0 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`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:4.0 `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`

## References

- <https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-v7px-3835-7gjx> (exploit, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40111> (advisory)
- <https://github.com/MervinPraison/PraisonAI> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/praisonaiagents/PYSEC-2026-487.yaml> (web)
- <https://pypi.org/project/praisonaiagents> (package, web)
- <https://github.com/advisories/GHSA-v7px-3835-7gjx> (advisory)

## Sources

- CVE List: [CVE-2026-40111](https://www.cve.org/CVERecord?id=CVE-2026-40111), CVE Terms of Use, modified 2026-04-13
- GitHub Advisory Database: [GHSA-v7px-3835-7gjx](https://github.com/advisories/GHSA-v7px-3835-7gjx), CC-BY-4.0, modified 2026-11-16
- NVD: [CVE-2026-40111](https://nvd.nist.gov/vuln/detail/CVE-2026-40111), Public domain, modified 2026-10-26
- PyPA Advisory Database: [PYSEC-2026-487](https://osv.dev/vulnerability/PYSEC-2026-487), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-40111 · Whole record: https://cve.day/CVE-2026-40111.json · Rebuilt by cve.day 2026-11-25T22:59:18.452Z
