GHSA-98XF-R82G-9MHX
Vulnerability from github – Published: 2026-06-12 15:05 – Updated: 2026-06-12 15:05Summary
A NoSQL injection vulnerability existed in MongoDBSaver where checkpoint identifier fields from config.configurable were used in MongoDB queries without strict type enforcement. In vulnerable versions, attacker-controlled object payloads (for example MongoDB operators like $gt and $ne) could be interpreted as query operators instead of literal identifier values.
This could bypass intended thread scoping and return checkpoints from other tenants.
Attack surface
The vulnerable path was in MongoDBSaver.getTuple(), where thread_id, checkpoint_ns, and checkpoint_id were used in MongoDB find() queries. The same unvalidated values were then reused to fetch pending writes.
Applications were exposed when untrusted input was forwarded into config.configurable (for example, directly from request bodies or query parameters) without string coercion or schema validation.
Who is affected?
Applications are vulnerable if they:
- Use
@langchain/langgraph-checkpoint-mongodbwith multi-tenant or user-isolated thread models. - Accept user-controlled values for
thread_id,checkpoint_ns, orcheckpoint_id. - Pass those values into
app.invoke(),app.stream(), or direct saver methods without validation.
Applications are generally not vulnerable if they:
- Use server-issued identifiers only.
- Source
thread_idfrom trusted URL params that remain strings. - Enforce schema validation that rejects non-string identifier fields.
Impact
An attacker with control over configurable checkpoint identifiers could read checkpoint data outside their authorized thread boundary.
Potentially exposed data includes:
- Checkpoint state
- Metadata
- Pending writes
This is a confidentiality issue with cross-tenant data disclosure risk.
Exploit example
An attacker-controlled request can inject MongoDB operators:
graph = new StateGraph(...)
.compile({
checkpointer: new MongoDBSaver()
});
graph.invoke(..., {
configurable: {
"thread_id": { "$gt": "" },
"checkpoint_ns": { "$ne": null }
}
});
If this payload is forwarded into config.configurable, the resulting query may match checkpoints outside the intended tenant/thread scope.
Security hardening changes
Version 1.3.1 hardens @langchain/langgraph-checkpoint-mongodb by adding runtime validation for configurable checkpoint identifiers and rejecting invalid values before MongoDB query/write paths execute.
The patch also includes regression tests covering object/operator payloads across affected methods.
Migration guide
Upgrade to @langchain/langgraph-checkpoint-mongodb@1.3.1 or later.
No API migration is required for valid callers. However, applications that currently pass non-string identifier values in config.configurable will now receive explicit errors and should normalize/validate inputs.
As defense in depth, validate identifier fields at API boundaries and avoid passing raw client objects into graph config.
Resources
- Issue: https://github.com/langchain-ai/langgraphjs/issues/2351
- Fix PR: https://github.com/langchain-ai/langgraphjs/pull/2397
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.3.0"
},
"package": {
"ecosystem": "npm",
"name": "@langchain/langgraph-checkpoint-mongodb"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.3.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-48121"
],
"database_specific": {
"cwe_ids": [
"CWE-943"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-12T15:05:32Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nA NoSQL injection vulnerability existed in `MongoDBSaver` where checkpoint identifier fields from `config.configurable` were used in MongoDB queries without strict type enforcement. In vulnerable versions, attacker-controlled object payloads (for example MongoDB operators like `$gt` and `$ne`) could be interpreted as query operators instead of literal identifier values.\n\nThis could bypass intended thread scoping and return checkpoints from other tenants.\n\n## Attack surface\n\nThe vulnerable path was in `MongoDBSaver.getTuple()`, where `thread_id`, `checkpoint_ns`, and `checkpoint_id` were used in MongoDB `find()` queries. The same unvalidated values were then reused to fetch pending writes.\n\nApplications were exposed when untrusted input was forwarded into `config.configurable` (for example, directly from request bodies or query parameters) without string coercion or schema validation.\n\n## Who is affected?\n\nApplications are vulnerable if they:\n\n- Use `@langchain/langgraph-checkpoint-mongodb` with multi-tenant or user-isolated thread models.\n- Accept user-controlled values for `thread_id`, `checkpoint_ns`, or `checkpoint_id`.\n- Pass those values into `app.invoke()`, `app.stream()`, or direct saver methods without validation.\n\nApplications are generally not vulnerable if they:\n\n- Use server-issued identifiers only.\n- Source `thread_id` from trusted URL params that remain strings.\n- Enforce schema validation that rejects non-string identifier fields.\n\n## Impact\n\nAn attacker with control over configurable checkpoint identifiers could read checkpoint data outside their authorized thread boundary.\n\nPotentially exposed data includes:\n\n- Checkpoint state\n- Metadata\n- Pending writes\n\nThis is a confidentiality issue with cross-tenant data disclosure risk.\n\n## Exploit example\n\nAn attacker-controlled request can inject MongoDB operators:\n\n```ts\ngraph = new StateGraph(...)\n .compile({\n checkpointer: new MongoDBSaver()\n });\n\ngraph.invoke(..., {\n configurable: { \n \"thread_id\": { \"$gt\": \"\" },\n \"checkpoint_ns\": { \"$ne\": null }\n }\n});\n```\n\nIf this payload is forwarded into `config.configurable`, the resulting query may match checkpoints outside the intended tenant/thread scope.\n\n## Security hardening changes\n\nVersion `1.3.1` hardens `@langchain/langgraph-checkpoint-mongodb` by adding runtime validation for configurable checkpoint identifiers and rejecting invalid values before MongoDB query/write paths execute.\n\nThe patch also includes regression tests covering object/operator payloads across affected methods.\n\n## Migration guide\n\nUpgrade to `@langchain/langgraph-checkpoint-mongodb@1.3.1` or later.\n\nNo API migration is required for valid callers. However, applications that currently pass non-string identifier values in `config.configurable` will now receive explicit errors and should normalize/validate inputs.\n\nAs defense in depth, validate identifier fields at API boundaries and avoid passing raw client objects into graph config.\n\n## Resources\n\n- Issue: https://github.com/langchain-ai/langgraphjs/issues/2351\n- Fix PR: https://github.com/langchain-ai/langgraphjs/pull/2397",
"id": "GHSA-98xf-r82g-9mhx",
"modified": "2026-06-12T15:05:32Z",
"published": "2026-06-12T15:05:32Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/langchain-ai/langgraphjs/security/advisories/GHSA-98xf-r82g-9mhx"
},
{
"type": "WEB",
"url": "https://github.com/langchain-ai/langgraphjs/issues/2351"
},
{
"type": "WEB",
"url": "https://github.com/langchain-ai/langgraphjs/pull/2397"
},
{
"type": "WEB",
"url": "https://github.com/langchain-ai/langgraphjs/commit/284226c7ca164b3c81fe2d9e32b10f1fc6b99a3c"
},
{
"type": "PACKAGE",
"url": "https://github.com/langchain-ai/langgraphjs"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "LangGraph has NoSQL parameter injection in MongoDBSaver, allowing cross-tenant state access"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.