---
id: CVE-2026-5972
aliases:
  - GHSA-wp29-qmvj-frvp
  - PYSEC-2026-2644
title: >-
  FoundationAgents MetaGPT vulnerable to os command injection via the
  Terminal.run_command
summary: >-
  FoundationAgents MetaGPT vulnerable to os command injection via the
  Terminal.run_command
severity: high
cvss: 7.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L'
vendor: metagpt
product: metagpt
ecosystem: pip
affected:
  - metagpt < 0.8.2
patched:
  - metagpt 0.8.2
published: '2026-04-09'
updated: '2026-07-13'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-wp29-qmvj-frvp'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-5972'
  - url: 'https://github.com/FoundationAgents/MetaGPT/issues/1929'
  - url: >-
      https://github.com/paipeline/MetaGPT/commit/d04ffc8dc67903e8b327f78ec121df5e190ffc7b
  - url: 'https://github.com/FoundationAgents/MetaGPT'
  - url: 'https://vuldb.com/submit/791745'
  - url: 'https://vuldb.com/vuln/356526'
  - url: 'https://vuldb.com/vuln/356526/cti'
tags:
  - osv
  - pip
epss: 0.0256
epssPercentile: 0.84416
ingestedAt: '2026-07-13T18:58:04.644Z'
---

## Overview

A vulnerability has been found in FoundationAgents MetaGPT up to 0.8.1. This issue affects the function Terminal.run_command in the library metagpt/tools/libs/terminal.py. The manipulation leads to os command injection. Remote exploitation of the attack is possible. The exploit has been disclosed to the public and may be used. The identifier of the patch is d04ffc8dc67903e8b327f78ec121df5e190ffc7b. Applying a patch is the recommended action to fix this issue.

## Affected packages

- `metagpt < 0.8.2`

## Remediation

Upgrade to a patched release:

- `metagpt 0.8.2`
