(0Day) Foundation Agents MetaGPT actionoutput_str_to_mapping Code Injection Remote Code Execution Vulnerability
The actionoutput_str_to_mapping function in Foundation Agents MetaGPT fails to validate a user-supplied string before using it to execute Python code. An unauthenticated remote attacker can exploit this to execute arbitrary code in the context of the service account.
Originally disclosed on Zero Day Initiative
This vulnerability allows remote attackers to execute arbitrary code on affected installations of Foundation Agents MetaGPT. Authentication is not required to exploit this vulnerability.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
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 function uses a dangerous Python evaluation function (such as eval or exec) on untrusted input without sanitisation.
Impact
An unauthenticated attacker could execute arbitrary code with the privileges of the service account.
What the attacker needed
None
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.
This is a code injection flaw in a tool called MetaGPT. The program takes a string from a user and runs it as Python code without checking it first. An attacker can send a malicious string to run their own commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.