PyPI: langchain-community

CVE-2024-5998

Safety vulnerability ID: SFTY-20240917-94943

Safety legacy ID: pyup.io-73298

Affected versions of the langchain package are vulnerable to Deserialization of Untrusted Data due to unsafe pickle deserialization in the FAISS vector store implementation. The FAISS.deserialize_from_bytes function directly deserializes pickle data without proper validation, allowing arbitrary Python objects to be reconstructed and executed during the deserialization process.

Created at: Nov 5, 2025Updated at: Nov 5, 2025

Overview

LangChain pickle deserialization of untrusted data

Advisory

Affected versions of the langchain package are vulnerable to Deserialization of Untrusted Data due to unsafe pickle deserialization in the FAISS vector store implementation. The FAISS.deserialize_from_bytes function directly deserializes pickle data without proper validation, allowing arbitrary Python objects to be reconstructed and executed during the deserialization process.

Affected Package

Affecting langchain-community package, versions
<0.2.4

Also affects

---

How to Fix

Upgrade
langchain-community
to
0.2.4
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