CVE-2024-46946
Python vulnerability analysis and mitigation

Overview

A remote code execution vulnerability has been identified in langchain_experimental (aka LangChain Experimental) versions 0.1.17 through 0.3.0. The vulnerability exists in the LLMSymbolicMathChain component, which was introduced on October 5, 2023, in commit fcccde406dd9e9b05fc9babcbeb9ff527b0ec0c6. The vulnerability allows attackers to execute arbitrary code through sympy.sympify, which internally uses Python's eval() function (NVD, GitHub POC).

Technical details

The vulnerability stems from the use of sympy.sympify() function in the LLMSymbolicMathChain component to evaluate mathematical expressions without proper input sanitization. The function internally uses Python's eval() function for expression evaluation, which can lead to arbitrary code execution if not properly restricted. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 CRITICAL (Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) (NVD).

Impact

An attacker who can control the input to SymbolicMathChain could potentially execute arbitrary code on the system running the LangChain application. This could lead to full system compromise, allowing attackers to execute unauthorized commands with the privileges of the application running the vulnerable code (GitHub POC).

Mitigation and workarounds

It is recommended to implement strict input validation and sanitization before passing any user-controlled input to sympy.sympify(). Organizations should consider using a whitelist of allowed mathematical operations and symbols, or explore alternative methods for safe mathematical expression evaluation. Users should upgrade to a version newer than 0.3.0 when available (GitHub POC).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22871HIGH8.7
  • PythonPython
  • guarddog
NoYesJan 13, 2026
GHSA-58pv-8j8x-9vj2HIGH8.6
  • PythonPython
  • jaraco.context
NoYesJan 13, 2026
CVE-2026-22779MEDIUM6.3
  • PythonPython
  • blacksheep
NoYesJan 14, 2026
CVE-2026-21889LOW2.3
  • PythonPython
  • weblate
NoYesJan 14, 2026
CVE-2025-68492LOW2.3
  • PythonPython
  • chainlit
NoYesJan 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management