Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40158: CWE-94: Improper Control of Generation of Code ('Code Injection') in MervinPraison PraisonAI

0
High
VulnerabilityCVE-2026-40158cvecve-2026-40158cwe-94cwe-693
Published: Fri Apr 10 2026 (04/10/2026, 16:49:24 UTC)
Source: CVE Database V5
Vendor/Project: MervinPraison
Product: PraisonAI

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.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/11/2026, 05:18:24 UTC

Technical Analysis

PraisonAI versions before 4.5.128 use an AST-based Python sandbox to restrict untrusted agent code by filtering dangerous attributes such as __subclasses__, __globals__, and __bases__. However, the filtering only inspects ast.Attribute nodes and does not check ast.Constant nodes, allowing bypass via dynamic attribute resolution through type.__getattribute__. This enables arbitrary code execution within the sandbox environment. The vulnerability is identified as CWE-94 (Improper Control of Generation of Code) and CWE-693 (Protection Mechanism Failure). The vulnerability is fixed in version 4.5.128, but no explicit vendor advisory or patch link is provided in the data.

Potential Impact

Successful exploitation allows an attacker running untrusted agent code to bypass sandbox restrictions and execute arbitrary code. This leads to complete compromise of the system's confidentiality, integrity, and availability. The CVSS v3.1 score is 8.6 (high), reflecting local attack vector with low complexity, no privileges required, user interaction needed, and scope changed with high impact on confidentiality, integrity, and availability.

Mitigation Recommendations

The vulnerability is fixed in PraisonAI version 4.5.128. Users should upgrade to this version or later to remediate the issue. Since no official patch advisory is provided, users should verify with the vendor for confirmation and further guidance. Until patched, avoid running untrusted agent code or apply additional sandboxing controls if possible.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-09T19:31:56.014Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 69d9d9721cc7ad14da3f863d

Added to database: 4/11/2026, 5:17:38 AM

Last enriched: 4/11/2026, 5:18:24 AM

Last updated: 4/11/2026, 2:02:18 PM

Views: 7

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses