Unencoded identifiers can redirect LangGraph SDK requests to unintended API endpoints
Description
Impact
@langchain/langgraph-sdk did not safely encode caller-supplied identifiers before including them in some API request paths. An application that passed an untrusted identifier into an affected SDK method could allow a user to redirect an authenticated request to another endpoint on the configured API host.
The redirected request retained the HTTP method and authentication configured by the application. Depending on the affected method and the endpoints available on that host, this could allow unauthorized access to data or unintended modification or deletion of resources.
Exploitation requires an application to pass an attacker-controlled identifier into an SDK method without validating that it is an identifier issued by the intended LangGraph deployment. Applications that use identifiers only from trusted application records are not affected by this path.
Patches
The issue is fixed in @langchain/langgraph-sdk version 1.12.2.
Starting with version 1.12.2, callers should pass raw identifiers rather than pre-encoded values because the SDK now encodes identifiers before including them in request paths. An identifier that is exactly . or .. is rejected with an Invalid path segment error.
Workarounds
If an immediate upgrade is not possible:
- Accept only identifiers issued by the LangGraph API or retrieved from trusted application records.
- Do not pass arbitrary user input directly as a thread, assistant, run, cron, checkpoint, or subgraph identifier.
- Encode dynamic identifiers as individual URL path segments in any application-defined URL construction.
Upgrading to a patched version is recommended.