CVE-2023-39631
Python vulnerability analysis and mitigation

Overview

An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary code via the evaluate function in the numexpr library. The vulnerability was discovered in July 2023 and was assigned CVE-2023-39631. The vulnerability affects the LLMMathChain component of Langchain, which uses the numexpr library's evaluate function for numerical expression evaluation (Langchain Issue, Numexpr Issue).

Technical details

The vulnerability stems from the unsafe use of the numexpr library's evaluate function, which internally uses Python's eval() function. The evaluate function in numexpr does not properly sanitize user input before evaluation, allowing arbitrary Python code execution. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 CRITICAL with a vector string of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, indicating the highest severity level (NVD).

Impact

The vulnerability allows remote attackers to execute arbitrary code on the target system. This could lead to complete system compromise, as attackers can run commands with the same privileges as the application running Langchain. The high CVSS score reflects the critical nature of the vulnerability, with potential impacts including unauthorized access, data theft, and system manipulation (NVD).

Mitigation and workarounds

Users should upgrade from Langchain v.0.0.245 to a patched version. If upgrading is not immediately possible, it is recommended to avoid using the LLMMathChain component or strictly validate and sanitize any input before passing it to the chain (Langchain Issue).

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-2025-66645HIGH7.5
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-66470MEDIUM6.1
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-66469MEDIUM6.1
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-67502MEDIUM5.4
  • PythonPython
  • taguette
NoYesDec 09, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 09, 2025

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