Documented Incident · INC-2024-8309 · Elevated severity

LangChain GraphCypherQAChain Prompt Injection to Arbitrary Graph Queries

CVE-2024-8309 affected LangChain's GraphCypherQAChain component, where natural-language user questions or retrieved context could steer the LLM to emit arbitrary Cypher graph queries. Because the chain executed generated Cypher statements directly against Neo4j or compatible graph databases without stripping write clauses, attackers could perform unauthorized reads, schema modifications, or node deletions. Organizations exposing graph QA chatbots to untrusted users or external data faced direct database tampering risk. Maintainers added validation options and warnings, while safe deployments must enforce read-only database users and deterministic Cypher AST checks.

Incident dossier metadata

Case ID
INC-2024-8309
Classification
Incident
Date
Severity
Elevated
Sector
Enterprise Data & Analytics
Attack vector
Indirect Prompt Injection
System type
Natural-Language-to-Graph/SQL QA Agents
CVE / reference
CVE-2024-8309
Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2024-8309

Inspect INC-2024-8309 in Interactive Incidents & Cases Hub

Defensive takeaway

Disable write and schema-mutation clauses at the graph database driver level and enforce deterministic query-template validation before passing LLM output to Neo4j.

Mapped AI security techniques

Mapped defensive controls

Source citation records