CVE-2024-21513
langchain-experimental vulnerable to Arbitrary Code Execution
Also known as GHSA-cgcg-p68q-3w7v, PYSEC-2024-62
Mitigation
- Upgrade langchain-experimental to 0.0.21 or later.
Who should check
- Projects that depend on PyPI package langchain-experimental (< 0.0.21)
- Anyone running langchain-experimental >= 0.0.15, < 0.0.21
Vulnerability facts
- Affected
- langchain-experimental < 0.0.21
- Fixed in
- 0.0.21
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, login needed
- CVSS
- 8.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H/E:POpen in CVSS calculator
Show all 9 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: Low
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- E: P
- EPSS
- 2.88% chance of exploitation in 30 days (percentile 88, 2026-11-26)
- CWE
- CWE-94
- Modified
Description
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 and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI langchain-experimental | < 0.0.21 | 0.0.21 | osv |
| langchain-experimental | >= 0.0.15, < 0.0.21 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-21513. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-21513.md Affected: langchain-experimental < 0.0.21 Fixed in: 0.0.21 Steps: 1. Search this machine and project for langchain-experimental (PyPI), langchain-experimental: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Other
- https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAINEXPERIMENTAL-7278171
- https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py%23L81
- https://github.com/langchain-ai/langchain
- https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py#L81
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain-experimental/PYSEC-2024-62.yaml
FAQ
Is CVE-2024-21513 being exploited?
There is no confirmed exploitation: CVE-2024-21513 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.88% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-21513?
High: CVSS 8.5 (v3.1, scored by CNA). Remote, login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-21513?
langchain-experimental < 0.0.21.
Is there a fix for CVE-2024-21513?
Yes. Fixed in 0.0.21. Upgrade langchain-experimental to 0.0.21 or later.
How do I check if I'm affected by CVE-2024-21513?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.