PyPI: langchain-core

CVE-2026-44843

Safety vulnerability ID: SFTY-20260508-09576

Safety legacy ID: pyup.io-96806

Affected versions of the langchain-core package are vulnerable to Unsafe Deserialisation due to runtime code paths that call load() with allowed_objects="all", permitting any trusted LangChain-serialisable object to be revived from attacker-controlled input. Affected API surfaces include RunnableWithMessageHistory, astream_log(), and astream_events(version="v1"), where attacker-supplied nested dictionaries preserved in run inputs or outputs are deserialised without adequate restriction. An attacker who can submit untrusted structured input to an affected application can inject LangChain serialised constructor payloads to instantiate classes with untrusted constructor arguments.

Created at: May 11, 2026Updated at: May 11, 2026

Overview

LangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlists

Advisory

Affected versions of the langchain-core package are vulnerable to Unsafe Deserialisation due to runtime code paths that call load() with allowed_objects="all", permitting any trusted LangChain-serialisable object to be revived from attacker-controlled input. Affected API surfaces include RunnableWithMessageHistory, astream_log(), and astream_events(version="v1"), where attacker-supplied nested dictionaries preserved in run inputs or outputs are deserialised without adequate restriction. An attacker who can submit untrusted structured input to an affected application can inject LangChain serialised constructor payloads to instantiate classes with untrusted constructor arguments.

Affected Package

Affecting langchain-core package, versions
>=1.0.0,<=1.3.2

Also affects

---

How to Fix

Upgrade
langchain-core
to
1.3.3
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more