CVE-2024-8309 is a SQL injection vulnerability affecting the GraphCypherQAChain class in langchain-ai/langchain. The provided context states that langchain version 0.2.5 is vulnerable and that exploitation occurs through prompt injection, where attacker-controlled input influences query generation. As a result, the chain can be induced to generate and execute unauthorized database operations. The issue can permit creation, modification, or deletion of nodes and relationships, extraction of sensitive data, and execution of destructive queries against the backing data store. The vulnerability is especially significant in environments where LLM-generated queries are executed with broad database privileges or where multiple tenants share the same database context.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a Proof of Concept (PoC) for CVE-2024-8309, a prompt injection vulnerability in Langchain's GraphCypherQAChain that allows for Cypher (Neo4j) injection. The repository is structured as a three-component demo: 1. **Neo4j Database**: Runs in a Docker container, accessible at http://localhost:7474 and via the Bolt protocol at bolt://neo4j:7687. 2. **Backend (FastAPI)**: Python service (backend/main.py) exposes endpoints for ingesting data, querying the graph, and counting entities. It uses Langchain to interface with the Neo4j database and is vulnerable to prompt injection via the /query/ endpoint. 3. **Frontend (Streamlit)**: Python app (frontend/app.py) provides a chat-like interface for users to interact with the backend. User input is sent to the backend, which passes it to the LLM and then executes the resulting Cypher query on the Neo4j database. The exploit demonstrates that a user can craft prompts (e.g., 'delete all entities') that result in arbitrary Cypher queries being executed, including destructive operations like deleting all nodes. The README provides setup instructions, example payloads, and endpoint details. The repository includes Dockerfiles for both backend and frontend, a docker-compose.yml for orchestration, and requirements files for dependencies. The main entry points are backend/main.py (FastAPI app) and frontend/app.py (Streamlit app). The exploit is a functional PoC and not a detection script.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
2 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.