Cyber Resilience

CVE-2026-40158

Praisonai ≤ 4.5.128

Public PoC
Published
10 April 2026
Modified
20 April 2026
Patch / advisory
CVSS Score v3.1 8.6
Click a component to see what it means
Raw vectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS Score 0.0024 15th percentile
Risk Priority 59 floored blend · peak EPSS

Summary

CVE-2026-40158 is a high-severity Code Injection (CWE-94) vulnerability in Praison Praisonai. Its CVSS base score is 8.6 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Abuse Elevation Control Mechanism (T1548); ranked at the 15th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and AC-4 (Information Flow Enforcement) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-40158 is a sandbox bypass vulnerability in PraisonAI, a multi-agent teams system, affecting versions prior to 4.5.128. The issue resides in the AST-based Python sandbox within the _execute_code_direct function of praisonaiagents/tools/python_tools.py, which filters dangerous attributes like __subclasses__, __globals__, and __bases__. However, the filter only inspects ast.Attribute nodes and overlooks dynamic attribute resolution via built-in methods such as type.__getattribute__, treating strings like '__subclasses__' as ast.Constant nodes that evade blocking. This allows attackers to trampoline into restricted attributes, enabling arbitrary code execution when processing untrusted agent code. The vulnerability is associated with CWE-94 (Improper Control of Generation of Code) and CWE-693 (Protection Mechanism Failure) and carries a CVSS v3.1 base score of 8.6 (AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).

Exploitation requires local access to the system running PraisonAI, low attack complexity, no privileges, and user interaction, such as convincing a user to execute untrusted agent code within the sandbox. A malicious actor can craft Python code that bypasses the AST filtering— for instance, by using type.__getattribute__ to access prohibited attributes—and achieve arbitrary code execution on the host environment. This grants high-impact confidentiality, integrity, and availability compromises, with a changed scope due to the sandbox escape.

The vulnerability was fixed in PraisonAI version 4.5.128. Additional details on the issue, including the patch and reproduction steps, are available in the GitHub security advisory at https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-3c4r-6p77-xwr7. Security practitioners should upgrade to the patched version and review any deployments running untrusted code in AI agent contexts.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1548 Abuse Elevation Control Mechanism Privilege Escalation
Adversaries may circumvent mechanisms designed to control privilege elevation to gain higher-level permissions.
T1553 Subvert Trust Controls Defense Impairment
Adversaries may undermine security controls that will either warn users of untrusted activity or prevent execution of untrusted programs.
T1553.005 Mark-of-the-Web Bypass Defense Impairment
Adversaries may abuse specific file formats to subvert Mark-of-the-Web (MOTW) controls.
T1600 Weaken Encryption Defense Impairment
Adversaries may compromise a network device’s encryption capability in order to bypass encryption that would otherwise protect data communications.
T1689 Downgrade Attack Defense Impairment
Adversaries may downgrade or use a version of system features that may be outdated, vulnerable, and/or does not support updated security controls.
T1040 Network Sniffing Credential Access
Adversaries may passively sniff network traffic to capture information about an environment, including authentication material passed over the network.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-39891Same product: Praison Praisonai
CVE-2026-44334Same product: Praison Praisonai
CVE-2026-40156Same product: Praison Praisonai
CVE-2026-44336Same product: Praison Praisonai
CVE-2026-40288Same product: Praison Praisonai
CVE-2026-40287Same product: Praison Praisonai
CVE-2026-21669Shared CWE-693, CWE-94
CVE-2026-21671Shared CWE-693, CWE-94
CVE-2023-41319Shared CWE-693, CWE-94
CVE-2025-3114Shared CWE-693, CWE-94

Affected Assets

praison
praisonai
≤ 4.5.128

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 8 hardening rules · 6 OS baselines
Validate
Prove the fix (OWASP ASVS)
  • V6.3.3
  • V6.6.3
  • V10.2.2
  • V1.3.1

Mitigating Controls (NIST 800-53 r5) AI

AC-3 directly requires enforcement of access authorizations via the protection mechanism itself.

AC-4 mandates use of information flow enforcement mechanisms to control data movement.

SC-2 requires separation of user and system functionality as a protection mechanism.

SC-28 requires protection mechanisms for information at rest.

SC-3 requires isolation of security functions from non-security functions.

SC-7 requires boundary protection mechanisms to monitor and control external communications.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.AA-03 mostly match
prevents

Enforcing authentication directly implements a core protection mechanism whose absence or misuse is the CWE.

PR.AA-05 mostly match
prevents

Defining and enforcing access authorizations is a protection mechanism; proper use prevents the CWE.

PR.DS-01 mostly match
prevents

Cryptographic and integrity controls are protection mechanisms whose correct deployment mitigates the CWE.

PR.DS-02 mostly match
prevents

Encryption and integrity protections for transit are explicit protection mechanisms.

PR.IR-01 mostly match
prevents

Logical network protections are protection mechanisms whose failure matches the CWE.

PR.PS-06 mostly match
prevents

PR.PS-06's SDLC practices directly target injection flaws via secure coding and testing (mostly), yet as a single broad outcome it leaves many code-generation specifics unaddressed (partial).

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Systematic verification that security mechanisms operate according to defined standards reduces the likelihood that protection mechanisms are bypassed or disabled.

mitigates

Hardening devices, disabling vulnerable protocols, and maintaining accurate network diagrams reduce the likelihood that a protection mechanism is misconfigured or left in a weak state.

prevents

Banning unapproved code samples and unauthenticated web services, combined with secure-coding standards and SAST, prevents the dynamic generation or inclusion of attacker-supplied code.

none

Requiring defined escalation paths, crisis activation criteria, and coordination procedures strengthens the overall protection mechanism so that a single control failure is less likely to leave the organization exposed.

none

By requiring a documented categorization and decision process for security events, the control ensures that protection mechanisms are not bypassed or ignored when anomalies occur.

none

Identifying and remediating control weaknesses that contributed to an incident reduces the likelihood that protection mechanisms will fail again.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

Oracle Linux 8 (2 rules)
  • V-248524 OL 8 must implement NIST FIPS-validated cryptography for the following: To provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards. prevents CWE-693
  • V-248525 All OL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at-rest protection. prevents CWE-693
Windows 10 (2 rules)
  • V-220865 The Windows Remote Management (WinRM) service must not use Basic authentication. prevents CWE-693
  • V-220812 Credential Guard must be running on Windows 10 domain-joined systems. prevents CWE-693
Windows 11 (1 rule)
  • V-253418 The Windows Remote Management (WinRM) service must not use Basic authentication. prevents CWE-693
Windows Server 2016 (1 rule)
  • V-225012 Windows Server 2016 must be running Credential Guard on domain-joined member servers. prevents CWE-693
Windows Server 2019 (1 rule)
  • V-205907 Windows Server 2019 must be running Credential Guard on domain-joined member servers. prevents CWE-693
Windows Server 2022 (1 rule)
  • V-254441 Windows Server 2022 must be running Credential Guard on domain-joined member servers. prevents CWE-693

References