VDB

CVE-2024-7042

CVE-2024-7042 PUBLISHED CVSS 4.9 MEDIUM

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

Reported by @huntr_ai · Published October 29, 2024

@langchain/community is fixed in 0.3.3 (npm)

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
@langchain/communitynpm0.3.3
langchainPyPI0.3.1
kibana-8Chainguard8.16.1-r1
langchainjslangchain-ai0.3.1
langchain-ai/langchainjslangchain-ai0.3.1
langchainlangchain0.3.1

Risk scores

CVSS 3.0
4.9
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

Affected products

VendorProductVersions
langchain-ailangchain-ai/langchainjsunspecified
langchaincommunity0
chainguardkibana-80
langchain-ailangchain-ai/langchainjs*
langchain-ailangchainjs0

Timeline

  • Oct 29, 2024 CVE Published
  • Oct 29, 2024 Coalition ESS Score (10 in total, the first dated here)
  • Oct 29, 2024 PoC Published (2 in total, the first dated here)
  • Oct 30, 2024 EPSS Score (30 in total, the first dated here)
  • Mar 10, 2026 Security Advisory
  • Jun 17, 2026 CVE Updated

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-7042
vulnetix vdb fixes CVE-2024-7042

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-7042/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›