CVE-2024-7042CWE-89

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

Medium · published October 29, 2024

CVSS v3.0
4.9
EPSS
0%
Percentile
22.8
In the wild
Unconfirmed
What it is

⚠️ A sneaky prompt injection in the GraphCypherQAChain class could turn your data security into a game of Jenga! 🌪️ Think of it like a restaurant where the chef accepts any order without checking if the patron is even allowed to make changes — that’s how attackers can manipulate your database without a second glance. It’s a recipe for disaster when anyone can add, alter, or remove ingredients from the menu! An attacker could exploit this vulnerability to create, update, or delete nodes and relationships without proper authorization. This means they could access sensitive data, disrupt services, or even delete all of the data, potentially bringing your entire application to a halt. The impact could be devastating in multi-tenant environments, where data integrity and security are already at risk!

Put simply

Think of it like a restaurant where the chef accepts any order without checking if the patron is even allowed to make changes — that’s how attackers can manipulate your database without a second glance. It’s a recipe for disaster when anyone can add, alter, or remove ingredients from the menu! The vulnerability in langchain-ai/langchainjs versions 0.2.5 and earlier allows prompt injection that leads to SQL injection, enabling unauthorized users to manipulate the database. This includes creating or deleting data, which can severely compromise security and integrity.

What to do

An attacker could exploit this vulnerability to create, update, or delete nodes and relationships without proper authorization. This means they could access sensitive data, disrupt services, or even delete all of the data, potentially bringing your entire application to a halt. The impact could be devastating in multi-tenant environments, where data integrity and security are already at risk! To mitigate this vulnerability, update to the latest version of langchainjs where this issue has been fixed. Implement input validation and sanitization to prevent unauthorized data manipulations. Regularly audit your application’s access controls to tighten security in multi-tenant environments. You've got this! With these steps, you can fortify your application and safeguard your data. 🛡️

The record
Technical detail
CVSS v3.0
4.9 · MEDIUM
Vector
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
CVSS v4.0
Not supplied
EPSS
0.00311 · 22.8th percentile
Weakness
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Published
2024-10-29T12:50Z
EPSS history
Timeline
  • 29 OCT 12:50Z
    Prompt Injection in langchain-ai/langchainjs Leading to SQL Injection
    cvelistv5