CVE-2024-7042
JSON

4.9medium

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

Severity
4.9medium CVSS:3.0 by @huntr_ai
Exploit likelihood
0.31% (higher than 25% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
@huntr_ai
Also known as
GHSA-6m59-8fmv-m5f9

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

Product or packageVersionsReported by
langchain-ai langchain-ai/langchainjsfrom unspecified before 0.3.1CVE List
langchain-ai langchainjsbefore 0.3.1CVE List
@langchain/community (npm)before 0.3.3GitHub Advisory Database
langchain langchainbefore 0.3.1NVD

All scores

@huntr_ai4.9medium CVSS:3.0CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
GitHub4.9low CVSS:3.0CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
GitHublow CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Una vulnerabilidad en la clase GraphCypherQAChain de langchain-ai/langchainjs versiones 0.2.5 y todas las versiones con esta clase permite la inyección rápida, lo que lleva a la inyección SQL. Esta vulnerabilidad permite la manipulación no autorizada de datos, la exfiltración de datos, la denegación de servicio (DoS) mediante la eliminación de todos los datos, las infracciones en entornos de seguridad de múltiples tenants y los problemas de integridad de los datos. Los atacantes pueden crear, actualizar o eliminar nodos y relaciones sin la autorización adecuada, extraer datos confidenciales, interrumpir servicios, acceder a datos en diferentes tenants y comprometer la integridad de la base de datos.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-7042 changed 2025-10-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-6m59-8fmv-m5f9 changed 2026-08-07CC-BY-4.0
NVDCVE-2024-7042 changed 2026-06-17Public domain