SecurityContext

CVE-2026-40158: PraisonAI - Remote Code Execution

  • Cve: CVE-2026-40158
  • Name: PraisonAI - Remote Code Execution
  • Description: PraisonAI is a multi-agent teams system. Prior to 4.5.128, PraisonAI's AST-based Python sandbox can be bypassed using type.__getattribute__ trampoline, allowing arbitrary code execution when running untrusted agent code. The _execute_code_direct function in praisonaiagents/tools/python_tools.py uses AST filtering to block dangerous Python attributes like __subclasses__, __globals__, and __bases__. However, the filter only checks ast.Attribute nodes, allowing a bypass. The sandbox relies on AST-based filtering of attribute access but fails to account for dynamic attribute resolution via built-in methods such as type.getattribute, resulting in incomplete enforcement of security restrictions. The string '__subclasses__' is an ast.Constant, not an ast.Attribute, so it is never checked against the blocked list. This vulnerability is fixed in 4.5.128.
  • Impact: Attackers can execute arbitrary code remotely by bypassing sandbox restrictions, leading to full system compromise.
  • Remediation: Update to version 4.5.128 or later.
  • Vulnerability type: sandbox_bypass
  • Vulnerability impact: remote_code_execution
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: high
  • Cvss score: 7.8
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Epss score: 0.00244
  • Epss percentile: 0.15724
  • Assignee: [email protected]
  • Published at: 2026-04-10T17:17:13Z
  • Age in days: 228
  • Modified at: 2026-10-26T21:10:00Z
  • Patch available: yes
  • Public exploits total: 1
  • References total: 1
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-40158
  • Nvd status: analyzed
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-94Improper Control of Generation of Code

Public exploits

UrlSourceAdded date
https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-3c4r-6p77-xwr7nvd2026-04-10

References

UrlSourceTags
https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-3c4r-6p77-xwr7nvdExploit, Vendor Advisory

Products

ProductAffectedPlatform boundSourcesUrl
praison:praisonai< 4.5.128nonvd/v1/products/praison/praisonai

Projects

RepositoryLink kindsIndexedUrl
mervinpraison/praisonaipackage, releases, security_advisoryyes/v1/repositories/mervinpraison/praisonai

Index

  • Repositories: 1
  • Repositories high signal: 1
  • Checked, none or zero: packages

Exploitation

  • Public exploit: yes
  • Public exploit count: 1
  • Public exploit first date: 2026-04-10
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, remote, authentication required
  • Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts