OSV 1.4.0 · github-reviewed · 修改于 2026-06-12 23:05
发布时间
2026-06-12 23:05
GitHub 审查时间
2026-06-12 23:05
NVD 发布时间
—
源文件
advisories/github-reviewed/2026/06/GHSA-98xf-r82g-9mhx/GHSA-98xf-r82g-9mhx.json
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.
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.
Applications are vulnerable if they:
@langchain/langgraph-checkpoint-mongodb with multi-tenant or user-isolated thread models.thread_id, checkpoint_ns, or checkpoint_id.app.invoke(), app.stream(), or direct saver methods without validation.Applications are generally not vulnerable if they:
thread_id from trusted URL params that remain strings.An attacker with control over configurable checkpoint identifiers could read checkpoint data outside their authorized thread boundary.
Potentially exposed data includes:
This is a confidentiality issue with cross-tenant data disclosure risk.
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.
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.
Upgrade to @langchain/[email protected] 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.