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

- Severity: Medium 4.9 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.64%, higher than 45% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-10-29T12:50:13.198Z
- Modified: 2026-07-09T16:45:06.281Z
- Also known as: GHSA-45pg-36p6-83v9, PYSEC-2024-115, PYSEC-2026-1507
- Weaknesses: CWE-74, CWE-89
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- langchain-ai langchain-ai/langchain: from unspecified before 0.3.0
- langchain-ai langchain: before 0.3.0
- langchain-community (PyPI): from 0.2.0 before 0.2.19; from 0.2.0 before 0.3.0
- langchain (PyPI): before 0.2.0; before c2a3021bb0c5f54649d380b42a0684ca5778c255
- langchain langchain: 0.2.5

## Every score

- @huntr_ai: CVSS:3.0 4.9 Medium `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:3.0 4.9 Low `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.0 4.9 Medium `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- PyPA Advisory Database: CVSS:4.0 `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`

## References

- <https://huntr.com/bounties/8f4ad910-7fdc-4089-8f0a-b5df5f32e7c5> (exploit, evidence, third-party-advisory, web)
- <https://github.com/langchain-ai/langchain/commit/c2a3021bb0c5f54649d380b42a0684ca5778c255> (fix, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-8309> (advisory)
- <https://github.com/langchain-ai/langchain/commit/64c317eba05fbac0c6a6fc5aa192bc0d7130972e> (web)
- <https://github.com/langchain-ai/langchain> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-115.yaml> (web)
- <https://github.com/advisories/GHSA-45pg-36p6-83v9> (advisory)
- <https://pypi.org/project/langchain> (package)

## Sources

- CVE List: [CVE-2024-8309](https://www.cve.org/CVERecord?id=CVE-2024-8309), CVE Terms of Use, modified 2025-10-15
- GitHub Advisory Database: [GHSA-45pg-36p6-83v9](https://github.com/advisories/GHSA-45pg-36p6-83v9), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2024-8309](https://nvd.nist.gov/vuln/detail/CVE-2024-8309), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2024-115](https://osv.dev/vulnerability/PYSEC-2024-115), CC-BY-4.0, modified 2026-07-09
- PyPA Advisory Database: [PYSEC-2026-1507](https://osv.dev/vulnerability/PYSEC-2026-1507), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-8309 · Whole record: https://cve.day/CVE-2024-8309.json · Rebuilt by cve.day 2026-11-25T22:58:47.488Z
