Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2023-36258

CVE-2023-36258: Langchain RCE Vulnerability

CVE-2023-36258 is a remote code execution vulnerability in Langchain that allows attackers to execute arbitrary code through Python commands. This article covers the technical details, affected versions, and mitigation.

Published: February 11, 2026

CVE-2023-36258 Overview

CVE-2023-36258 is a critical code injection vulnerability affecting LangChain versions prior to 0.0.236. This flaw allows attackers to execute arbitrary code on systems running vulnerable LangChain instances by exploiting insufficient input validation that permits the use of dangerous Python functions including os.system, exec, and eval.

LangChain is a popular open-source framework designed for developing applications powered by large language models (LLMs). The framework's widespread adoption in AI/ML pipelines makes this vulnerability particularly concerning, as successful exploitation could lead to complete system compromise in environments processing untrusted input.

Critical Impact

Attackers can achieve arbitrary code execution on affected systems, potentially leading to complete system compromise, data exfiltration, and lateral movement within connected infrastructure.

Affected Products

  • LangChain versions prior to 0.0.236
  • LangChain version 0.0.199 (confirmed affected)
  • All LangChain deployments processing untrusted user input

Discovery Timeline

  • 2023-07-03 - CVE-2023-36258 published to NVD
  • 2024-11-22 - Last updated in NVD database

Technical Details for CVE-2023-36258

Vulnerability Analysis

This vulnerability is classified as Code Injection (CWE-94), which occurs when an application constructs or executes code using externally-influenced input without sufficient neutralization. In the context of LangChain, the framework processes user-provided data that can include Python code constructs, which are then executed without adequate sanitization.

The vulnerability is network-exploitable with low attack complexity, requiring no privileges or user interaction. The impact spans all three security pillars: confidentiality, integrity, and availability are all fully compromised upon successful exploitation. This makes it particularly dangerous in multi-tenant environments or public-facing LangChain deployments.

Root Cause

The root cause of CVE-2023-36258 lies in insufficient input validation and sanitization within LangChain's code processing mechanisms. The framework fails to properly restrict or sanitize Python code constructs before execution, allowing dangerous functions like os.system, exec, and eval to be invoked through user-controlled input. This design flaw enables attackers to inject malicious Python code that the application will execute with the same privileges as the LangChain process.

Attack Vector

The attack vector for this vulnerability is network-based, meaning attackers can remotely exploit vulnerable LangChain instances without requiring local access. An attacker can craft malicious input containing Python code that leverages dangerous built-in functions to execute system commands.

For example, an attacker could submit input that invokes os.system() to execute shell commands, use exec() to run arbitrary Python statements, or leverage eval() to evaluate malicious expressions. Since LangChain applications often process natural language queries that may be transformed into executable operations, the attack surface is particularly broad.

The vulnerability is documented in the LangChain GitHub Issue #5872, which provides additional technical context on the exploitation mechanism and affected components.

Detection Methods for CVE-2023-36258

Indicators of Compromise

  • Unexpected system process spawns originating from Python/LangChain processes
  • Unusual outbound network connections from LangChain application servers
  • Log entries showing attempts to use os.system, exec, or eval functions within LangChain input processing
  • Anomalous file system modifications or new files created by the LangChain process

Detection Strategies

  • Monitor application logs for suspicious Python function calls including os.system, exec, eval, and related code execution primitives
  • Implement runtime application self-protection (RASP) to detect and block code injection attempts
  • Deploy network-based intrusion detection systems (IDS) to identify exploitation traffic patterns targeting LangChain endpoints
  • Use SentinelOne's behavioral AI to detect anomalous process behavior from Python applications

Monitoring Recommendations

  • Enable verbose logging for all LangChain application components to capture input/output data
  • Configure alerting for any process spawned by the LangChain runtime that executes shell commands
  • Monitor system call activity from Python processes for unusual patterns indicating code execution
  • Implement network traffic analysis for LangChain API endpoints to detect malicious payloads

How to Mitigate CVE-2023-36258

Immediate Actions Required

  • Upgrade LangChain to version 0.0.236 or later immediately
  • Audit all LangChain deployments to identify vulnerable versions in your environment
  • Implement input validation and sanitization for all user-provided data processed by LangChain
  • Apply network segmentation to isolate LangChain services from critical infrastructure

Patch Information

The vulnerability has been addressed in LangChain version 0.0.236 and later. Organizations should immediately update their LangChain installations to the latest stable version. The fix implements proper input sanitization to prevent the execution of dangerous Python functions through user-controlled input.

For detailed information about the vulnerability and the remediation approach, refer to the GitHub Issue Discussion.

Workarounds

  • Implement a strict allowlist of permitted operations and reject any input containing dangerous Python functions
  • Deploy LangChain applications in sandboxed environments with minimal privileges and restricted system access
  • Use Web Application Firewalls (WAF) with rules to block requests containing Python code execution patterns
  • Consider running LangChain in containerized environments with restricted capabilities and read-only file systems
bash
# Configuration example - Upgrade LangChain to patched version
pip install --upgrade langchain>=0.0.236

# Verify installed version
pip show langchain | grep Version

# For production environments, update requirements.txt
echo "langchain>=0.0.236" >> requirements.txt

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechLangchain

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.49%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-noinfo

  • CWE-94
  • Vendor Resources
  • GitHub Issue Discussion
  • Related CVEs
  • CVE-2026-30617: LangChain-ChatChat 0.3.1 RCE Vulnerability

  • CVE-2026-40087: LangChain RCE Vulnerability

  • CVE-2025-46059: LangChain GmailToolkit RCE Vulnerability

  • CVE-2024-46946: Langchain-experimental 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