Vulnerability · Published Oct 29, 2024 · Assigned by @huntr_ai

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

Medium 4.9

In plain English

A medium-severity SQL injection in langchain-ai/langchainjs from langchain-ai. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 24% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.0)4.9Medium
Exploit odds (30 days)0.3%top 75.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
npm@langchain/community0.3.3GHSA-6m59-8fmv-m5f9

Affected products (as reported)

VendorProductVersions
langchain-ai langchain-ai/langchainjs unspecified – before 0.3.1

Weakness: CWE-89 · Vector: CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

References