CVE-2024-6091: Agpt AutoGPT Bypass Of The Shell Vulnerability

CRITICAL
Advisory Identifier: GHSA-g84q-54hf-36rg
CVSS 9.8
CWE-78
Published
Advisory Summary

CVE-2024-6091 is a CRITICAL (CVSS 9.8) autogpt bypass of the shell vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Agpt libraries in the PyPI ecosystem. The issue involves autogpt bypass of the shell commands denylist settings. Remediation is available in the latest vendor maintenance releases.

CVE-2024-6091 at a Glance

CVE Identifier CVE-2024-6091
GHSA Identifier GHSA-g84q-54hf-36rg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Agpt
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-6091

To remediate this vulnerability, upgrade all affected Agpt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

agpt fixed: Latest secure release
pip install agpt>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show agpt

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-6091, inspect your installed packages using pip:

pip show agpt

Analyze the terminal output to locate any version of Agpt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show agpt command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Agpt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability in significant-gravitas/autogpt version 0.5.1 allows an attacker to bypass the shell commands denylist settings. The issue arises when the denylist is configured to block specific commands, such as `whoami` and `/bin/whoami`. An attacker can circumvent this restriction by executing commands with a modified path, such as `/bin/./whoami`, which is not recognized by the denylist.

CVE-2024-6091 Affected Agpt Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
agpt
PyPI
≤ 0.5.1

References

Frequently Asked Questions

What is CVE-2024-6091?
CVE-2024-6091 is a security vulnerability in Agpt involving AutoGPT bypass of the shell commands denylist settings under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Agpt versions are affected?
Affected versions include releases prior to current release patches across affected packages: agpt.
What version fixes CVE-2024-6091?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is agpt affected?
Yes, agpt is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-6091?
CVE-2024-6091 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-6091?
CVE-2024-6091 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2024-6091?
Run the dependency tree command: 'pip show agpt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g84q-54hf-36rg",
  "modified" : "2024-09-18T22:11:39Z",
  "published" : "2024-09-11T15:31:12Z",
  "aliases" : [ "CVE-2024-6091" ],
  "summary" : "AutoGPT bypass of the shell commands denylist settings",
  "details" : "A vulnerability in significant-gravitas/autogpt version 0.5.1 allows an attacker to bypass the shell commands denylist settings. The issue arises when the denylist is configured to block specific commands, such as `whoami` and `/bin/whoami`. An attacker can circumvent this restriction by executing commands with a modified path, such as `/bin/./whoami`, which is not recognized by the denylist.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "agpt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6091"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/significant-gravitas/autogpt/commit/ef691359b774a1f9f80cf4f5ace9821967b718ed"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Significant-Gravitas/AutoGPT"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/8a742c13-bb5e-4bc9-8b86-049d8a386050"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-18T22:11:39Z",
    "nvd_published_at" : "2024-09-11T13:15:03Z"
  }
}