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-2025-68665

CVE-2025-68665: Langchain.js Serialization Injection Flaw

CVE-2025-68665 is a serialization injection vulnerability in Langchain.js that allows attackers to inject malicious data through the toJSON() method. This article covers the technical details, affected versions, and mitigation.

Published: March 11, 2026

CVE-2025-68665 Overview

CVE-2025-68665 is a critical insecure deserialization vulnerability affecting LangChain JS, a popular framework for building LLM-powered applications. The vulnerability exists in LangChain JS's toJSON() method and affects subsequent operations when stringifying objects using JSON.stringify(). The method fails to properly escape objects containing 'lc' keys when serializing free-form data in kwargs, allowing attackers to inject malicious serialized objects that are treated as legitimate LangChain objects during deserialization.

Critical Impact

Attackers can inject malicious serialized objects through user-controlled data containing the internal 'lc' key structure. During deserialization, these injected objects are processed as legitimate LangChain objects rather than plain user data, potentially leading to unauthorized code execution, data exfiltration, or complete system compromise.

Affected Products

  • LangChain langchain.js (versions prior to 0.3.37 and 1.2.3)
  • LangChain @langchain/core (versions prior to 0.3.80 and 1.1.8)

Discovery Timeline

  • 2025-12-23 - CVE CVE-2025-68665 published to NVD
  • 2026-01-13 - Last updated in NVD database

Technical Details for CVE-2025-68665

Vulnerability Analysis

This vulnerability is classified as CWE-502 (Deserialization of Untrusted Data). The flaw resides in the serialization mechanism of LangChain JS, specifically within the toJSON() method. LangChain uses an internal 'lc' key as a marker to identify serialized LangChain objects. When user-controlled data containing this specific key structure is processed through the serialization pipeline, the application fails to distinguish between legitimate internal objects and user-supplied data.

The impact of this vulnerability is significant as it affects both confidentiality and integrity of systems running vulnerable versions. Since this vulnerability can be exploited remotely without authentication or user interaction, applications that process untrusted input through LangChain's serialization methods are at considerable risk. Successful exploitation could allow attackers to execute arbitrary code within the context of the LangChain application, manipulate application state, or extract sensitive information processed by the LLM framework.

Root Cause

The root cause of CVE-2025-68665 lies in insufficient input validation and sanitization within the toJSON() serialization method. The method did not implement proper escaping mechanisms for objects containing the reserved 'lc' key when processing free-form data in the kwargs parameter. This oversight allows attackers to craft payloads that mimic the internal serialization format, effectively bypassing the trust boundary between user data and internal objects.

Attack Vector

An attacker can exploit this vulnerability by supplying specially crafted input data containing the 'lc' key structure to any LangChain JS application that serializes user-controlled data. When this data passes through toJSON() or JSON.stringify(), it is serialized without proper escaping. Subsequently, when the serialized data is deserialized, the malicious payload is interpreted as a legitimate LangChain object, enabling object injection attacks.

The patch introduces an escapeIfNeeded validation function to properly handle and escape potentially dangerous key structures:

typescript
 import { type SerializedFields, keyToJson, mapKeys } from "./map_keys.js";
+import { escapeIfNeeded } from "./validation.js";
 
 export interface BaseSerialized<T extends string> {
   lc: number;

Source: GitHub Commit

Detection Methods for CVE-2025-68665

Indicators of Compromise

  • Unexpected or anomalous objects containing the 'lc' key structure in application logs or data stores
  • Unusual deserialization errors or exceptions in LangChain-based applications
  • Evidence of object injection attempts in input validation or WAF logs
  • Suspicious application behavior following processing of user-controlled JSON data

Detection Strategies

  • Implement application-level logging to monitor for unexpected 'lc' key patterns in user input
  • Deploy Web Application Firewalls (WAF) with rules to detect serialization injection patterns
  • Use Static Application Security Testing (SAST) tools to identify vulnerable LangChain versions in your codebase
  • Enable runtime application self-protection (RASP) to detect deserialization attacks

Monitoring Recommendations

  • Monitor application logs for deserialization exceptions and anomalous object instantiation
  • Implement alerting for unusual patterns in JSON payloads containing LangChain-specific key structures
  • Review audit logs for applications processing user-controlled data through LangChain serialization methods
  • Track package versions across your environment to identify systems running vulnerable LangChain versions

How to Mitigate CVE-2025-68665

Immediate Actions Required

  • Upgrade @langchain/core to version 0.3.80 or 1.1.8 or later immediately
  • Upgrade langchain to version 0.3.37 or 1.2.3 or later immediately
  • Audit applications to identify all instances where user-controlled data is processed through LangChain serialization
  • Implement input validation to sanitize or reject data containing suspicious 'lc' key structures until patches can be applied

Patch Information

LangChain has released security patches that address this vulnerability by introducing proper escaping for potentially dangerous key structures. The patches are available in the following versions:

  • @langchain/core: Versions 0.3.80 and 1.1.8 contain the fix
  • langchain: Versions 0.3.37 and 1.2.3 contain the fix

For detailed information, refer to the GitHub Security Advisory GHSA-r399-636x-v7f6. Release notes are available at the v1.1.8 release page and v1.2.3 release page.

Workarounds

  • Implement strict input validation to filter out or escape objects containing the 'lc' key before they reach LangChain serialization methods
  • Deploy a reverse proxy or WAF to inspect and sanitize incoming JSON payloads for malicious serialization patterns
  • Isolate LangChain-based applications in sandboxed environments to limit the impact of potential exploitation
  • If immediate patching is not possible, consider temporarily restricting user input to known-safe schemas
bash
# Update @langchain/core to patched version
npm update @langchain/core@1.1.8

# Update langchain to patched version
npm update langchain@1.2.3

# Verify installed versions
npm list @langchain/core langchain

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

  • Vulnerability Details
  • TypeOther

  • Vendor/TechLangchain

  • SeverityCRITICAL

  • CVSS Score9.1

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-502
  • Technical References
  • GitHub Release v1.1.8

  • GitHub Release v1.2.3
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-r399-636x-v7f6
  • Related CVEs
  • CVE-2025-68664: Langchain Core Serialization Vulnerability

  • CVE-2026-34070: LangChain Path Traversal Vulnerability

  • CVE-2026-27795: LangChain RecursiveUrlLoader SSRF Bypass

  • CVE-2026-26019: LangChain RecursiveUrlLoader SSRF Vulnerability
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