CVE-2026-48121: LangGraph MongoDB: NoSQL injection leaks tenant checkpoints
GHSA-98xf-r82g-9mhx MEDIUMA NoSQL injection flaw in `@langchain/langgraph-checkpoint-mongodb` (≤1.3.0) allows attackers to bypass multi-tenant isolation by injecting MongoDB query operators — such as `$gt` or `$ne` — into checkpoint identifier fields that flow unvalidated into database queries. With 3,296 downstream npm dependents, any multi-tenant LangGraph JS application that passes user-controlled values into `config.configurable` (thread_id, checkpoint_ns, checkpoint_id) without prior string coercion is exposed to cross-tenant checkpoint state disclosure, including agent conversation history, metadata, and pending writes. No public exploit code exists and EPSS data is unavailable, but the attack pattern is trivial to execute against any affected endpoint — an attacker needs only to supply a JSON object with MongoDB operators where a string identifier is expected. Upgrade immediately to `@langchain/langgraph-checkpoint-mongodb@1.3.1`, which adds runtime validation rejecting non-string identifiers before any query path executes.
What is the risk?
CVSS 6.7 Medium with an Adjacent attack vector reduces headline severity, but real-world exposure depends entirely on deployment topology. In cloud-hosted multi-tenant agent platforms where API consumers can influence graph invocation parameters, the effective risk is HIGH — an authenticated but low-privileged user can read another tenant's checkpoint state with a single crafted request. The low attack complexity and absence of any exploit barrier (no tooling required, operator payloads are trivial JSON) elevate practical risk above the CVSS score suggests. Applications using exclusively server-generated thread identifiers are not affected. Applications sourcing identifiers from request bodies or query parameters without schema validation are immediately exposed.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| LangGraph | npm | <= 1.3.0 | 1.3.1 |
Do you use LangGraph? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Patch immediately: Upgrade to
@langchain/langgraph-checkpoint-mongodb@1.3.1— the patch adds runtime validation rejecting non-string checkpoint identifier values before query execution. No API changes are required for valid callers. -
Input validation at API boundaries: Enforce strict string type validation on
thread_id,checkpoint_ns, andcheckpoint_idbefore passing values intoconfig.configurable. Reject requests containing objects or arrays for these fields. -
Schema enforcement: Add JSON schema or Zod validation middleware to reject non-primitive identifier fields at the route handler level, before values reach LangGraph invocation.
-
Audit existing logs: Review application logs for requests where identifier fields contained JSON objects — this pattern indicates prior exploitation attempts.
-
Workaround if patching is delayed: Coerce all configurable identifier fields to strings (
String(value)) at the point where user input entersconfig.configurable. -
Detection: Alert on MongoDB queries containing operator keys (
$gt,$ne,$regex, etc.) in fields expected to hold string identifiers.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-48121?
A NoSQL injection flaw in `@langchain/langgraph-checkpoint-mongodb` (≤1.3.0) allows attackers to bypass multi-tenant isolation by injecting MongoDB query operators — such as `$gt` or `$ne` — into checkpoint identifier fields that flow unvalidated into database queries. With 3,296 downstream npm dependents, any multi-tenant LangGraph JS application that passes user-controlled values into `config.configurable` (thread_id, checkpoint_ns, checkpoint_id) without prior string coercion is exposed to cross-tenant checkpoint state disclosure, including agent conversation history, metadata, and pending writes. No public exploit code exists and EPSS data is unavailable, but the attack pattern is trivial to execute against any affected endpoint — an attacker needs only to supply a JSON object with MongoDB operators where a string identifier is expected. Upgrade immediately to `@langchain/langgraph-checkpoint-mongodb@1.3.1`, which adds runtime validation rejecting non-string identifiers before any query path executes.
Is CVE-2026-48121 actively exploited?
No confirmed active exploitation of CVE-2026-48121 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-48121?
1. Patch immediately: Upgrade to `@langchain/langgraph-checkpoint-mongodb@1.3.1` — the patch adds runtime validation rejecting non-string checkpoint identifier values before query execution. No API changes are required for valid callers. 2. Input validation at API boundaries: Enforce strict string type validation on `thread_id`, `checkpoint_ns`, and `checkpoint_id` before passing values into `config.configurable`. Reject requests containing objects or arrays for these fields. 3. Schema enforcement: Add JSON schema or Zod validation middleware to reject non-primitive identifier fields at the route handler level, before values reach LangGraph invocation. 4. Audit existing logs: Review application logs for requests where identifier fields contained JSON objects — this pattern indicates prior exploitation attempts. 5. Workaround if patching is delayed: Coerce all configurable identifier fields to strings (`String(value)`) at the point where user input enters `config.configurable`. 6. Detection: Alert on MongoDB queries containing operator keys (`$gt`, `$ne`, `$regex`, etc.) in fields expected to hold string identifiers.
What systems are affected by CVE-2026-48121?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, stateful multi-tenant AI agents, LangGraph JS applications with MongoDB persistence, multi-tenant LLM chat applications.
What is the CVSS score for CVE-2026-48121?
CVE-2026-48121 has a CVSS v3.1 base score of 6.7 (MEDIUM). The EPSS exploitation probability is 0.23%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0036 Data from Information Repositories AML.T0049 Exploit Public-Facing Application AML.T0080 AI Agent Context Poisoning Compliance Controls Affected
What are the technical details?
Original Advisory
@langchain/langgraph-checkpoint-mongodb provides a LangGraph.js CheckpointSaver implementation that uses MongoDB for storage. Versions 1.3.0 and below are vulnerable to NoSQL injection: checkpoint identifiers (thread_id, checkpoint_ns, checkpoint_id) from config.configurable are passed into MongoDB find() queries in MongoDBSaver.getTuple() without type enforcement. If an attacker supplies an object payload (such as MongoDB operators $gt or $ne) instead of a string, it can be interpreted as a query operator, bypassing thread scoping and leaking checkpoints, including pending writes, across tenants. Applications are at risk if they forward untrusted input into config.configurable without coercing it to strings or validating it against a schema, particularly in multi-tenant or user-isolated setups. Apps that only use server-issued, string-typed identifiers with schema validation rejecting non-string fields are not affected. This issue has been fixed in version 1.3.1.
Exploitation Scenario
An attacker registered as a standard user on a multi-tenant LangGraph-based AI agent platform crafts an API request to the agent invocation endpoint. Instead of passing a valid string `thread_id`, they supply a JSON body with `{"thread_id": {"$gt": ""}, "checkpoint_ns": {"$ne": null}}`. The backend forwards this payload directly into `config.configurable` without type coercion. `MongoDBSaver.getTuple()` constructs a `find()` query using these operator payloads, causing MongoDB to return the first matching checkpoint across all tenants rather than the attacker's scoped thread. The attacker receives another user's full agent checkpoint state — including conversation history, intermediate tool results, and any sensitive data embedded in the state graph — with no privilege escalation required beyond their existing authenticated session.
Weaknesses (CWE)
CWE-943 Improper Neutralization of Special Elements in Data Query Logic
Primary
CWE-943 Improper Neutralization of Special Elements in Data Query Logic
Primary
CWE-943 Improper Neutralization of Special Elements in Data Query Logic CWE-943 — Improper Neutralization of Special Elements in Data Query Logic: The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N References
Timeline
Related Vulnerabilities
CVE-2025-64104 7.3 langgraph-checkpoint-sqlite: SQL Injection exposes database
Same package: langgraph CVE-2025-67644 7.3 langgraph-checkpoint-sqlite: SQL Injection exposes database
Same package: langgraph CVE-2025-8709 7.3 langgraph-checkpoint-sqlite: SQL Injection exposes database
Same package: langgraph CVE-2026-28277 6.8 langgraph: Deserialization enables RCE
Same package: langgraph CVE-2026-48775 6.8 LangGraph SQLite: deserialization RCE at checkpoint load
Same package: langgraph