---
title: "CVE-2024-21513: langchain-experimental vulnerable to Arbitrary Code Execution"
url: https://erroneo.us/security/cve/CVE-2024-21513/
description: "CVE-2024-21513 (langchain-experimental (PyPI)): Versions of the package langchain-experimental from 0.0.15 and before 0.0.21 are vulnerable to Arbitrary…"
type: vulnerability-record
section: "Security Digest"
date_published: 2024-07-15
date_modified: 2024-11-18
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2024-21513"
kev: false
cvss: 9.0
epss: 0.01893
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2024-21513: langchain-experimental vulnerable to Arbitrary Code Execution

**Signal:** Critical, preconditions apply. Severe if exploited, but exploitation needs conditions that may not apply to you. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 1.9% , percentile 79: FIRST’s model estimates a 1.9% chance of exploitation activity in the next 30 days, higher than 79% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Needs an account (low (any account)). Exposure depends on who can log in.
- Only applies if your dependency tree includes langchain-experimental (PyPI) >= 0, < 0.0.21, fixed in 0.0.21 . Check your lockfile, including transitive dependencies.

## What it is

Versions of the package langchain-experimental from 0.0.15 and before 0.0.21 are vulnerable to Arbitrary Code Execution when retrieving values from the database, the code will attempt to call 'eval' on all values. An attacker can exploit this vulnerability and execute arbitrary python code if they can control the input prompt and the server is configured with VectorSQLDatabaseChain. Notes: Impact on the Confidentiality, Integrity and Availability of the vulnerable component: Confidentiality: Code execution happens within the impacted component, in this case langchain-experimental, so all resources are necessarily accessible. Integrity: There is nothing protected by the impacted component inherently. Although anything returned from the component counts as 'information' for which the trustworthiness can be compromised. Availability: The loss of availability isn't caused by the attack itself, but it happens as a result during the attacker's post-exploitation steps. Impact on the Confidentiality, Integrity and Availability of the subsequent system: As a legitimate low-privileged user of the package (PR:L) the attacker does not have more access to data owned by the package as a result of this vulnerability than they did with normal usage (e.g. can query the DB). The unintended action that one can perform by breaking out of the app environment and exfiltrating files, making remote connections etc. happens during the post exploitation phase in the subsequent system - in this case, the OS. AT:P: An attacker needs to be able to influence the input prompt, whilst the server is configured with the VectorSQLDatabaseChain plugin.

## Affected packages

- PyPI `langchain-experimental` >= 0, < 0.0.21 → fixed: 0.0.21

## Affected products (CVE record)

- n/a langchain-experimental: 0.0.15 < 0.0.21

## Severity

- snyk CVSS 3.1: 8.5 `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H/E:P`
- GitHub CVSS 4.0: 9.0 `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable no , technical impact total .
- FIRST EPSS (model of 2026-10-21): 1.89% probability of exploitation activity in the next 30 days; percentile 79.

## Sources

- [GitHub Advisory GHSA-cgcg-p68q-3w7v](https://github.com/advisories/GHSA-cgcg-p68q-3w7v)
- [CVE.org record CVE-2024-21513](https://www.cve.org/CVERecord?id=CVE-2024-21513)
- [NVD entry CVE-2024-21513](https://nvd.nist.gov/vuln/detail/CVE-2024-21513)
- [security.snyk.io](https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAINEXPERIMENTAL-7278171)
- [github.com](https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py%23L81)
- [github.com](https://github.com/langchain-ai/langchain/commit/7b13292e3544b2f5f2bfb8a27a062ea2b0c34561)
- [github.com](https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py#L81)
- [github.com](https://github.com/pypa/advisory-database/tree/main/vulns/langchain-experimental/PYSEC-2024-62.yaml)

---
Source page: https://erroneo.us/security/cve/CVE-2024-21513/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
