/

CVE-2026-52755

Severity:

HIGH RISK

(7.8)

Path Traversal (CWE-22) in Ghidra Theme Import Feature

CVE-2026-52755

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Ghidra versions before 12.0.4 contain a path traversal flaw in the theme import feature that trusts file paths inside user-supplied ZIP archives.

By crafting a malicious theme package with directory traversal sequences, an attacker may write files outside the theme directory, potentially enabling code execution or tampering with sensitive user configuration files.

Affected context

This vulnerability manifests when Ghidra processes theme ZIP archives provided by users and extracts their contents to the local filesystem.

It is relevant in environments where users can import untrusted or third-party themes and where Ghidra runs with access to user home directories or other sensitive paths.

The risk increases when Ghidra is executed with elevated privileges or in shared workstations where multiple users may interact with the same account or configuration.

Exploit preconditions

  • Attack surface: Ghidra theme import functionality (ZIP theme file parsing and extraction).
  • Required access: Ability to supply or trick a user into importing a crafted theme ZIP (local file or downloaded package).
  • Trigger point: User initiates a theme import, causing Ghidra to extract ZIP contents.
  • Why exploitation is possible: The extraction logic does not adequately normalize and validate archive entry paths, allowing traversal sequences (e.g., ../) to direct file writes outside the intended theme directory.

Why this happens

The underlying issue is an improper restriction of the target path for files extracted from user-controlled ZIP archives.

The theme import code trusts embedded file paths and fails to canonicalize and validate them against an allowed base directory before writing to disk.

This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-supplied path components can escape a designated directory and affect unintended files or locations.

Potential impact

  • Overwriting user configuration files such as shell startup scripts (e.g., .bashrc) that may lead to code execution on next login or shell spawn.
  • Modifying SSH configuration files (e.g., .ssh/authorized_keys) to add attacker-controlled keys and enable unauthorized remote access.
  • Planting or modifying scripts and binaries in user-writable paths that are later executed in the normal course of operations.
  • Corrupting Ghidra configuration or theme data, potentially causing application instability or influencing analysis behavior.
  • Tampering with log files or other local data to hide malicious activity or mislead incident investigations.

General mitigation guidance

Effective mitigation is centered around strict path handling and reducing the trust boundary of imported artifacts.

Common defensive patterns include:

  • Canonicalizing each archive entry path and verifying that it resides within the intended theme directory before extracting.
  • Rejecting any archive entry that contains traversal sequences, absolute paths, or path prefixes that resolve outside the designated directory.
  • Using high-level file extraction utilities or libraries that support secure extraction modes with enforced base directories.
  • Running Ghidra under a user account with the minimum necessary filesystem privileges and avoiding execution with elevated rights.
  • Encouraging users to import themes only from trusted sources and treating theme packages as potentially executable content from a security perspective.

How teams detect issues like this

Organizations can approach detection by combining code-centric and system-centric techniques:

  • Static analysis: Search for ZIP extraction routines that concatenate archive entry names with filesystem paths without canonicalization or base-path checks; flag use of naive directory creation and file writing in import utilities.
  • Code review: Examine theme or plugin import code paths for validation of file names, rejection of .. segments, absolute paths, and unusual path prefixes; ensure strict comparison against a whitelisted base directory.
  • Runtime monitoring: Observe filesystem activity for unexpected writes triggered by Ghidra in locations outside its configuration or theme directories, especially following theme imports.
  • Policy enforcement: Establish secure coding guidelines for resource extraction and integrate automated checks (e.g., SAST tools, custom linters) into CI pipelines to catch future path traversal patterns early.

Sources

SourceLink
github.comgithub.com/NationalSecurityAgency/ghidra/security/advisories/GHSA-3r55-xjr4-jh8f
vulncheck.comvulncheck.com/advisories/ghidra-path-traversal-via-zip-slip-in-theme-import

Frequently asked

questions

Not directly in typical setups. Exploitation usually requires convincing a user to import a malicious theme ZIP or having local access to supply such a file, though this can be facilitated through phishing or distribution via untrusted theme repositories.

The attacker needs the ability to influence the theme ZIP that Ghidra imports. This may involve local access, sharing a crafted file, or hosting a downloadable theme that the victim chooses to import. The resulting impact depends on the filesystem permissions of the account running Ghidra.

Enforce strict path validation for all files extracted from ZIP archives: canonicalize paths, ensure they remain under a predefined base directory, and reject any entry that attempts to escape this directory or use absolute paths.

Adopt secure archive-handling patterns by default, treat all imported packages (themes, plugins, extensions) as untrusted, and incorporate automated checks and code review guidelines that specifically look for directory traversal risks in file extraction and import routines.

Find out what's already
exploitable in your codebase.