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

> CVE-2024-7042: Prompt Injection in langchain-ai/langchainjs Leading to SQL Injection. CVSS 4.9 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2024-7042
Last updated: 2026-06-17T08:19:15Z

- Published: 2024-10-29 12:50 UTC · Updated: 2026-06-17 08:19 UTC · Assigner: @huntr\_ai
- CVSS: 4.9 (CVSS 3.1) · Severity: Medium · Vector: CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- EPSS: 0.31%, 24th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-89

## Description

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.

## Affected vendors and products

- langchain-ai: langchain-ai/langchainjs
- langchain-ai: langchainjs

## Tracked companies

- [LangChain (LangSmith)](https://rewindex.com/company/langchain-langsmith.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2024-7042)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2024-7042)
- [https://github.com/langchain-ai/langchainjs/commit/615b9d9ab30a2d23a2f95fb8d7acfdf4b41ad7a6](https://github.com/langchain-ai/langchainjs/commit/615b9d9ab30a2d23a2f95fb8d7acfdf4b41ad7a6)
- [https://huntr.com/bounties/b612defb-1104-4fff-9fef-001ab07c7b2d](https://huntr.com/bounties/b612defb-1104-4fff-9fef-001ab07c7b2d)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2024-7042 · Markdown: https://rewindex.com/cve/CVE-2024-7042.md · JSON: https://rewindex.com/api/v1/cves/CVE-2024-7042 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:11:39.736Z
