CVE-2024-8309: SQL Injection in langchain-ai/langchain
Vulnerability summary
CVE-2024-8309 is a critical (CVSS 9.8) vulnerability in langchain-ai langchain-ai/langchain. EPSS estimates a 13.63% chance of exploitation in the next 30 days, higher than 96.5% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 4.9, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 29-10-2024PublishedVulnerability first disclosed.
- 15-10-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
5 scores · 3 sources · 3 versions- OSV · PypiEcosystem advisory · calculated4.9MediumCVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- NVDNIST4.9MediumCVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
EPSS trend
Probability
13.63%
Chance of exploitation in the next 30 days
Percentile
97%
Versus all other CVEs
30-day change
Decrease -0.11 pp
From 13.74% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundExploit Reference (huntr.com)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-89Improper Neutralization of Special Elements used in an SQL CommandThe product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.
- CWE-74Improper Neutralization of Special Elements in Output Used by a Downstream ComponentThe product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
Affected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
PyPI2 products
- langchain< 0.2.0 | < c2a3021bb0c5f54649d380b42a0684ca5778c255
- langchain-community≥ 0.2.0, < 0.2.19 | ≥ 0.2.0, < 0.3.0
Langchain1 product
- langchain0.2.5
Langchain-ai1 product
- langchain-ai/langchain≥ unspecified, < 0.3.0
3 vendors · 4 products
References
8 links- pypi.org/project/langchainPACKAGE