CVE-2024-21513

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.
Configurations

Configuration 1 (hide)

cpe:2.3:a:langchain:langchain-experimental:*:*:*:*:*:*:*:*

History

16 Jul 2024, 18:12

Type Values Removed Values Added
References () https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py%23L81 - () https://github.com/langchain-ai/langchain/blob/672907bbbb7c38bf19787b78e4ffd7c8a9026fe4/libs/experimental/langchain_experimental/sql/vector_sql.py%23L81 - Broken Link
References () https://github.com/langchain-ai/langchain/commit/7b13292e3544b2f5f2bfb8a27a062ea2b0c34561 - () https://github.com/langchain-ai/langchain/commit/7b13292e3544b2f5f2bfb8a27a062ea2b0c34561 - Patch
References () https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAINEXPERIMENTAL-7278171 - () https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAINEXPERIMENTAL-7278171 - Third Party Advisory
Summary
  • (es) Las versiones del paquete langchain-experimental desde 0.0.15 y anteriores a 0.0.21 son vulnerables a la ejecución de código arbitrario cuando se recuperan valores de la base de datos; el código intentará llamar a 'eval' en todos los valores. Un atacante puede aprovechar esta vulnerabilidad y ejecutar código Python arbitrario si puede controlar el mensaje de entrada y el servidor está configurado con VectorSQLDatabaseChain. **Notas:** Impacto en la confidencialidad, integridad y disponibilidad del componente vulnerable: Confidencialidad: la ejecución del código ocurre dentro del componente afectado, en este caso langchain-experimental, por lo que todos los recursos son necesariamente accesibles. Integridad: No hay nada protegido inherentemente por el componente afectado. Aunque cualquier cosa devuelta por el componente cuenta como "información" cuya confiabilidad puede verse comprometida. Disponibilidad: la pérdida de disponibilidad no es causada por el ataque en sí, sino que ocurre como resultado durante los pasos posteriores a la explotación del atacante. Impacto en la confidencialidad, integridad y disponibilidad del sistema posterior: como usuario legítimo con pocos privilegios del paquete (PR:L), el atacante no tiene más acceso a los datos propiedad del paquete como resultado de esta vulnerabilidad que antes. con uso normal (por ejemplo, puede consultar la base de datos). La acción no intencionada que se puede realizar al salir del entorno de la aplicación y filtrar archivos, realizar conexiones remotas, etc., ocurre durante la fase posterior a la explotación en el sistema posterior, en este caso, el sistema operativo. AT:P: Un atacante debe poder influir en el mensaje de entrada, mientras el servidor está configurado con el complemento VectorSQLDatabaseChain.
CPE cpe:2.3:a:langchain:langchain-experimental:*:*:*:*:*:*:*:*
First Time Langchain
Langchain langchain-experimental
CWE NVD-CWE-noinfo

15 Jul 2024, 05:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-07-15 05:15

Updated : 2024-08-01 13:46


NVD link : CVE-2024-21513

Mitre link : CVE-2024-21513

CVE.ORG link : CVE-2024-21513


JSON object : View

Products Affected

langchain

  • langchain-experimental
CWE
NVD-CWE-noinfo CWE-94

Improper Control of Generation of Code ('Code Injection')