/

CVE-2026-52752

Severity:

HIGH RISK

(7.8)

Path Traversal (CWE-22) in Ghidra Extension Installer

CVE-2026-52752

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's extension installer before version 12.0.2 contains a path traversal flaw that fails to validate ZIP entry names during extraction.

A malicious extension can use crafted filenames with directory traversal sequences to write files outside the intended directory, potentially leading to arbitrary code execution when those files are later loaded or executed.

Affected context

This vulnerability affects environments where Ghidra's extension installer is used to import extensions packaged as ZIP files.

Risk increases when users install extensions from untrusted or third-party sources, and when Ghidra runs with elevated filesystem permissions.

The issue occurs during extension extraction, where ZIP entries are written to disk without sufficient checks on their paths, allowing writes outside the designated extension directory.

Exploit preconditions

  • Attack surface: Ghidra extension installation mechanism that processes ZIP-based extension packages.
  • Required access: Ability to convince a user to install a malicious extension ZIP, or otherwise supply a crafted extension to the installer.
  • Trigger point: User initiates installation of the crafted extension; the installer extracts ZIP entries.
  • Why exploitation is possible: The installer does not normalize and validate ZIP entry paths to ensure they remain within the target directory, allowing directory traversal sequences (e.g., ../) to control final write locations.

Why this happens

The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

The extension installer trusts file paths embedded in ZIP entries and writes them directly to the filesystem without canonicalizing paths and enforcing that targets remain within the intended extension directory.

This missing validation allows attackers to use relative path segments and directory traversal to escape the designated extraction root and overwrite or create arbitrary files.

Potential impact

  • Malicious files may be written outside the extension directory, including into user or application configuration paths.
  • Existing scripts, libraries, or executables could be overwritten, potentially leading to arbitrary code execution.
  • Persistent backdoors or unauthorized tooling can be planted in directories that Ghidra or other applications later load.
  • Security settings, project data, or logs could be modified or corrupted, affecting integrity and availability.

General mitigation guidance

Effective mitigation focuses on strict path handling and minimizing the trust placed in archive contents.

Common defensive patterns include:

  • Normalizing and canonicalizing all archive entry paths before extraction and verifying they resolve under the intended base directory.
  • Explicitly rejecting entries containing .., absolute paths, or path separators that escape the target directory.
  • Extracting only to a controlled, application-owned directory with restricted privileges.
  • Running Ghidra and its extension installation process with least-privilege filesystem permissions, avoiding unnecessary write access to sensitive locations.
  • Encouraging the use of extensions from trusted sources and signing or verifying extension packages where possible to reduce the attack surface.

How teams detect issues like this

Organizations and developers can detect this class of issue using:

  • Static code analysis rules that flag file extraction code not validating or canonicalizing archive entry paths before writing.
  • Manual code review focusing on ZIP or archive processing routines, verifying that a safe join check with a known root directory is performed.
  • Instrumentation or logging around extension installation that records extracted file paths, enabling anomaly detection for unexpected directories.
  • Security testing (including dynamic application security testing) that attempts to install crafted ZIPs with traversal sequences to confirm robust path validation.

Sources

SourceLink
github.comgithub.com/NationalSecurityAgency/ghidra/security/advisories/GHSA-jhc2-q7qf-9c25
vulncheck.comvulncheck.com/advisories/ghidra-path-traversal-in-extension-installer-via-zip-entry-names

Frequently asked

questions

It is not directly remotely exploitable in a traditional network sense; an attacker typically needs to supply a malicious extension ZIP and convince a user to install it. However, if an automated or remote workflow installs extensions from untrusted sources, the exposure can become effectively remote.

The attacker needs the ability to deliver a crafted extension package that the Ghidra user or automated system will install. The impact is constrained by the file system permissions available to the Ghidra process at installation time.

The safest fix is to canonicalize all ZIP entry paths and strictly enforce that the final resolved path remains within the designated extension directory, rejecting any entry that attempts to escape that directory or uses absolute paths.

Future prevention relies on a consistent secure file-handling strategy: never trust paths inside archives, always validate and normalize paths against a known root, minimize privileges of the installing process, and perform security reviews on any code that extracts archives or installs plugins from external sources.

Find out what's already
exploitable in your codebase.