PyPI: langchain

CVE-2024-8309

Safety vulnerability ID: SFTY-20241029-05452

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchain version 0.2.5 allows for SQL injection through prompt injection. This vulnerability can lead to unauthorized data manipulation, data exfiltration, denial of service (DoS) by deleting all data, breaches in multi-tenant security environments, and data integrity issues. Attackers can create, update, or delete nodes and relationships without proper authorization, extract sensitive data, disrupt services, access data across different tenants, and compromise the integrity of the database.

Created at: Oct 11, 2025Updated at: Oct 11, 2025

Overview

Langchain SQL Injection vulnerability

Advisory

Langchain SQL Injection vulnerability

Affected Package

Affecting langchain package, versions
< 0.2.0

Also affects

---

How to Fix

Upgrade
langchain
to
0.2.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more