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

- Severity: Medium 4.9 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 25% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-10-29T12:50:05.375Z
- Modified: 2026-08-07T08:12:12.018Z
- Also known as: GHSA-6m59-8fmv-m5f9
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- langchain-ai langchain-ai/langchainjs: from unspecified before 0.3.1
- langchain-ai langchainjs: before 0.3.1
- @langchain/community (npm): before 0.3.3
- langchain langchain: before 0.3.1

## Every score

- @huntr_ai: CVSS:3.0 4.9 Medium `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:3.0 4.9 Low `CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

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

## Sources

- CVE List: [CVE-2024-7042](https://www.cve.org/CVERecord?id=CVE-2024-7042), CVE Terms of Use, modified 2025-10-15
- GitHub Advisory Database: [GHSA-6m59-8fmv-m5f9](https://github.com/advisories/GHSA-6m59-8fmv-m5f9), CC-BY-4.0, modified 2026-08-07
- NVD: [CVE-2024-7042](https://nvd.nist.gov/vuln/detail/CVE-2024-7042), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-7042 · Whole record: https://cve.day/CVE-2024-7042.json · Rebuilt by cve.day 2026-11-25T22:58:47.484Z
