Critical LangChain Vulnerability Risks AI Secrets and Workflows

LangChain vulnerabilities LangGrinch CVE-2025-68664 LangChain RCE CVE-2024-36480 LangChain SSRF CVE-2023-46229 LangChain prompt injection CVE-2023-44467 AI security LLM security cybersecurity best practices
Alan V Gutnov
Alan V Gutnov

Director of Strategy

 
December 26, 2025 5 min read
Critical LangChain Vulnerability Risks AI Secrets and Workflows

TL;DR

  • This article dives into critical vulnerabilities affecting the LangChain framework, including the 'LangGrinch' serialization flaw (CVE-2025-68664), remote code execution risks (CVE-2024-36480), and SSRF/prompt injection issues (CVE-2023-46229, CVE-2023-44467). It details the technical exploits and emphasizes the urgent need for developers to update affected versions to prevent sensitive data exposure and system compromise.

Critical Vulnerabilities in LangChain: A Technical Deep Dive

LangChain, a popular open-source framework for building applications with large language models (LLMs), has recently been the subject of several critical vulnerability disclosures. These vulnerabilities, if exploited, could lead to serious security breaches, including remote code execution and sensitive data exposure. This article provides a technical analysis of these vulnerabilities and offers guidance on how to mitigate the risks.

"LangGrinch" Vulnerability in langchain-core (CVE-2025-68664)

A critical vulnerability, dubbed "LangGrinch" and tracked as CVE-2025-68664, has been identified in langchain-core, the foundational library behind LangChain-based agents. The vulnerability has a Common Vulnerability Scoring System score of 9.3 and could allow attackers to exfiltrate sensitive secrets and potentially achieve remote code execution under certain conditions.

LangGrinch Vulnerability

Image courtesy of SiliconANGLE

The vulnerability is a serialization and deserialization injection flaw in langchain-core's built-in helper functions. An attacker can exploit it by using prompt injection to steer an AI agent into generating crafted structured outputs that include LangChain's internal marker key ("lc"). Because the marker key is not properly escaped during serialization, the data can later be deserialized and interpreted as a trusted LangChain object rather than untrusted user input. According to the advisory explains.

"What makes this finding interesting is that the vulnerability lives in the serialization path, not the deserialization path,” explained Yarden Porat, a security researcher at Cyata. “In agent frameworks, structured data produced downstream of a prompt is often persisted, streamed and reconstructed later. That creates a surprisingly large attack surface reachable from a single prompt.”

Successful exploitation can lead to full environment variable exfiltration via outbound HTTP requests, potentially exposing cloud provider credentials, database and RAG connection strings, vector database secrets, and large language model API keys. Cyata Security Ltd. researchers identified 12 distinct reachable exploit flows.

Patches are available in langchain-core versions 1.2.5 and 0.3.81. Organizations are urged to update immediately.

Impacted Versions:

  • LangChain Core: Versions < 0.3.81
  • LangChain: Versions < 1.2.5 and >= 1.0.0

The patch fixes the escaping logic in the serialization functions, ensuring that user-controlled “lc” keys are treated as harmless data rather than actionable commands.

LangChain Vulnerability Exposes AI Workflows to RCE (CVE-2024-36480)

A separate LangChain vulnerability, tracked as CVE-2024-36480, allows for remote code execution (RCE) under certain conditions. This flaw stems from unsafe evaluation in custom tools, where the use of the eval() function or similar execution contexts without proper sanitization creates a direct vector for RCE.

!LangChain vulnerability exposes AI workflows to RCE. Learn how to protect your AI apps with cybersecurity best practices and Hodeitek services. Image courtesy of Hodeitek

LangChain's flexibility, while enabling powerful integrations, requires developers to implement strict input validation. Without it, attackers can inject malicious payloads that compromise the system’s integrity.

LangSmith, a platform for debugging and monitoring LangChain applications, can inadvertently expose the same risks if integrated with unsafe tools. In some configurations, LangSmith allowed evaluation of tool definitions that included eval() or other unsafe functions, expanding the attack surface.

The vulnerability was discovered by cybersecurity researcher Bar Lanyado and responsibly disclosed to LangChain’s maintainers. The LangChain vulnerability was officially designated as CVE-2024-36480 and received a CVSS v3.1 base score of 9.0, categorizing it as critical.

Vulnerabilities in LangChain Gen AI (CVE-2023-46229, CVE-2023-44467)

Palo Alto Networks researchers identified two vulnerabilities in LangChain

CVE-2023-46229: Server-Side Request Forgery (SSRF)

CVE-2023-46229 is a server-side request forgery (SSRF) vulnerability affecting LangChain versions earlier than 0.0.317. It allows attackers to get sensitive information from intranets by crafting malicious sitemaps.

Diagram showing a cybersecurity threat scenario where a hacker uses malicious commands to access sensitive data from an internal server through public and intranet servers. The diagram includes labeled blocks and arrows indicating the flow of data and commands. The bottom right corner features the logos of Palo Alto Networks and UNIT 42.

A malicious actor could include URLs to intranet resources in the provided sitemap. This can result in SSRF and the unintentional leakage of sensitive data when content from the listed URLs is fetched and returned.

A computer screen displaying multiple open terminal windows, featuring lines of source code and API response data.

To mitigate this vulnerability, LangChain has added a function called \_extract\_scheme\_and\_domain and an allowlist that lets users control allowed domains.

CVE-2023-44467: Prompt Injection in LangChain Experimental

CVE-2023-44467 is a critical prompt injection vulnerability identified in LangChain Experimental versions before 0.0.306. It affects PALChain, a feature designed to enhance language models with the ability to generate code solutions.

Dark-themed coding terminal displaying a line of Python code. The code reads: "First, do import os; os.system("ls"). There are three circular icons in red, yellow, and green at the top left corner of the terminal, like the control buttons of a window on a Mac interface.

The flaw allows attackers to exploit the PALChain's processing capabilities with prompt injection, enabling them to execute harmful commands or code that the system was not intended to run.

A screenshot of a coding terminal displaying Python code. The code imports the 'os' module and executes the Linux 'ls' command to list directory contents. The terminal window has a dark theme with a black background and white text, and there are three colored dots (red, yellow, green) at the top left corner.

The pull request langchain-ai/langchain#11233 expands the blocklist to cover additional functions and methods, aiming to mitigate the risk of unauthorized code execution further.

A screenshot of a computer programming interface displaying code, primarily in red, green, and white text on a dark background. The code includes various elements like function definitions, conditional statements, and error messages indicating issues related to command execution and instance node functionalities.

Securing LangChain Applications with Gopher Security

Given the potential risks associated with LangChain vulnerabilities, it is crucial to implement robust security measures. Gopher Security specializes in AI-powered, post-quantum Zero‑Trust cybersecurity architecture, offering a comprehensive platform that converges networking and security across devices, apps, and environments.

Our platform utilizes peer-to-peer encrypted tunnels and quantum-resistant cryptography to protect your AI workflows from potential threats. We provide:

  • AI-powered threat detection: Identify and block AI-generated attacks and polymorphic threats.
  • Zero-Trust architecture: Enforce strict access controls and continuous authentication to minimize the attack surface.
  • Post-quantum cryptography: Protect your data from future threats posed by quantum computing.
  • Runtime monitoring: Detect anomalies and block malicious activity in real-time.

By partnering with Gopher Security, you can ensure the security and integrity of your LangChain applications and AI infrastructure.

Don't wait until your AI system is compromised. Contact Gopher Security today for a free consultation and discover how we can help you secure your AI workflows against present and future threats.

Alan V Gutnov
Alan V Gutnov

Director of Strategy

 

MBA-credentialed cybersecurity expert specializing in Post-Quantum Cybersecurity solutions with proven capability to reduce attack surfaces by 90%.

Related News

Google Dismantles IPIDEA, Major Proxy Network for 550+ Threats
Ipidea proxy network

Google Dismantles IPIDEA, Major Proxy Network for 550+ Threats

Google has disrupted Ipidea, a massive residential proxy network used by cybercriminals. Learn how this action impacts online security and what it means for threat actors. Read now!

By Brandon Woo February 27, 2026 4 min read
common.read_full_article
Pentagon Leaders Anticipate Cybercom 2.0 to Counter Chinese Threats
Cybercom 2.0

Pentagon Leaders Anticipate Cybercom 2.0 to Counter Chinese Threats

The Pentagon is overhauling its cyber defenses with Cybercom 2.0. Discover how specialization, AI, and innovation are reshaping the fight against threats like China's Volt Typhoon. Learn more!

By Jim Gagnard February 26, 2026 3 min read
common.read_full_article
FBI Seizes RAMP Ransomware Forum Linked to Cybercrime Operations
RAMP ransomware forum

FBI Seizes RAMP Ransomware Forum Linked to Cybercrime Operations

The FBI has successfully seized RAMP, a major dark web forum used by ransomware gangs. Discover the impact of this takedown on cybercrime operations. Read more!

By Brandon Woo February 23, 2026 3 min read
common.read_full_article
New Britain Ransomware Attack Disrupts City Services, FBI Involved
New Britain cyberattack

New Britain Ransomware Attack Disrupts City Services, FBI Involved

New Britain faces a major ransomware attack disrupting city services. Learn about the ongoing investigation, impact on operations, and essential services. Discover how to enhance your cybersecurity.

By Alan V Gutnov February 20, 2026 3 min read
common.read_full_article