The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40287

CVE-2026-40287: PraisonAI RCE Vulnerability

CVE-2026-40287 is a remote code execution flaw in PraisonAI that allows attackers to execute arbitrary code through malicious tools.py files. This post explains its impact, affected versions, and mitigation steps.

Published: April 17, 2026

CVE-2026-40287 Overview

CVE-2026-40287 is an arbitrary code execution vulnerability affecting PraisonAI, a multi-agent teams system. The vulnerability exists in versions 4.5.138 and below, where the application automatically imports a tools.py file from the current working directory without any validation, sandboxing, or user confirmation. This unsanitized import behavior allows attackers to execute arbitrary Python code in the host environment.

Critical Impact

An attacker who can place a malicious tools.py file in the directory where PraisonAI is launched can achieve immediate arbitrary Python code execution, compromising the full PraisonAI process, the host system, and any connected data or credentials.

Affected Products

  • PraisonAI versions 4.5.138 and below
  • Components: call.py (import_tools_from_file())
  • Components: tool_resolver.py (_load_local_tools())
  • CLI tool-loading paths

Discovery Timeline

  • 2026-04-14 - CVE CVE-2026-40287 published to NVD
  • 2026-04-14 - Last updated in NVD database

Technical Details for CVE-2026-40287

Vulnerability Analysis

This vulnerability is classified as Code Injection (CWE-94), where the application blindly imports and executes code from an untrusted source. The attack requires local access to place a malicious file in a directory where PraisonAI will be executed, making it particularly dangerous in shared development environments, collaborative workspaces, or when users clone untrusted repositories.

The vulnerability stems from a fundamental trust assumption in the application's design—that files in the current working directory are inherently trustworthy. This assumption fails in modern development workflows where directories may contain files from multiple sources with varying levels of trust.

Root Cause

The root cause is the automatic, unsanitized import of ./tools.py at startup across multiple components of PraisonAI. The affected components include:

  • call.py - Contains import_tools_from_file() function that performs the import
  • tool_resolver.py - Contains _load_local_tools() function with similar behavior
  • CLI tool-loading paths that blindly import from the working directory

These components execute Python code from the local tools.py file without performing any integrity checks, signature validation, sandboxing, or prompting the user for confirmation.

Attack Vector

The attack vector is local, requiring an attacker to place a malicious tools.py file in a directory where a user will execute PraisonAI. Common attack scenarios include:

  • Supply chain attacks: A malicious tools.py hidden in a cloned repository
  • Shared workspace compromise: Placing the file in a shared project directory
  • Writable workspace exploitation: Writing to directories where developers commonly run the tool

When PraisonAI is launched, it automatically imports the malicious file, executing any Python code contained within. This grants the attacker the same privileges as the user running PraisonAI, enabling data exfiltration, credential theft, backdoor installation, or further lateral movement within the environment.

The vulnerability mechanism involves Python's import system executing arbitrary code when the tools.py module is loaded. When PraisonAI components call import functions on ./tools.py, any top-level code in that file is immediately executed, allowing attackers to run malicious payloads before the application even completes initialization. For technical details, refer to the GitHub Security Advisory.

Detection Methods for CVE-2026-40287

Indicators of Compromise

  • Unexpected tools.py files appearing in project directories or workspaces where PraisonAI is executed
  • Unusual network connections or process spawning originating from PraisonAI processes
  • Suspicious Python import activities in directories not typically associated with the user's legitimate workflows

Detection Strategies

  • Monitor file system activity for creation or modification of tools.py files in directories where PraisonAI is commonly executed
  • Implement application allowlisting to detect unauthorized code execution from Python processes
  • Analyze process trees for unexpected child processes spawned by PraisonAI

Monitoring Recommendations

  • Enable file integrity monitoring on development workspaces and shared project directories
  • Configure endpoint detection to alert on Python processes importing modules from writable user directories
  • Review audit logs for PraisonAI execution in directories containing recently modified tools.py files

How to Mitigate CVE-2026-40287

Immediate Actions Required

  • Upgrade PraisonAI to version 4.5.139 or later immediately
  • Audit all directories where PraisonAI has been executed for suspicious tools.py files
  • Review recently cloned repositories or shared workspaces for unauthorized files

Patch Information

This vulnerability has been fixed in PraisonAI version 4.5.139. The fix addresses the unsanitized import behavior in call.py, tool_resolver.py, and CLI tool-loading paths. Users should upgrade to the patched version as soon as possible. For additional information, see the GitHub Security Advisory.

Workarounds

  • Before running PraisonAI, manually inspect the current working directory for any tools.py files that should not be present
  • Execute PraisonAI from dedicated, clean directories with restricted write permissions
  • Implement directory-level access controls to prevent unauthorized file creation in development workspaces
bash
# Configuration example
# Upgrade PraisonAI to the patched version
pip install --upgrade praisonai>=4.5.139

# Verify the installed version
pip show praisonai | grep Version

# Check for suspicious tools.py files before running PraisonAI
find . -name "tools.py" -type f -ls

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPraisonai

  • SeverityHIGH

  • CVSS Score8.4

  • EPSS Probability0.02%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-40288: PraisonAI YAML Workflow RCE Vulnerability

  • CVE-2026-40156: PraisonAI RCE Vulnerability

  • CVE-2026-40158: PraisonAI Sandbox Bypass RCE Vulnerability

  • CVE-2026-40088: PraisonAI RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English