Medium

langchainjs

Prompt Injection Leading to SQL Injection in GraphCypherQAChain Class

A vulnerability in the GraphCypherQAChain class of version 0.2.5 and all versions with this class allows prompt injection leading to SQL injection. This issue was patched in a later version.

Available publicly on Sep 26 2024

4.9

CVSS:

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

Credit:

liadlevy
Threat Overview

The vulnerability arises from the ability of users to control input, which can be manipulated to inject malicious Cypher queries into the Neo4j database. This can lead to unauthorized data manipulation, data exfiltration, denial of service (DoS), 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.

Attack Scenario

An attacker could exploit this vulnerability by crafting a malicious input that injects a Cypher query. For example, they could input a query that deletes all nodes in the database, leading to a denial of service. Alternatively, they could extract sensitive data by querying nodes and relationships they should not have access to.

Who is affected

Users and administrators of applications using the GraphCypherQAChain class in version 0.2.5 and all versions with this class are affected. This includes multi-tenant environments where data integrity and security are critical.

Technical Report
Want more out of Sightline?

Sightline offers even more for premium customers

Go Premium

We have - related security advisories that are available with Sightline Premium.