CVE-2026-4946 Overview
Ghidra versions prior to 12.0.3 contain a critical command injection vulnerability that allows attackers to execute arbitrary commands on an analyst's machine through specially crafted binary files. The vulnerability exists in how Ghidra processes annotation directives embedded in automatically extracted binary data, specifically the @execute annotation which is intended for trusted, user-authored comments but is also parsed in comments generated during auto-analysis.
When an analyst loads a malicious binary (such as a Mach-O file containing crafted CFStrings), Ghidra's auto-analysis feature generates comments that include the attacker-controlled @execute annotation. The resulting clickable text appears benign in the UI, but when clicked, executes attacker-controlled commands on the analyst's system.
Critical Impact
Attackers can achieve arbitrary command execution on security analysts' workstations by distributing malicious binaries for reverse engineering analysis.
Affected Products
- Ghidra versions prior to 12.0.3
- Systems analyzing untrusted Mach-O binaries with CFStrings
- Any platform running vulnerable Ghidra instances (Windows, macOS, Linux)
Discovery Timeline
- 2026-03-29 - CVE CVE-2026-4946 published to NVD
- 2026-03-30 - Last updated in NVD database
Technical Details for CVE-2026-4946
Vulnerability Analysis
This vulnerability is classified as CWE-78 (OS Command Injection) and represents a significant security risk for malware analysts and reverse engineers. The attack exploits a design flaw where Ghidra fails to distinguish between trusted user-authored annotations and untrusted data extracted from analyzed binaries.
The core issue stems from Ghidra's annotation processing system, which supports special directives like @execute to provide interactive functionality within comments. While this feature is powerful for legitimate use cases, the application fails to sanitize or restrict this functionality when processing automatically generated comments from binary analysis.
An attacker can craft a malicious binary containing strings (such as CFStrings in Mach-O format) that include the @execute annotation followed by arbitrary shell commands. When Ghidra performs auto-analysis, these strings are extracted and displayed as clickable hyperlinks in the decompiler or listing view. The presentation is designed to appear innocuous, potentially masquerading as documentation links or reference URLs.
Root Cause
The root cause is improper input validation and the absence of trust boundaries between user-authored content and machine-extracted data. The @execute annotation parser does not differentiate between annotations manually added by analysts (which should be trusted) and annotations present in extracted binary data (which should never be trusted). This allows untrusted data to influence command execution in a privileged context.
Attack Vector
The attack requires user interaction (clicking the malicious link) which occurs via network delivery of the malicious binary. An attacker distributes a crafted binary file through any channel that reaches security analysts—malware sample repositories, incident response tickets, phishing emails, or compromised software distribution channels. When the analyst opens the binary in Ghidra and clicks what appears to be a benign reference link in the auto-generated comments, the embedded command executes with the analyst's privileges.
The vulnerability mechanism works as follows: During Mach-O binary analysis, Ghidra extracts CFString objects and displays them as comments. If a CFString contains @execute annotation syntax followed by shell commands, Ghidra renders this as a clickable hyperlink. The displayed text can be crafted to appear as legitimate documentation (e.g., "Apple Developer Documentation") while the underlying command performs malicious actions such as establishing reverse shells, exfiltrating analysis data, or deploying persistence mechanisms.
For technical details on the exploitation mechanism, refer to the GitHub Security Advisory.
Detection Methods for CVE-2026-4946
Indicators of Compromise
- Unexpected child processes spawned by Ghidra or Java runtime processes during binary analysis sessions
- Suspicious network connections originating from Ghidra processes, particularly to external IP addresses
- Presence of @execute annotations in CFString sections of analyzed binaries
- Unusual shell command execution coinciding with analyst interaction in Ghidra UI
Detection Strategies
- Monitor process creation events for shell processes (cmd.exe, bash, sh, powershell) spawned as children of Ghidra or Java processes
- Implement file integrity monitoring on systems used for malware analysis to detect unauthorized modifications
- Deploy endpoint detection to identify command execution patterns associated with reverse shell establishment
- Analyze submitted binary samples for suspicious CFString content containing @execute patterns before opening in Ghidra
Monitoring Recommendations
- Configure SentinelOne agents on analyst workstations to alert on process chains involving ghidraRun or Java spawning shell interpreters
- Implement network segmentation for malware analysis environments to limit impact of successful exploitation
- Enable enhanced logging on reverse engineering workstations to capture detailed process and network telemetry
- Review Ghidra analysis sessions for unexpected annotation content in automated comment sections
How to Mitigate CVE-2026-4946
Immediate Actions Required
- Upgrade all Ghidra installations to version 12.0.3 or later immediately
- Conduct malware analysis in isolated virtual machines or air-gapped environments until patching is complete
- Warn analysts not to click on any hyperlinks within Ghidra comments when analyzing untrusted binaries
- Review recently analyzed binaries for potential exploitation attempts
Patch Information
The vulnerability is addressed in Ghidra version 12.0.3. The fix implements proper trust boundaries between user-authored annotations and auto-generated comments from binary analysis, preventing the @execute annotation from being processed in untrusted contexts. Organizations should obtain the patched version from the official NSA Ghidra GitHub repository.
For additional context, see the TakeOnMe GCVE Analysis and GitHub Security Advisory.
Workarounds
- Conduct all binary analysis in isolated virtual machines with no network access and snapshot capabilities for rapid recovery
- Disable or avoid interacting with hyperlinks in Ghidra's comment sections when analyzing untrusted binaries
- Pre-screen binaries for suspicious CFString content using command-line tools before loading in Ghidra
- Implement application whitelisting on analyst workstations to prevent unauthorized command execution
# Example: Pre-screen Mach-O binaries for suspicious @execute annotations
strings -a suspicious_binary | grep -i "@execute"
# Run Ghidra in isolated container environment
docker run --rm -it --network none -v /samples:/samples ghidra-isolated
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


