CVE-2026-5974: FoundationAgents MetaGPT OS command injection in Bash tool

CVE-2026-5974 · Severity: high · CVSS 7.3 · Published 2026-04-09

FoundationAgents MetaGPT, a framework for building AI-driven software agents, contains a security flaw in its terminal tool. This vulnerability allows an attacker to execute unauthorized operating system commands on the server or machine running the AI agent. If exploited, this could lead to a full system takeover, data theft, or disruption of operations.

Technologies: Deepwisdom Metagpt, metagpt (PyPI). Vendors: Deepwisdom, PyPI.

Quick answers

Is CVE-2026-5974 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-5974 being exploited in the wild.
How severe is CVE-2026-5974?
High severity, with a CVSS score of 7.3, published 9 April 2026.
Which products and versions are affected?
metagpt (PyPI) ECOSYSTEM:introduced=0,last_affected=0.8.1.
Is there a fix for CVE-2026-5974?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-5974 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-5974?
Check whether you run Deepwisdom Metagpt or metagpt (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

An OS command injection vulnerability exists in FoundationAgents MetaGPT versions up to and including 0.8.1. The flaw is located in the Bash.run function within the metagpt/tools/libs/terminal.py library, which fails to properly sanitize inputs before passing them to a system shell. A remote attacker can exploit this by providing malicious input—potentially via prompt injection if the tool is exposed to an LLM—to execute arbitrary commands on the host operating system. While a pull request (#1940) has been proposed to implement command validation and an allowlist, it has not yet been merged into the main project.

Affected products

  • FoundationAgents MetaGPT <= 0.8.1

Identifiers

  • CVE-2026-5974
  • GHSA-fcc8-4q7h-wvwc
  • PYSEC-2026-2639

Timeline

  • 2026-02-11: other: Pull request with security fix submitted by community member
  • 2026-04-09: advisory: NVD and GitHub Advisory Database publication

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.