CVE-2025-4089 Overview
CVE-2025-4089 is a command injection vulnerability in the "copy as cURL" feature of Mozilla Firefox and Thunderbird. The Developer Tools component fails to properly escape special characters when generating cURL command strings from captured network requests. An attacker who controls request content can craft payloads that, when the user pastes the copied command into a shell, execute arbitrary commands on the local system. Mozilla fixed the issue in Firefox 138 and Thunderbird 138.
Critical Impact
Social-engineered local code execution through a trusted developer workflow, abusing the user's own shell privileges.
Affected Products
- Mozilla Firefox versions prior to 138
- Mozilla Thunderbird versions prior to 138
- Developer Tools "copy as cURL" feature on all supported platforms
Discovery Timeline
- 2025-04-29 - CVE-2025-4089 published to the National Vulnerability Database
- 2025-04-29 - Mozilla publishes advisories MFSA-2025-28 and MFSA-2025-31
- 2026-09-30 - Last updated in the NVD database
Technical Details for CVE-2025-4089
Vulnerability Analysis
The vulnerability resides in the Firefox and Thunderbird Developer Tools network panel. When a user right-clicks a captured request and selects "copy as cURL", the browser serializes request attributes such as the URL, headers, and body into a shell command string. The serializer does not sufficiently escape shell metacharacters, enabling command injection into the generated string.
Mozilla classifies the issue as [CWE-77] Improper Neutralization of Special Elements used in a Command. Exploitation requires user interaction: the victim must copy the crafted command and execute it in a local shell. Successful exploitation yields code execution under the user's own account, bypassing browser sandboxing because the payload runs outside the browser process.
Root Cause
The root cause is incomplete shell quoting in the cURL command generation logic. Characters such as backticks, dollar signs, newlines, and single quotes within attacker-controlled fields are not neutralized before concatenation into the output string. When pasted into Bash, Zsh, or similar shells, these characters are interpreted as command substitution or statement separators rather than literal data.
Attack Vector
An attacker hosts or controls a web resource that returns responses with hostile headers, URLs, or body content containing shell metacharacters. The attacker then convinces a developer, support engineer, or security analyst to reproduce the request using "copy as cURL" and paste it into a terminal. The injected payload executes with the privileges of the local user, enabling file access, persistence installation, or lateral movement from the workstation.
No verified public proof-of-concept code is available. See MFSA-2025-28 for Mozilla's technical description.
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 AttemptsDetection Methods for CVE-2025-4089
Indicators of Compromise
- Shell history entries containing curl invocations with embedded $(...), backticks, or newline-separated commands following header values
- Unexpected child processes spawned by interactive shells (bash, zsh, pwsh) immediately after a developer pastes a cURL command
- Outbound network connections from shell-spawned processes that do not match the original cURL target host
Detection Strategies
- Monitor endpoint telemetry for shell processes launching interpreters, downloaders, or scripting hosts within seconds of a curl invocation
- Alert on Firefox or Thunderbird versions below 138 present in asset inventory, especially on developer and SOC workstations
- Review browser-adjacent process trees where terminal applications are frequent children of file managers or copy-paste workflows
Monitoring Recommendations
- Ingest shell command-line auditing (auditd execve, PowerShell ScriptBlock logging, macOS ESF) into a centralized data lake for retrospective hunting
- Baseline normal cURL usage patterns per user and flag commands containing suspicious metacharacter sequences in header or URL fields
- Correlate browser version telemetry with endpoint detection events to prioritize unpatched hosts
How to Mitigate CVE-2025-4089
Immediate Actions Required
- Upgrade Mozilla Firefox to version 138 or later on all endpoints
- Upgrade Mozilla Thunderbird to version 138 or later on all endpoints
- Instruct developers and analysts not to paste copy as cURL output from untrusted origins into interactive shells until patching is complete
Patch Information
Mozilla addressed CVE-2025-4089 in Firefox 138 and Thunderbird 138. Refer to Mozilla Security Advisory MFSA-2025-28 and Mozilla Security Advisory MFSA-2025-31 for release details. Enterprise administrators should push updates through managed deployment channels such as Mozilla ESR packaging, WSUS, Jamf, or Intune.
Workarounds
- Prefer "copy as PowerShell" or "copy as fetch" where supported, and review the output before execution
- Paste suspect cURL commands into a plain text editor first to visually inspect for shell metacharacters and newlines
- Execute copied cURL commands in disposable sandboxes or containers rather than on primary workstations
# Verify installed Firefox version meets the fixed release
firefox --version | awk '{ if ($3+0 < 138) print "VULNERABLE: upgrade to Firefox 138+"; else print "OK" }'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

