# CVE-2024-7042: Prompt Injection in langchain-ai/langchainjs Leading to SQL Injection

- Priority: **Routine**
- Reason: Not severe (CVSS 4.9, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-10-29 · Modified: 2025-10-15
- Aliases: GHSA-6m59-8fmv-m5f9
- Record: https://cvemate.com/vulnerability/CVE-2024-7042 · JSON: https://cvemate.com/vulnerability/CVE-2024-7042/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.311%, percentile 25.848%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (reference)

## Affected

- langchain-ai langchain-ai/langchainjs: ≥ unspecified, \< 0.3.1
- langchain langchain: \< 0.3.1
- @langchain community (Npm): \< 0.3.3

## References

- <https://huntr.com/bounties/b612defb-1104-4fff-9fef-001ab07c7b2d>
- <https://github.com/langchain-ai/langchainjs/commit/615b9d9ab30a2d23a2f95fb8d7acfdf4b41ad7a6>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-7042>
- <https://github.com/langchain-ai/langchainjs>
- <https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-114.yaml>

---

Data as of 2026-12-05T12:51:54.103Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
