CVE-2024-46946 LangChain Experimental Eval Injection vulnerability

Critical 9.8 Published Updated

Attackers can execute arbitrary code via sympy.sympify in LLMSymbolicMathChain, requiring developers to upgrade the library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2024-46946?

CVE-2024-46946 is a critical code injection vulnerability in n/a, published on 19 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain allows attackers to execute arbitrary code through sympy.sympify (which uses eval) in LLMSymbolicMathChain. LLMSymbolicMathChain was introduced in fcccde406dd9e9b05fc9babcbeb9ff527b0ec0c6 (2023-10-05).

Weakness: CWE-20

Which versions are affected by CVE-2024-46946?

3 open source packages ship an affected version, including langchain-experimental. It affects 1 product.

PackageAffectedFixed in
langchain-experimental PyPIFrom 0.1.17 to 0.3.0None
langchain-experimental PyPIFrom 0.1.17 to 0.3.0None
langchain-experimental PyPIFrom 0.1.17 to 0.3.0None

Products include Langchain Langchain-Experimental.

How do I fix CVE-2024-46946?

No fix has been published for CVE-2024-46946 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-46946 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-46946 exists.

Sources

Also known as GHSA-p2qj-r53j-h3xj, PYSEC-2026-374.

Is CVE-2024-46946 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free