---
title: "CVE-2026-40111: PraisonAIAgents has an OS Command Injection via shell=True in Memory Hooks Executor (memory/hooks.py)"
url: https://erroneo.us/security/cve/CVE-2026-40111/
description: "CVE-2026-40111 (praisonaiagents (PyPI)): PraisonAIAgents is a multi-agent teams system. Prior to 1.5.128, he memory hooks executor in praisonaiagents passes…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-04-09
date_modified: 2026-04-13
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-40111"
kev: false
cvss: 9.3
epss: 0.0034
license: All rights reserved. Quote with attribution and a link.
---

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

**Signal:** Critical, preconditions apply. Severe if exploited, but exploitation needs conditions that may not apply to you. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

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

## Affected packages

- PyPI `praisonaiagents` <= 1.5.126 → fixed: 1.5.128

## Affected products (CVE record)

- MervinPraison PraisonAIAgents: < 1.5.128

## Severity

- GitHub_M CVSS 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`
- GitHub CVSS 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`

## Exploitation

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

## Sources

- [GitHub Advisory GHSA-v7px-3835-7gjx](https://github.com/advisories/GHSA-v7px-3835-7gjx)
- [CVE.org record CVE-2026-40111](https://www.cve.org/CVERecord?id=CVE-2026-40111)
- [NVD entry CVE-2026-40111](https://nvd.nist.gov/vuln/detail/CVE-2026-40111)
- [github.com](https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-v7px-3835-7gjx)

---
Source page: https://erroneo.us/security/cve/CVE-2026-40111/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
