CVE-2026-48121: @langchain/langgraph checkpoint mongodb LangGraph Has NoSQL Parameter Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-98xf-r82g-9mhx
CVSS 6.7
CWE-943
Published
Advisory Summary

CVE-2026-48121 is a MODERATE (CVSS 6.7) langgraph has nosql parameter injection vulnerability (CWE-943: Improper Neutralization of Special Elements in Data Query Logic) affecting @langchain/langgraph checkpoint mongodb libraries in the npm ecosystem. The issue involves langgraph has nosql parameter injection in mongodbsaver, allowing cross-tenant state access. Remediation is available by upgrading affected packages to version 1.3.1.

CVE-2026-48121 at a Glance

CVE Identifier CVE-2026-48121
GHSA Identifier GHSA-98xf-r82g-9mhx
Severity MODERATE
CVSS v3.1 Base Score 6.7
CWE Classification CWE-943: Improper Neutralization of Special Elements in Data Query Logic
Affected Product @langchain/langgraph checkpoint mongodb
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-48121

To remediate this vulnerability, upgrade all affected @langchain/langgraph checkpoint mongodb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@langchain/langgraph-checkpoint-mongodb fixed: 1.3.1
npm install @langchain/langgraph-checkpoint-mongodb@1.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @langchain/langgraph-checkpoint-mongodb

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-48121, inspect your project dependencies using npm:

npm ls @langchain/langgraph-checkpoint-mongodb

Analyze the terminal output to locate any version of @langchain/langgraph checkpoint mongodb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), your application is affected.

Note: The npm ls @langchain/langgraph-checkpoint-mongodb command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-943: Improper Neutralization of Special Elements in Data Query Logic, where 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. In @langchain/langgraph checkpoint mongodb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary 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-mongodb` with multi-tenant or user-isolated thread models. - Accept user-controlled values for `thread_id`, `checkpoint_ns`, or `checkpoint_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_id` from 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: ```ts 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

CVE-2026-48121 Affected @langchain/langgraph checkpoint mongodb Versions

1 component(s)
Fixed Versions:
1.3.1
Product / Package Ecosystem Affected Versions Fixed Version
@langchain/langgraph-checkpoint-mongodb
npm
< 1.3.1
1.3.1

References

Frequently Asked Questions

What is CVE-2026-48121?
CVE-2026-48121 is a security vulnerability in @langchain/langgraph checkpoint mongodb involving LangGraph has NoSQL parameter injection in MongoDBSaver, allowing cross-tenant state access under CWE-943: Improper Neutralization of Special Elements in Data Query Logic.
Which @langchain/langgraph checkpoint mongodb versions are affected?
Affected versions include releases prior to 1.3.1 across affected packages: @langchain/langgraph-checkpoint-mongodb.
What version fixes CVE-2026-48121?
Upgrading to 1.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @langchain/langgraph-checkpoint-mongodb affected?
Yes, @langchain/langgraph-checkpoint-mongodb is affected in releases prior to 1.3.1. Upgrade your dependency to 1.3.1 or later.
What is the CVSS score of CVE-2026-48121?
CVE-2026-48121 has a CVSS v3.1 base score of 6.7 (MODERATE) with vector string CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-48121?
CVE-2026-48121 is classified under 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.).
How can I check npm dependencies for CVE-2026-48121?
Run the dependency tree command: 'npm ls @langchain/langgraph-checkpoint-mongodb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-98xf-r82g-9mhx",
  "modified" : "2026-06-12T15:05:32Z",
  "published" : "2026-06-12T15:05:32Z",
  "aliases" : [ "CVE-2026-48121" ],
  "summary" : "LangGraph has NoSQL parameter injection in MongoDBSaver, allowing cross-tenant state access",
  "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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@langchain/langgraph-checkpoint-mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.3.0"
    }
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-943" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-12T15:05:32Z",
    "nvd_published_at" : null
  }
}