Authenticated Python code execution via generated-code exec
Published Mar 21, 2026 · Updated Mar 21, 2026
Code injection in Foundation Agents MetaGPT 0.8.0 and 0.8.1 allows remote authenticated users to execute Python code via crafted input. Programmer.code_generate folds attacker-controlled problem, analysis, and feedback text into an LLM prompt, and exec_code executes the returned code with Python exec after only an import-name blocklist. Access to an AFlow workflow that accepts these inputs is required; execution is limited to the MetaGPT process's operating-system privileges.
Summary
What happened
Code injection in Foundation Agents MetaGPT 0.8.0 and 0.8.1 allows remote authenticated users to execute Python code via crafted input. Programmer.code_generate folds attacker-controlled problem, analysis, and feedback text into an LLM prompt, and exec_code executes the returned code with Python exec after only an import-name blocklist. Access to an AFlow workflow that accepts these inputs is required; execution is limited to the MetaGPT process's operating-system privileges.
The record
- CVE
- CVE-2026-4515
- Published
- Mar 21, 2026
- Updated
- Mar 21, 2026
- Vendor
- Foundation Agents
- Product
- MetaGPT
- Classifications
- CWE-94, CWE-74, T1059.006
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Mar 21, 2026CVE publishedPublication date reported by the CVE source.
- Mar 21, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0.8.0
- Affected versionversion=0.8.1
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- MetaGPT AFlow unsafe exec proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo