Skip to main content

CVE-2024-1880: AutoGPT MacOS TTS RCE Vulnerability

CVE-2024-1880 is a remote code execution flaw in AutoGPT that allows attackers to execute arbitrary code through OS command injection in the MacOS Text-To-Speech feature. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-1880 Overview

CVE-2024-1880 is an OS command injection vulnerability in the MacOSTTS text-to-speech class of the significant-gravitas/autogpt project. The flaw affects versions up to and including v0.5.0. The _speech method invokes os.system to run the macOS say command with user-supplied text, failing to neutralize shell metacharacters [CWE-78]. An attacker who can influence spoken output can inject shell commands and execute arbitrary code on the host running AutoGPT. Exploitation requires the agent to be launched with the --speak option and configured with TEXT_TO_SPEECH_PROVIDER=macos. Maintainers addressed the issue in AutoGPT version 5.1.0.

Critical Impact

Attackers can achieve arbitrary code execution on the local host running an AutoGPT instance when text-to-speech output includes attacker-controlled strings.

Affected Products

  • significant-gravitas/autogpt (autogpt_classic) versions up to v0.5.0
  • Deployments configured with TEXT_TO_SPEECH_PROVIDER=macos
  • AutoGPT instances launched with the --speak runtime flag on macOS

Discovery Timeline

  • 2024-06-06 - CVE-2024-1880 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-1880

Vulnerability Analysis

The vulnerability resides in the _speech method of the MacOSTTS class. The method constructs a shell command that passes user-supplied text to the macOS say utility and executes it through os.system. Because os.system spawns a shell, any unescaped shell metacharacters in the text (backticks, $(), ;, |, &) are interpreted by the shell rather than treated as literal arguments to say.

AutoGPT agents frequently reflect model output or external content into text-to-speech. An attacker who can influence the model's response, for example through a crafted web page, retrieved document, or tool output consumed by the agent, can embed a shell injection payload inside what appears to be benign spoken text. When the agent routes that text through MacOSTTS._speech, the shell evaluates the injected command.

The resulting code execution runs with the privileges of the AutoGPT process, enabling credential theft, pivoting to connected cloud services via stored API keys, and tampering with the agent's memory or planning files.

Root Cause

The root cause is improper neutralization of special elements used in an OS command [CWE-78]. The _speech implementation concatenates untrusted text into a shell command string and invokes os.system, rather than using subprocess.run with an argument list and shell=False to isolate text from command parsing.

Attack Vector

Exploitation is local and requires an AutoGPT instance running with --speak and TEXT_TO_SPEECH_PROVIDER=macos. The attacker injects a shell snippet into any content the agent will speak aloud, prompt chains, retrieved documents, tool outputs, or chat input, and the macOS shell executes the payload during speech synthesis.

The vulnerability was described in prose rather than with a public proof-of-concept. See the Huntr bug bounty listing and the upstream repository commit for technical references.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2024-1880

Indicators of Compromise

  • Unexpected child processes of the AutoGPT Python interpreter, particularly /bin/sh -c invocations that do not match the say binary pattern
  • Shell metacharacters (`, $(, ;, |, &&) appearing in text passed to MacOSTTS._speech logs or stdout
  • Outbound network connections from the AutoGPT process shortly after a text-to-speech event
  • Modifications to shell startup files (~/.zshrc, ~/.bash_profile) or new launch agents created by the AutoGPT user

Detection Strategies

  • Monitor process ancestry on macOS endpoints running AutoGPT: flag sh or bash processes whose parent is python and whose command line does not match the expected say <text> form
  • Inspect AutoGPT application logs for TTS payloads containing shell control characters
  • Correlate --speak runtime configuration with network egress from the agent process using endpoint telemetry

Monitoring Recommendations

  • Enable macOS Endpoint Security Framework (ESF) process-exec auditing on hosts running AutoGPT
  • Record environment variables such as TEXT_TO_SPEECH_PROVIDER at process start to identify at-risk configurations
  • Alert on new persistence artifacts (LaunchAgents, LaunchDaemons, cron entries) created by the AutoGPT service account

How to Mitigate CVE-2024-1880

Immediate Actions Required

  • Upgrade significant-gravitas/autogpt to version 5.1.0 or later, where the _speech method no longer passes untrusted text through os.system
  • Audit running agents for the --speak flag combined with TEXT_TO_SPEECH_PROVIDER=macos and disable the combination until patched
  • Rotate any API keys, OAuth tokens, or cloud credentials stored on hosts that ran vulnerable AutoGPT versions with TTS enabled

Patch Information

The fix is included in AutoGPT 5.1.0. Review the upstream remediation in the maintainer commit and the coordinated disclosure record on the Huntr bug bounty listing.

Workarounds

  • Disable the --speak option on all AutoGPT invocations until upgrading
  • Set TEXT_TO_SPEECH_PROVIDER to a non-macOS provider, or remove the variable entirely, to bypass the vulnerable code path
  • Run AutoGPT inside a restricted macOS user account or sandbox profile to limit the blast radius of local command execution
  • Apply egress network restrictions to the AutoGPT host to constrain post-exploitation activity
bash
# Configuration example: disable the vulnerable TTS path in .env
TEXT_TO_SPEECH_PROVIDER=
# Launch AutoGPT without the --speak flag
python -m autogpt

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.