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
    • 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-34070

CVE-2026-34070: LangChain Path Traversal Vulnerability

CVE-2026-34070 is a path traversal flaw in LangChain that allows attackers to read arbitrary files through malicious prompt configurations. This article covers technical details, affected versions, impact, and mitigation.

Published: April 2, 2026

CVE-2026-34070 Overview

CVE-2026-34070 is a path traversal vulnerability affecting LangChain, a popular framework for building agents and LLM-powered applications. The vulnerability exists in multiple functions within langchain_core.prompts.loading that read files from paths embedded in deserialized configuration dictionaries without properly validating against directory traversal sequences or absolute path injection attacks.

When an application passes user-influenced prompt configurations to load_prompt() or load_prompt_from_config(), an attacker can read arbitrary files on the host filesystem. The attack is constrained only by file-extension checks—.txt for templates and .json/.yaml for examples—but this still allows extraction of sensitive configuration files, credentials, and other critical data.

Critical Impact

Attackers can read arbitrary files from the host filesystem through path traversal attacks, potentially exposing sensitive credentials, API keys, and configuration data used in LLM-powered applications.

Affected Products

  • LangChain versions prior to 1.2.22
  • Applications using langchain_core.prompts.loading module
  • Systems that pass user-influenced configurations to prompt loading functions

Discovery Timeline

  • 2026-03-31 - CVE-2026-34070 published to NVD
  • 2026-04-02 - Last updated in NVD database

Technical Details for CVE-2026-34070

Vulnerability Analysis

This vulnerability stems from improper input validation in LangChain's prompt loading functionality (CWE-22: Path Traversal). The affected functions within langchain_core.prompts.loading accept file paths from deserialized configuration dictionaries and use them to read file contents without adequate security checks.

While the implementation includes file extension validation (restricting reads to .txt, .json, and .yaml files), it fails to sanitize path components that could allow directory traversal. An attacker can craft malicious configuration inputs containing sequences like ../ or absolute paths to escape the intended directory context and access files elsewhere on the filesystem.

The network-accessible nature of this vulnerability means it can be exploited remotely without authentication when applications expose prompt loading functionality to user inputs. The confidentiality impact is significant as attackers can potentially access sensitive system files, application configurations, environment variables, and credentials stored in supported file formats.

Root Cause

The root cause is insufficient path validation in the prompt loading functions. The code reads file paths from configuration dictionaries that may originate from untrusted sources but fails to implement proper path canonicalization or directory containment checks. While extension-based filtering exists, it does not prevent directory traversal attacks that could reach sensitive files with permitted extensions (e.g., /etc/passwd.txt symlinks or configuration files like secrets.json).

Attack Vector

The attack requires an application that passes user-controlled or user-influenced prompt configurations to the vulnerable load_prompt() or load_prompt_from_config() functions. An attacker can inject malicious path values in the configuration dictionary, using directory traversal sequences to escape intended directories. For example, a template path containing ../../../../etc/sensitive.txt could read files outside the application's prompt directory.

The vulnerability is particularly dangerous in multi-tenant LLM applications, API services that accept prompt configurations, or any system where users can influence the prompt loading process. Successful exploitation results in arbitrary file read, which can lead to exposure of API keys, database credentials, environment configurations, and other sensitive data.

Detection Methods for CVE-2026-34070

Indicators of Compromise

  • Unusual file access patterns in application logs involving prompt template directories
  • Log entries showing file paths containing directory traversal sequences (../, ..\\)
  • Application errors related to file not found for paths outside expected directories
  • Unexpected access to sensitive configuration files from LangChain processes

Detection Strategies

  • Monitor file system access logs for LangChain applications accessing files outside designated prompt directories
  • Implement application-level logging for all load_prompt() and load_prompt_from_config() calls
  • Deploy Web Application Firewall (WAF) rules to detect path traversal patterns in API requests
  • Review application inputs for configuration dictionaries containing suspicious path values

Monitoring Recommendations

  • Enable verbose logging for file I/O operations in LangChain applications
  • Set up alerts for access attempts to sensitive directories from LLM application processes
  • Monitor for error patterns indicating blocked file access attempts
  • Implement file integrity monitoring on sensitive configuration files

How to Mitigate CVE-2026-34070

Immediate Actions Required

  • Upgrade LangChain to version 1.2.22 or later immediately
  • Audit applications using langchain_core.prompts.loading for user-influenced inputs
  • Implement input validation on any user-controlled prompt configurations
  • Restrict file system permissions for LangChain application processes

Patch Information

The vulnerability has been patched in LangChain version 1.2.22. The fix implements proper path validation to prevent directory traversal and absolute path injection attacks. Users should update their installations using pip:

bash
pip install --upgrade langchain-core>=1.2.22

For more details, refer to the GitHub Security Advisory and the patch commit.

Workarounds

  • Avoid passing user-influenced configurations to prompt loading functions
  • Implement allowlist-based path validation before calling load_prompt() functions
  • Use chroot or container isolation to limit file system access for LangChain applications
  • Apply strict input sanitization to remove directory traversal sequences from any user input
bash
# Verify installed version and upgrade if needed
pip show langchain-core | grep Version
pip install --upgrade langchain-core>=1.2.22

# For containerized deployments, rebuild with patched version
# Example Dockerfile modification:
# RUN pip install langchain-core>=1.2.22

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechLangchain

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.19%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-22
  • Technical References
  • GitHub Release Notes
  • Vendor Resources
  • GitHub Commit Overview

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-27795: LangChain RecursiveUrlLoader SSRF Bypass

  • CVE-2026-26019: LangChain RecursiveUrlLoader SSRF Vulnerability

  • CVE-2026-26013: LangChain SSRF Vulnerability

  • CVE-2025-68665: Langchain.js Serialization Injection Flaw
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