/

CVE-2026-27115

Severity:

HIGH RISK

(7.1)

Improper Input Validation / Path Handling in ADB Explorer

CVE-2026-27115

Analyzed

Vulnerability type

Category:

Improper Input Validation / Path Handling

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File/Directory Deletion and Data Loss

Severity:

HIGH RISK

(7.1)

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

ADB Explorer for Windows allows an unvalidated command-line argument to control its data directory, leading to recursive deletion of arbitrary directories.

If a user is tricked into launching ADB Explorer with a crafted shortcut or script that points to a sensitive path, all subdirectories under that path can be permanently deleted outside the Recycle Bin.

Affected context

This vulnerability appears when ADB Explorer is invoked with a custom data directory path via the command line.

The application only verifies that the supplied path exists and then, during startup and exit, iterates through its subdirectories calling a recursive delete operation.

In typical use, a benign application-specific data directory is passed, but when an attacker controls the shortcut, script, or launcher that invokes ADB Explorer, they can substitute a critical filesystem location such as a user's Documents folder or other data-bearing directories.

Exploit preconditions

  • Attack surface: Local, via command-line invocation on Windows (e.g., .lnk shortcuts, batch files, scripts, or process launchers).
  • Required access: Ability to create or modify how ADB Explorer is launched for a victim user (e.g., placing a crafted shortcut on the desktop, in a shared folder, or within a toolchain).
  • Trigger point: User executes ADB Explorer through the attacker-crafted command line that supplies a sensitive directory as the data directory parameter.
  • Why exploitation is possible: The application trusts the path argument as safe and, after checking only that it exists, performs recursive deletions of all subdirectories at startup and shutdown without restricting the target to an application-owned or sandboxed directory.

Why this happens

The core issue is improper path handling combined with overly broad file system operations.

ADB Explorer accepts a user-specified path for its data directory and validates only existence, not whether the path is within a trusted, application-controlled location or whether it points to a protected directory.

The ClearDrag() method then calls Directory.Delete(dir, true) on every subdirectory under that path during lifecycle events, effectively turning a convenience cleanup routine into a powerful deletion primitive that can be redirected to arbitrary locations.

This maps to CWE-22: Path Traversal / Improper Limitation of a Pathname to a Restricted Directory and CWE-73: External Control of File Name or Path, where external input controls which files or directories are affected by destructive operations.

Potential impact

  • Permanent deletion of all subdirectories within a user's Documents, Desktop, Downloads, or other critical folders.
  • Loss of project directories, source code repositories, and application data stored under targeted paths.
  • Deletion of configuration directories, potentially destabilizing other applications or user environments.
  • Facilitation of further impact if critical data (e.g., local backups) resides in the targeted directory tree.

General mitigation guidance

Effective mitigation focuses on restricting which directories the application will accept and operate on, and on minimizing the blast radius of cleanup routines.

Common defensive patterns include:

  • Constraining the data directory to a known, application-controlled root (e.g., under %APPDATA% or another dedicated application folder), ignoring external paths that fall outside this boundary.
  • Implementing strict validation to reject absolute paths, parent directory references, or system-sensitive locations, and using canonicalization before checks.
  • Separating user-configurable locations from locations on which destructive operations are performed, or requiring explicit, in-UI confirmation when non-default paths are used for cleanup.
  • Using least-privilege principles for filesystem access, avoiding operations that recursively delete arbitrary directory trees.
  • Designing cleanup routines to target only known, application-created files and directories rather than every subdirectory under a configurable root.

How teams detect issues like this

Detection typically involves reviewing how command-line parameters and configuration paths are consumed by the application and how they influence filesystem operations.

Possible approaches include:

  • Static analysis rules that flag calls to recursive delete operations (e.g., Directory.Delete(path, true)) when the path is derived from command-line arguments, environment variables, or other external inputs.
  • Code review checklists that require verifying any externally controlled paths are constrained to application-owned directories and that destructive operations operate only within those boundaries.
  • Instrumentation or logging that records when cleanup routines affect unexpected directories, enabling runtime monitoring and post-incident analysis.
  • Build- and CI-integrated policy checks that detect new code paths where external inputs control file paths used in delete, move, or overwrite operations.

Sources

SourceLink
github.comgithub.com/Alex4SSB/ADB-Explorer/commit/f7554690b1f68c6066c12aa45aec60303bca545b
github.comgithub.com/Alex4SSB/ADB-Explorer/releases/tag/v0.9.26021
github.comgithub.com/Alex4SSB/ADB-Explorer/security/advisories/GHSA-rg2h-2p33-rxcr

Frequently asked

questions

Not directly. The vulnerability is local in nature, but an attacker can deliver a crafted shortcut or script through common channels (email attachments, shared drives, installer bundles) that a user might execute, making it practically exploitable through social engineering.

An attacker must be able to influence how ADB Explorer is launched for the victim. This can be as simple as convincing the user to run a provided shortcut or script; they do not need administrative privileges if the victim's user account has permission to delete the targeted directories.

Restrict the data directory to a fixed, application-controlled root and prevent destructive operations from acting on arbitrary user-supplied paths. Instead of accepting unrestricted directories from the command line, use internally derived paths and apply strict allowlisting and canonicalization.

Treat any file path influenced by external input as untrusted, and ensure destructive filesystem operations are confined to well-defined, application-owned areas. Combine this with defense-in-depth measures such as code review guidelines for path handling, static analysis rules targeting externally controlled paths, and cautious design of cleanup and maintenance routines.

Find out what's already
exploitable in your codebase.