CVE-2023-39631: Langchain vulnerable to arbitrary code execution via the evaluate function in the numexpr library

langchain Updated 02 Oct 2025

Summary

01/09/2023
Yes i
Critical
9.8

CVE-2023-39631: Langchain vulnerable to arbitrary code execution via the evaluate function in the numexpr library. Affects langchain versions < 0.0.308. Fixed in 0.0.308. How to fix ↓

Also tracked for

The same CVE-2023-39631 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Langchain is an AI-powered blockchain platform that provides a framework for developing decentralized applications. It is available on PyPI and can be installed using the package manager pip. The vulnerability in Langchain version 0.0.245 allows a remote attacker to execute arbitrary code by exploiting the evaluate function in the numexpr library.

Vulnerability Detail

The vulnerability arises from an issue in the evaluate function of the numexpr library used by Langchain. A remote attacker can exploit this vulnerability to execute arbitrary code on the target system. This can lead to various consequences, including unauthorized access, data manipulation, and potential compromise of the entire blockchain network. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Latest published version: 1.4.7 as of 22 Oct 2026

pip install --upgrade "langchain==1.4.7"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.0.308

This is the first release that contains the fix.

pip install --upgrade "langchain==0.0.308"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to apply the security update provided by the Langchain developers to mitigate the risk of exploitation.

Conclusion

Langchain version 0.0.245 is vulnerable to arbitrary code execution due to a flaw in the evaluate function of the numexpr library. Users of Langchain are advised to update to the latest version that includes the necessary security patches. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for langchain →

Share this vulnerability

FAQ

Langchain is an AI-powered blockchain platform that enables the development of decentralized applications.

This vulnerability allows a remote attacker to execute arbitrary code on the target system, potentially leading to unauthorized access, data manipulation, and compromise of the blockchain network.

To fix this vulnerability, it is recommended to update Langchain to the latest version that includes a patched version of the numexpr library.

No, there is no known workaround for this vulnerability. It is essential to apply the security update provided by the Langchain developers.

This vulnerability is rated as CRITICAL with a CVSS score of 9.8.

Related vulnerabilities

Recent vulnerabilities recorded for langchain.

How To Fix

Latest published version: 1.4.7 as of 22 Oct 2026

pip install --upgrade "langchain==1.4.7"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.0.308

This is the first release that contains the fix.

pip install --upgrade "langchain==0.0.308"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback