Skip to content

fix(checkpoint): specify allowed_objects in Reviver - #7743

Merged
ccurme (ccurme) merged 2 commits into
mainfrom
cc/reviver_allowed_objects
May 8, 2026
Merged

ccurme (ccurme) merged 2 commits into
mainfrom
cc/reviver_allowed_objects

Conversation

@ccurme

Copy link
Copy Markdown
Contributor

On langchain-core / master you will see warnings from importing things like

from langgraph.checkpoint.memory import InMemorySaver

or

from langgraph.types import Command

LangChainPendingDeprecationWarning: The default value of allowed_objects will change in a future version. Pass an explicit value (e.g., allowed_objects='messages' or allowed_objects='core') to suppress this warning.
from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer

Here we address the warning.

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Issues

  • Deserialization of Untrusted Data — Unrestricted lc:1 Object Revival (Medium Confidence)
    The change sets LC_REVIVER = Reviver(allowed_objects="all"), which removes object-level allowlist restrictions from the langchain_core Reviver used as a fallback in JsonPlusSerializer._reviver(). This Reviver handles lc:1-format JSON payloads (the older LangChain serialization format) and is reached for every JSON object that is not an lc:2 constructor. With allowed_objects="all", any class registered in langchain_core's serializable namespace can be instantiated from legacy lc:1 checkpoint data without restriction. While lc:2 constructor revival is still gated by _revive_lc2/_check_allowed_json_modules, the lc:1 path through LC_REVIVER is fully open. If an attacker can write or influence persisted checkpoint data containing lc:1-format payloads — for example via a database write, an API that accepts checkpoint blobs, or a compromised upstream service — they may be able to instantiate arbitrary registered LangChain objects on deserialization.

Recommendations

  • Revert to Reviver() (without allowed_objects="all") to restore object-level allowlist enforcement on lc:1 payloads. If the intent is to support a broader set of legacy types, enumerate them explicitly rather than using the blanket "all" value. Confirm which specific types triggered the change (e.g., a regression) and add them to the SAFE_MSGPACK_TYPES / allowed_json_modules path instead.

Comment thread libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py
)

LC_REVIVER = Reviver()
LC_REVIVER = Reviver(allowed_objects="core")

@ccurme ccurme (ccurme) May 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has defaulted to "core" since late December: langchain-ai/langchain#34455

Comment thread libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py
@ccurme
ccurme (ccurme) merged commit dc0d992 into main May 8, 2026
67 checks passed
@ccurme
ccurme (ccurme) deleted the cc/reviver_allowed_objects branch May 8, 2026 19:08
Yijia Xiao (Yijia-Xiao) added a commit to TauricResearch/TradingAgents that referenced this pull request May 10, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
SpaceRexxx pushed a commit to SpaceRexxx/TradingAgents-WebUI that referenced this pull request May 11, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
helm168 pushed a commit to helm168/TradingAgents that referenced this pull request May 19, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
Vijay Rajagopal (virajago) pushed a commit to virajago/conviction that referenced this pull request May 24, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
H (GearlessJoeL) pushed a commit to GearlessJoeL/TradingReportAgents that referenced this pull request May 26, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
SpookyFox9 pushed a commit to SpookyFox9/TradingAgents that referenced this pull request May 30, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
shao1237 pushed a commit to shao1237/TradingAgent that referenced this pull request Jul 7, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
tclikang pushed a commit to tclikang/TradingAgents that referenced this pull request Aug 30, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
Q1anye (lovits) pushed a commit to lovits/FINAgents that referenced this pull request Sep 7, 2026
langgraph-checkpoint 4.0.3 calls Reviver() at module load without
allowed_objects, printing a pending-deprecation warning at every
CLI start. The upstream patch is merged
(langchain-ai/langgraph#7743) but not released; no app-side seam
fixes it. Install a surgical filter in package init (message regex
+ PendingDeprecationWarning category). Remove when we bump past
langgraph-checkpoint 4.0.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants