Cyber Resilience

CVE-2026-40156

LPE in Praisonai ≤ 4.5.128

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

Summary

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

Operationally, exploitation aligns with the MITRE ATT&CK technique Path Interception (T1034); ranked at the 11th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to CM-6 (Configuration Settings) and SA-11 (Developer Testing and Evaluation) — 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-40156 is a code injection vulnerability in PraisonAI, an open-source multi-agent teams system, affecting versions prior to 4.5.128. The flaw stems from the application's automatic loading of a file named tools.py from the current working directory to discover and register custom agent tools. This process employs importlib.util.spec_from_file_location followed by spec.loader.exec_module() to execute module-level code without user consent, validation, or sandboxing. The file is loaded implicitly, regardless of whether it is referenced in configuration files or explicitly requested, treating potentially untrusted content in the working directory as executable code and violating expected security boundaries.

An attacker with local access to the filesystem can exploit this vulnerability by placing a malicious tools.py file in the current working directory used by PraisonAI. Exploitation requires low complexity and no privileges (PR:N), but user interaction is needed (UI:R), such as a user or automated system like a CI/CD pipeline running the application from the compromised directory. Successful exploitation triggers arbitrary code execution immediately upon startup, before any agent logic executes, granting high confidentiality, integrity, and availability impacts (CVSS 7.8: AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H). The issue maps to CWEs-94 (code injection), CWE-426 (untrusted search path), and CWE-829 (file inclusion).

The vulnerability is addressed in PraisonAI version 4.5.128, as detailed in the GitHub security advisory (GHSA-2g3w-cpc4-chr4). Security practitioners should upgrade to the patched version and review working directories for unauthorized tools.py files, particularly in AI/ML development environments where multi-agent systems like PraisonAI are deployed.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

PraisonAI is a multi-agent teams system. Prior to 4.5.128, PraisonAI automatically loads a file named tools.py from the current working directory to discover and register custom agent tools. This loading process uses importlib.util.spec_from_file_location and immediately executes module-level code via spec.loader.exec_module()…

more

without explicit user consent, validation, or sandboxing. The tools.py file is loaded implicitly, even when it is not referenced in configuration files or explicitly requested by the user. As a result, merely placing a file named tools.py in the working directory is sufficient to trigger code execution. This behavior violates the expected security boundary between user-controlled project files (e.g., YAML configurations) and executable code, as untrusted content in the working directory is treated as trusted and executed automatically. If an attacker can place a malicious tools.py file into a directory where a user or automated system (e.g., CI/CD pipeline) runs praisonai, arbitrary code execution occurs immediately upon startup, before any agent logic begins. This vulnerability is fixed in 4.5.128.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1034 Path Interception Persistence
**This technique has been deprecated.
T1195 Supply Chain Compromise Initial Access
Adversaries may manipulate products or product delivery mechanisms prior to receipt by a final consumer for the purpose of data or system compromise.
T1574 Hijack Execution Flow Stealth
Adversaries may execute their own malicious payloads by hijacking the way operating systems run programs.
T1574.001 DLL Stealth
Adversaries may abuse dynamic-link library files (DLLs) in order to achieve persistence, escalate privileges, and evade defenses.
T1574.008 Path Interception by Search Order Hijacking Stealth
Adversaries may execute their own malicious payloads by hijacking the search order used to load other programs.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
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-40313Same product: Praison Praisonai
CVE-2026-40154Same product: Praison Praisonai
CVE-2026-44336Same product: Praison Praisonai
CVE-2026-40158Same product: Praison Praisonai
CVE-2026-40287Same product: Praison Praisonai
CVE-2026-40288Same product: Praison Praisonai
CVE-2026-55522Shared CWE-426, CWE-829
CVE-2025-55305Shared CWE-829, 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)
  • 6 hardening rules · 6 OS baselines
Validate
Prove the fix (OWASP ASVS)
  • V14.2.3
  • V3.5.6
  • V9.1.3
  • V15.3.2

Mitigating Controls (NIST 800-53 r5) AI

Secure baseline settings can enforce absolute, organization-controlled paths for critical resources.

Developer testing and evaluation finds code paths that accept and execute externally influenced strings.

Input validation directly stops untrusted data from being used to construct executable code without neutralization.

Requires documented, valid provenance for components, preventing acceptance of code from outside the trusted sphere.

Least privilege limits the damage an injected code fragment can perform once executed.

Least-functionality configuration can prohibit unapproved directories or executables from being reachable via search paths.

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.

ID.RA-09 full match
prevents

Pre-acquisition integrity/authenticity checks directly prevent inclusion of untrusted code.

PR.PS-05 full match
prevents

Preventing execution of unauthorized code directly blocks the malicious binaries that an untrusted search path would load.

GV.SC-01 mostly match
prevents

Supply-chain program directly governs inclusion of third-party executable code.

GV.SC-05 mostly match
prevents

Contractual requirements can mandate trusted sources and integrity checks for included functionality.

GV.SC-07 mostly match
prevents

Supplier risk assessment explicitly covers risks from their products and libraries.

ID.RA-10 mostly match
prevents

Critical-supplier assessment reduces risk of importing executable functionality from untrusted parties.

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.

prevents

By requiring suppliers to propagate security requirements and to disclose component provenance, the control limits the inclusion of functionality obtained from untrusted third-party sources without oversight.

finds

Security testing can discover search-path issues but does not itself prevent them in production code.

degrades

Restricting software installation reduces the chance that untrusted binaries or libraries are placed in search paths.

prevents

Secure architecture principles include hard-coded or validated search paths and avoiding reliance on untrusted directories.

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

Blocking domains that serve malware or untrusted scripts prevents the browser from automatically including functionality from an attacker-controlled source.

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 (1 rule)
  • V-248635 Executable search paths within the initialization files of all local interactive OL 8 users must only contain paths that resolve to the system default or the user's home directory. prevents CWE-829
Oracle Linux 9 (1 rule)
  • V-271847 OL 9 must be configured so that executable search paths within the initialization files of all local interactive users must only contain paths that resolve to the system default or the users home directory. prevents CWE-829
RHEL 7 (1 rule)
  • V-204477 The Red Hat Enterprise Linux operating system must be configured so that all local interactive user initialization files executable search paths contain only paths that resolve to the users home directory. prevents CWE-829
RHEL 8 (1 rule)
  • V-230317 Executable search paths within the initialization files of all local interactive RHEL 8 users must only contain paths that resolve to the system default or the users home directory. prevents CWE-829
RHEL 9 (1 rule)
  • V-258050 Executable search paths within the initialization files of all local interactive RHEL 9 users must only contain paths that resolve to the system default or the users home directory. prevents CWE-829
Windows 10 (1 rule)
  • V-220737 Administrative accounts must not be used with applications that access the Internet, such as web browsers, or with potential Internet sources, such as email. prevents CWE-829

References