CVE-2019-16941

9.8 CRITICAL

📋 TL;DR

CVE-2019-16941 allows arbitrary code execution in NSA Ghidra when experimental mode is enabled and a maliciously modified XML document is processed through the Read XML Files feature. This affects Ghidra users who enable experimental features and process untrusted XML files. Attackers can execute arbitrary commands on the system running Ghidra.

💻 Affected Systems

Products:
  • NSA Ghidra
Versions: All versions through 9.0.4
Operating Systems: All platforms running Ghidra (Windows, Linux, macOS)
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when experimental mode is enabled AND malicious XML files are processed through Byte Patterns Explorer's Read XML Files feature.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining complete control over the host running Ghidra, potentially leading to data theft, lateral movement, or persistence establishment.

🟠

Likely Case

Local privilege escalation or arbitrary command execution in the context of the Ghidra user, allowing file system access, data exfiltration, or further exploitation.

🟢

If Mitigated

No impact if experimental mode is disabled or untrusted XML files are not processed.

🌐 Internet-Facing: LOW - Ghidra is typically used as a local analysis tool, not exposed to internet.
🏢 Internal Only: MEDIUM - Risk exists if users process untrusted XML files with experimental mode enabled.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires user interaction to load malicious XML file. Public proof-of-concept code exists demonstrating arbitrary command execution.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit a17728f8c12effa171b17a25ccfb7e7d9528c5d0 and subsequent releases

Vendor Advisory: https://github.com/NationalSecurityAgency/ghidra/issues/1090

Restart Required: Yes

Instructions:

1. Update Ghidra to version 9.1 or later. 2. Download from official GitHub releases. 3. Replace existing installation. 4. Restart Ghidra.

🔧 Temporary Workarounds

Disable Experimental Mode

all

Prevent exploitation by disabling experimental features in Ghidra

In Ghidra: Edit → Tool Options → Experimental → Uncheck 'Enable Experimental Features'

Restrict XML Processing

all

Avoid processing untrusted XML files with Byte Patterns Explorer

Do not use 'Read XML Files' feature on untrusted XML documents

🧯 If You Can't Patch

  • Disable experimental mode in Ghidra settings
  • Implement strict policy against processing untrusted XML files with Ghidra

🔍 How to Verify

Check if Vulnerable:

Check Ghidra version: Help → About Ghidra. If version is 9.0.4 or earlier and experimental mode is enabled, system is vulnerable.

Check Version:

In Ghidra: Help → About Ghidra

Verify Fix Applied:

Verify Ghidra version is 9.1 or later, or check that commit a17728f8c12effa171b17a25ccfb7e7d9528c5d0 is included in your build.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Java process spawning child processes
  • XML parsing errors in Ghidra logs
  • Unexpected command execution from Ghidra process

Network Indicators:

  • Outbound connections from Ghidra process to unexpected destinations

SIEM Query:

process_name:java AND parent_process:ghidra.exe AND cmdline:*Runtime.exec*

🔗 References

📤 Share & Export