CVE-2024-7042

Prompt Injection in langchain-ai/langchainjs Leading to SQL Injection

State
Published
Severity
4.9 Medium
Published
Oct 29, 2024
Updated
Oct 15, 2025
Reserved
Jul 23, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.04.9 MediumCVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L@huntr_ai

Weaknesses

  • CWE-89 Improper Neutralization of Special Elements used in an SQL Command

Affected Products

ProductVersions
langchain-ai/langchainjslangchain-ai
  • before 0.3.1Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.