Code injection in langchain-experimental
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | langchain-experimental | 0.0.15 to before 0.0.21 | 0.0.21 | Patch available | CNA |
| — | langchain-experimental (PyPI) | before 0.0.21 | 0.0.21 | Patch available | GHSA-cgcg-p68q-3w7v |
- langchain-experimental Vendor— Affected 0.0.15 to before 0.0.21 Fixed in 0.0.21 Patch available CNA
- langchain-experimental (PyPI) Vendor— Affected before 0.0.21 Fixed in 0.0.21 Patch available GHSA-cgcg-p68q-3w7v
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:langchain:langchain-experimental:*:*:*:*:*:*:*:* | 0.0.15 to before 0.0.21 | Vulnerable | langchain-ai |
- cpe:2.3:a:langchain:langchain-experimental:*:*:*:*:*:*:*:* Versions 0.0.15 to before 0.0.21 Vulnerable ·langchain-ai
Remediation
- Fix · CNA langchain-experimental Fixed in 0.0.21
- Fix · GHSA-cgcg-p68q-3w7v langchain-experimental (PyPI) Fixed in 0.0.21 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-21513
- 2026-10-03 Alias added: GHSA-cgcg-p68q-3w7v
References
Other 4
- 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
More langchain-ai Langchain-experimental vulnerabilities
- TI-2024-31340 langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain… CVSS 3.1CRITICAL 9.8
- TI-2024-18267 langchain_experimental (aka LangChain Experimental) in LangChain before 0.1.8 allows an… CVSS 3.1CRITICAL 9.8
- TI-2024-25702 langchain_experimental (aka LangChain Experimental) before 0.0.61 for LangChain provides… CVSS 3.1HIGH 7.8
Sources
- CVE-2024-21513 · CVE Program
- CVE-2024-21513 · NVD
- FIRST EPSS
- GHSA-cgcg-p68q-3w7v · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences