CVE-2024-7042
Prompt Injection in langchain-ai/langchainjs Leading to SQL Injection
Reported by @huntr_ai · Published October 29, 2024
@langchain/community is fixed in 0.3.3 (npm)
A vulnerability in the GraphCypherQAChain class of langchain-ai/langchainjs versions 0.2.5 and all versions with this class allows for prompt injection, leading to SQL injection. This vulnerability permits 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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| @langchain/community | npm | 0.3.3 |
| langchain | PyPI | 0.3.1 |
| kibana-8 | Chainguard | 8.16.1-r1 |
| langchainjs | langchain-ai | 0.3.1 |
| langchain-ai/langchainjs | langchain-ai | 0.3.1 |
| langchain | langchain | 0.3.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| langchain-ai | langchain-ai/langchainjs | unspecified |
| langchain | community | 0 |
| chainguard | kibana-8 | 0 |
| langchain-ai | langchain-ai/langchainjs | * |
| langchain-ai | langchainjs | 0 |
Timeline
- Oct 29, 2024 CVE Published
- Oct 29, 2024 Coalition ESS Score (10 in total, the first dated here)
- Oct 29, 2024 PoC Published (2 in total, the first dated here)
- Oct 30, 2024 EPSS Score (30 in total, the first dated here)
- Mar 10, 2026 Security Advisory
- Jun 17, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-7042
vulnetix vdb fixes CVE-2024-7042
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-7042/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart