PyPI: langchain-experimental

CVE-2024-46946

Safety vulnerability ID: SFTY-20240919-33572

Safety legacy ID: pyup.io-73280

A vulnerability exists in langchain_experimental affected versions where the LLMSymbolicMathChain was introduced because it passes untrusted input directly to sympy.sympify, which uses eval() internally. This flaw allows attackers to execute arbitrary code via crafted mathematical expressions.

Created at: Apr 13, 2026Updated at: Apr 13, 2026

Overview

LangChain Experimental Eval Injection vulnerability

Advisory

A vulnerability exists in langchain_experimental affected versions where the LLMSymbolicMathChain was introduced because it passes untrusted input directly to sympy.sympify, which uses eval() internally. This flaw allows attackers to execute arbitrary code via crafted mathematical expressions.

Affected Package

Affecting langchain-experimental package, versions
>=0.1.17,<0.3.1

Also affects

---

How to Fix

Upgrade
langchain-experimental
to
0.3.1
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