CVE-2024-4343
JSON

9.8critical

Python Command Injection in imartinez/privategpt

Severity
9.8critical CVSS:3.1 by CISA-ADP
Exploit likelihood
2.69% (higher than 86% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
@huntr_ai

Description

A Python command injection vulnerability exists in the `SagemakerLLM` class's `complete()` method within `./private_gpt/components/llm/custom/sagemaker.py` of the imartinez/privategpt application, versions up to and including 0.3.0. The vulnerability arises due to the use of the `eval()` function to parse a string received from a remote AWS SageMaker LLM endpoint into a dictionary. This method of parsing is unsafe as it can execute arbitrary Python code contained within the response. An attacker can exploit this vulnerability by manipulating the response from the AWS SageMaker LLM endpoint to include malicious Python code, leading to potential execution of arbitrary commands on the system hosting the application. The issue is fixed in version 0.6.0.

Affected

Product or packageVersionsReported by
imartinez imartinez/privategptfrom unspecified before 0.6.0CVE List
imartinez imartinez_privategptbefore 0.6.0CVE List
pribai privategptbefore 0.6.0NVD

All scores

@huntr_ai9.8critical CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CISA-ADP9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-78

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

A Python command injection vulnerability exists in the `SagemakerLLM` class's `complete()` method within `./private_gpt/components/llm/custom/sagemaker.py` of the imartinez/privategpt application, versions up to and including 0.3.0. The vulnerability arises due to the use of the `eval()` function to parse a string received from a remote AWS SageMaker LLM endpoint into a dictionary. This method of parsing is unsafe as it can execute arbitrary Python code contained within the response. An attacker can exploit this vulnerability by manipulating the response from the AWS SageMaker LLM endpoint to include malicious Python code, leading to potential execution of arbitrary commands on the system hosting the application. The issue is fixed in version 0.6.0.

NVD (es)

Existe una vulnerabilidad de inyección de comandos de Python en el método `complete()` de la clase `SagemakerLLM` dentro de `./private_gpt/components/llm/custom/sagemaker.py` de la aplicación imartinez/privategpt, versiones hasta la 0.3.0 incluida. La vulnerabilidad surge debido al uso de la función `eval()` para analizar una cadena recibida desde un punto de conexión remoto de AWS SageMaker LLM en un diccionario. Este método de análisis no es seguro ya que puede ejecutar código Python arbitrario contenido en la respuesta. Un atacante puede explotar esta vulnerabilidad manipulando la respuesta del punto de conexión de AWS SageMaker LLM para incluir código Python malicioso, lo que lleva a la posible ejecución de comandos arbitrarios en el sistema que aloja la aplicación. El problema se solucionó en la versión 0.6.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-4343 changed 2024-11-18CVE Terms of Use
NVDCVE-2024-4343 changed 2026-06-17Public domain