CVE-2024-4343CWE-78

Python Command Injection in imartinez/privategpt

Critical · published November 14, 2024

CVSS v3.0
9.8
EPSS
3%
Percentile
85.8
In the wild
Unconfirmed
What it is

🚨 A sneaky command injection vulnerability lurks in the `SagemakerLLM` class, opening the door wide for an attacker to run arbitrary Python code! 🔥 Imagine a restaurant chef blindly following a delivery order without checking the ingredients — if the delivery person hands over a list with poison, the chef might just whip up a toxic dish. That's exactly what's happening here: the `eval()` function is trusting a potentially dangerous response from AWS SageMaker LLM, allowing harmful commands to be executed. An attacker could manipulate the response from the SageMaker endpoint, executing any command they wish on your server. This means complete control over the system, data theft, or even total destruction of critical resources. It's absolutely devastating!

Put simply

Imagine a restaurant chef blindly following a delivery order without checking the ingredients — if the delivery person hands over a list with poison, the chef might just whip up a toxic dish. That's exactly what's happening here: the `eval()` function is trusting a potentially dangerous response from AWS SageMaker LLM, allowing harmful commands to be executed. The command injection vulnerability in the `complete()` method of the `SagemakerLLM` class allows attackers to run arbitrary Python code by exploiting unsafe use of the `eval()` function on unsecured responses from a remote endpoint.

What to do

An attacker could manipulate the response from the SageMaker endpoint, executing any command they wish on your server. This means complete control over the system, data theft, or even total destruction of critical resources. It's absolutely devastating! To secure your application, upgrade immediately to version 0.6.0, where this vulnerability is patched. Also, consider implementing additional validation checks on responses from remote endpoints to prevent future exploits. Don't wait and risk it! You can tackle this! Follow these steps and you'll be back on track in no time. 🛡️

The record
Technical detail
CVSS v3.0
9.8 · CRITICAL
Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.02685 · 85.8th percentile
Weakness
CWE-78 · Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Published
2024-11-14T17:32Z
EPSS history
Timeline
  • 14 NOV 17:32Z
    Python Command Injection in imartinez/privategpt
    cvelistv5