Summary
Ghidra contains an unsafe deserialization flaw in the client-side Shared-Project RMI connection logic that processes ghidra:// project URLs.
By tricking a user into opening a malicious project file, an attacker can trigger a Jython-based gadget chain and execute arbitrary commands without authentication.
Affected context
This vulnerability appears in Ghidra deployments where users open Shared Project configurations or project files that embed ghidra:// URLs.
The issue is exposed when the File → Open Project workflow processes project metadata and establishes RMI connections using serialized objects received from untrusted sources.
Environments where users routinely import or inspect externally supplied Ghidra projects are more likely to encounter the risky conditions.
Exploit preconditions
- Attack surface: Client-side Ghidra instance handling project files and Shared-Project RMI connections
- Required access: Ability to supply or influence a project file or configuration containing a malicious
ghidra://URL - Trigger point: User opens the crafted project via File → Open Project, causing RMI connection setup and object deserialization
- Why exploitation is possible: The Shared-Project client code deserializes attacker-controlled data without sufficient validation, allowing a Jython 2.7.4 gadget chain to be invoked during deserialization
Why this happens
The root cause is the use of Java object deserialization over RMI channels without constraining or validating the classes being instantiated.
Ghidra's Shared-Project connection logic treats serialized data embedded in or referenced by ghidra:// project URLs as trusted, allowing arbitrary object graphs to be reconstructed on the client.
In combination with Jython 2.7.4 on the classpath, an attacker can leverage known gadget classes to execute commands when the deserialization process runs.
This pattern aligns with CWE-502: Deserialization of Untrusted Data, where untrusted serialized objects are processed as if they were benign application data.
Potential impact
- Execution of arbitrary commands on the workstation running Ghidra
- Compromise of the analyst's environment, including credentials and local tooling
- Unauthorized access to local project data, binaries, and reverse-engineering artifacts
- Use of the compromised host as a pivot to attack internal networks or repositories
General mitigation guidance
Mitigation typically focuses on tightening how serialized data is handled and reducing trust in external project inputs.
Common defensive patterns include:
- Avoiding generic Java deserialization for RMI or replacing it with serialization frameworks that enforce type whitelists or contracts
- Introducing explicit validation and class filtering for any deserialized objects involved in remote project connections
- Treating external project files and
ghidra://URLs as untrusted input, with clear separation between parsing metadata and performing privileged operations - Running Ghidra with least-privilege user accounts and minimizing ambient system permissions where possible
- Isolating high-risk workflows (e.g., opening untrusted projects) in separate, constrained environments such as sandboxes or disposable VMs
How teams detect issues like this
Detection efforts can focus on both code-level patterns and runtime behavior:
- Static analysis or code review rules that flag usages of Java deserialization in RMI or network-facing components, especially where untrusted input can reach
ObjectInputStreamor similar APIs - Review of Shared-Project connection code paths for absence of class filtering, validation hooks, or type whitelists
- Automated checks in CI pipelines to prevent introduction of new unsafe deserialization sites, particularly when adding third-party libraries with known gadget chains
- Runtime monitoring or endpoint detection to alert on abnormal process execution originating from Ghidra, indicating possible gadget-chain exploitation

