---
id: "CVE-2024-46946"
kind: "vulnerability"
aliases: ["CVE-2024-46946", "GHSA-p2qj-r53j-h3xj"]
title: "LangChain Experimental Eval Injection vulnerability"
severity: "critical"
cvss: 9.8
epss: 0.01387
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "langchain-experimental", "fixed": [], "affected": ">= 0.1.17, <= 0.3.0", "ecosystem": "pypi"}, {"name": "langchain langchain-experimental", "fixed": [], "affected": ">= 0.1.17, <= 0.3.0", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-apps", "ai-tooling", "cwe-95", "langchain", "llm-pipelines", "python"]
not_affected_if: ["chain-not-used", "pinned-outside-range"]
published_at: "2024-09-19T05:15:11+00:00"
first_seen_at: "2026-10-27T16:56:21+00:00"
updated_at: "2026-10-27T17:03:04+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-p2qj-r53j-h3xj", "first_seen_at": "2026-10-27T16:56:21+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-46946", "first_seen_at": "2026-10-27T17:03:04+00:00"}]
---

# LangChain Experimental Eval Injection vulnerability

LangChain Experimental versions 0.1.17 through 0.3.0 pass model-generated text to sympy.sympify, which uses eval, inside LLMSymbolicMathChain. An attacker who can steer the model's input can execute arbitrary Python code on the server running the chain.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:langchain-experimental affected >= 0.1.17, <= 0.3.0 fixed ?
- vendor:langchain langchain-experimental affected >= 0.1.17, <= 0.3.0 fixed ?

## How to check

- Run `pip show langchain-experimental` and check whether the version is between `0.1.17` and `0.3.0`
- Search the codebase for `LLMSymbolicMathChain` to see whether the chain is used at all

## Fix

- Upgrade `langchain-experimental` to a version newer than `0.3.0` (the sources do not name the exact fixed version; check the GHSA page)
- Remove or disable `LLMSymbolicMathChain` if it is not needed

## Timeline

- 2026-10-27T16:56:21+00:00 ghsa https://github.com/advisories/GHSA-p2qj-r53j-h3xj
- 2026-10-27T17:03:04+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-46946

## From the sources

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).

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
