File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
libs/core/langchain_core/load Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1- """Load LangChain objects from JSON strings or objects."""
1+ """Load LangChain objects from JSON strings or objects.
2+
3+ !!! warning
4+ `load` and `loads` are vulnerable to remote code execution. Never use with untrusted
5+ input.
6+ """
27
38import importlib
49import json
@@ -193,6 +198,10 @@ def loads(
193198) -> Any :
194199 """Revive a LangChain class from a JSON string.
195200
201+ !!! warning
202+ This function is vulnerable to remote code execution. Never use with untrusted
203+ input.
204+
196205 Equivalent to `load(json.loads(text))`.
197206
198207 Args:
@@ -236,6 +245,10 @@ def load(
236245) -> Any :
237246 """Revive a LangChain class from a JSON object.
238247
248+ !!! warning
249+ This function is vulnerable to remote code execution. Never use with untrusted
250+ input.
251+
239252 Use this if you already have a parsed JSON object,
240253 eg. from `json.load` or `orjson.loads`.
241254
You can’t perform that action at this time.
0 commit comments