/

CVE-2026-54684

Severity:

HIGH RISK

(7.0)

Directory Traversal (CWE-22) in jadx XAPK Plugin Loader

CVE-2026-54684

Deferred

Vulnerability type

Category:

Directory Traversal / Path Manipulation

CWE:

CWE-22

Impact:

Arbitrary File Write leading to Code Execution

Severity:

HIGH RISK

(7.0)

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

A directory traversal flaw in the jadx XAPK plugin loader allows a crafted .xapk archive to write files outside the intended temporary unpack directory.

When certain path and launch conditions are met, an attacker-controlled JAR can be planted in the plugins directory, leading to execution of malicious plugin code on subsequent jadx runs.

Affected context

This vulnerability appears when jadx processes untrusted .xapk files using the XAPK plugin loader in versions 1.5.2 through 1.5.5.

It is most relevant on systems where:

  • Users open .xapk files from arbitrary sources,
  • The current working directory for launching jadx is an ancestor of the configuration directory,
  • The plugins dropins directory is located under that ancestor path.

Under these conditions, path resolution during XAPK unpacking can escape the temporary directory and reach the plugins location.

Exploit preconditions

  • Attack surface: Local desktop or build environment where a user runs jadx on attacker-supplied .xapk files.
  • Required access: Ability to convince a user or automated process to open a malicious .xapk with a vulnerable version of jadx.
  • Trigger point: XAPK unpacking via XApkLoader, which resolves archive entry names with tmpDir.resolve(fileName) after a current-working-directory-based ZIP path check.
  • Why exploitation is possible: The security check is tied to the current working directory and does not enforce that resolved paths stay inside the dedicated temporary unpack directory. A crafted entry name can escape tmpDir and target plugins/dropins, allowing arbitrary JAR placement that is later loaded by URLClassLoader and ServiceLoader.

Why this happens

The core issue is improper validation and normalization of file paths derived from archive entry names, a pattern associated with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Instead of enforcing that all extracted entries remain within the XAPK temporary directory, the implementation relies on a current-working-directory-based ZIP security check and then directly calls tmpDir.resolve(fileName). This approach trusts the archive entry names to be safe and does not robustly prevent directory traversal or path escape.

As a result, a malicious archive can cause files to be written outside the intended unpack directory, including into the configurable plugins dropins folder, where they are later treated as trusted plugin JARs and loaded for execution.

Potential impact

  • An attacker-controlled JAR may be written into the plugins/dropins directory.
  • Malicious plugin code can be executed during subsequent jadx runs.
  • The user's local jadx environment could be fully compromised.
  • Arbitrary code execution can occur in the context of the user running jadx.
  • Local files accessible to the user may be read or modified by attacker-controlled plugin logic.

General mitigation guidance

Effective mitigation focuses on tightening path handling during archive extraction and reducing trust in plugin discovery paths.

Common defensive patterns include:

  • Ensuring archive extraction routines enforce that all resolved paths remain within a dedicated, restricted directory (e.g., by normalizing paths and checking ancestry before writes).
  • Rejecting archive entries that contain path traversal components or absolute paths.
  • Treating plugin directories as sensitive and limiting how and from where plugin JARs can be discovered.
  • Running tools that process untrusted archives with least privilege, so even if an arbitrary file write occurs, it has minimal impact.
  • Applying a secure-by-default configuration that disables automatic plugin loading from writable locations or requires explicit user confirmation.

How teams detect issues like this

Detection typically combines code-level inspection with runtime monitoring:

  • Static analysis or manual code review focusing on archive extraction logic that uses Path.resolve, File constructors, or similar APIs without strict directory-bound checks.
  • Searching for patterns where user-controlled archive entry names or filenames are written directly to disk, especially near plugin or configuration paths.
  • Enforcing organizational coding standards that require path normalization and base-directory checks for all extraction and unpack routines.
  • Using automated review tools or SAST configurations to flag potential directory traversal issues around ZIP/TAR handling and plugin loading flows.

Sources

SourceLink
github.comgithub.com/skylot/jadx/commit/a74bb07d6eebaf4da5c2b2cbc4d3c0c3cb7517cb
github.comgithub.com/skylot/jadx/releases/tag/v1.5.6
github.comgithub.com/skylot/jadx/security/advisories/GHSA-gpvc-ccw7-744v

Frequently asked

questions

It is not network-exposed by itself. Exploitation requires a user or system to locally run a vulnerable version of jadx on a malicious .xapk file, which can be delivered via email, downloads, or other distribution channels.

The attacker needs the ability to supply a crafted .xapk that the victim processes with jadx. The actual code execution occurs in the context of the victim's user account when the malicious plugin JAR is later loaded.

The safest pattern is to enforce strict path confinement during archive extraction so that all resolved paths remain under a dedicated temporary directory, combined with more defensive plugin loading behavior that does not automatically trust newly written JARs from user-writable paths.

Adopt consistent secure file handling practices for any archive or plugin-related features: normalize and validate paths, disallow traversal sequences and absolute paths, treat plugins as high-trust components with controlled deployment, and incorporate security-focused code review and automated checks into the development process.

Find out what's already
exploitable in your codebase.