Foundation Agents MetaGPT Remote Code Execution Vulnerability

Vulnerability

A remote code execution vulnerability has been identified in Foundation Agents MetaGPT versions through 0.8.1. The issue arises in the 'code_generate' function within 'metagpt/ext/aflow/scripts/operator.py', where inadequate sanitization allows for code injection. This vulnerability enables attackers to execute arbitrary commands on the host machine.

Impact

Exploitation of this vulnerability allows for remote execution of commands on the server where MetaGPT is running.

Reproduction

To reproduce this vulnerability, upload a prompt to the MetaGPT 'Programmer' component that includes a crafted instruction to bypass the application's security filters. The injected code can then be executed on the server.

Added: Mar 21, 2026, 12:19 PM
Updated: Mar 21, 2026, 12:19 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
4.6
remediation
0.0
relevance
4.2
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.