SQL Injection in langchain-ai/langchain
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| langchain-ai | langchain-ai/langchain | before 0.3.0 | 0.3.0 | Patch available | CNA |
| — | langchain-community (PyPI) | 0.2.0 to before 0.2.19 | 0.2.19 | Patch available | GHSA-45pg-36p6-83v9 |
| — | langchain (PyPI) | before 0.2.0 | 0.2.0 | Patch available | GHSA-45pg-36p6-83v9 |
- langchain-ai/langchain Vendorlangchain-ai Affected before 0.3.0 Fixed in 0.3.0 Patch available CNA
- langchain-community (PyPI) Vendor— Affected 0.2.0 to before 0.2.19 Fixed in 0.2.19 Patch available GHSA-45pg-36p6-83v9
- langchain (PyPI) Vendor— Affected before 0.2.0 Fixed in 0.2.0 Patch available GHSA-45pg-36p6-83v9
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:langchain:langchain:0.2.5:*:*:*:*:*:*:* | 0.2.5 | Vulnerable | langchain-ai |
- cpe:2.3:a:langchain:langchain:0.2.5:*:*:*:*:*:*:* Versions 0.2.5 Vulnerable ·langchain-ai
Remediation
- Fix · CNA langchain-ai/langchain (langchain-ai) Fixed in 0.3.0
- Fix · GHSA-45pg-36p6-83v9 langchain-community (PyPI) Fixed in 0.2.19 Advisory →
- Fix · GHSA-45pg-36p6-83v9 langchain (PyPI) Fixed in 0.2.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
Not affected: 3 products
- OpenShift Lightspeed
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux AI (RHEL AI)
Timeline
- 2026-10-02 Threatist record created from CVE-2024-8309
- 2026-10-03 Alias added: GHSA-45pg-36p6-83v9
References
More langchain-ai Langchain vulnerabilities
- TI-2023-20724 An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20706 An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary… CVSS 3.1CRITICAL 9.8
- TI-2023-20166 An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20136 An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. CVSS 3.1CRITICAL 9.8
- TI-2023-18185 An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a… CVSS 3.1CRITICAL 9.8
- TI-2023-18176 An issue in LangChain before 0.0.236 allows an attacker to execute arbitrary code because… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2024-8309 · CVE Program
- CVE-2024-8309 · NVD
- FIRST EPSS
- GHSA-45pg-36p6-83v9 · GitHub Advisory Database · CC BY 4.0
- CVE-2024-8309 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences