AutoGPT bypass of the shell commands denylist settings
The shell command denylist in AutoGPT 0.5.1 could be bypassed by using a modified path such as /bin/./whoami, which the denylist did not recognise. An attacker could therefore run commands that were meant to be blocked.
significant-gravitas/autogpt
Originally disclosed on huntr
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.
From the GitHub Advisory Database (GHSA-g84q-54hf-36rg, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the denylist compared command strings literally without normalising paths, so equivalent paths were not matched.
Impact
An attacker could execute shell commands that the denylist was intended to block, potentially leading to arbitrary command execution within the permissions of the AutoGPT process.
What the attacker needed
Denylist configured to block commands; ability to influence shell commands
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
AutoGPT can run shell commands, and it has a blocklist to stop dangerous ones. The blocklist only checked the exact text of the command, so adding a harmless-looking path segment like a dot made the same command look different and slip through. This means the safety check could be tricked into allowing a command it was supposed to stop.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.