# CVE-2024-4343: Python Command Injection in imartinez/privategpt

- Severity: Critical 9.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.69%, higher than 86% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-11-14T17:32:38.867Z
- Modified: 2026-06-17T08:01:42.750Z
- Weaknesses: CWE-78
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- 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.

(As written by CVE List.)

## Affected

- imartinez imartinez/privategpt: from unspecified before 0.6.0
- imartinez imartinez_privategpt: before 0.6.0
- pribai privategpt: before 0.6.0

## Every score

- @huntr_ai: CVSS:3.0 9.8 Critical `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/1d1e8f06-ec45-4b17-ae24-b83a41304c15> (exploit, third-party-advisory)
- <https://github.com/imartinez/privategpt/commit/86368c61760c9cee5d977131d23ad2a3e063cbe9> (patch)

## Sources

- CVE List: [CVE-2024-4343](https://www.cve.org/CVERecord?id=CVE-2024-4343), CVE Terms of Use, modified 2024-11-18
- NVD: [CVE-2024-4343](https://nvd.nist.gov/vuln/detail/CVE-2024-4343), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-4343 · Whole record: https://cve.day/CVE-2024-4343.json · Rebuilt by cve.day 2026-11-25T22:58:48.266Z
