/

CVE-2026-86046

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in termux-sync Backup Restore

CVE-2026-86046

Received

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

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

termux-sync restore can extract files from a malicious or tampered backup outside the intended destination because archive members are not confined to a safe directory. If a user restores such a backup, files may be written anywhere the Termux user can write, potentially enabling code execution when an affected file is later used.

Affected context

The issue occurs during backup restoration when untrusted manifest values influence extraction destinations and archive members are extracted without enforcing a destination boundary. Risk depends on a user restoring a malicious or tampered backup, which may be stored locally or obtained through shared, GitHub, or Google Drive storage. Unsafe backup names can also affect temporary paths.

Exploit preconditions

  • Attack surface: The termux-sync restore workflow.
  • Required access: An attacker must be able to provide or tamper with a backup that the victim can access; the victim must initiate its restoration.
  • Trigger point: Restore processing of manifest values and archive members.
  • Why exploitation is possible: The restore process does not reliably constrain extraction paths to the intended destination, allowing crafted paths to resolve elsewhere within the Termux user's writable filesystem.

Why this happens

This is a path traversal weakness mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). The underlying insecure pattern is using untrusted path values to determine extraction or temporary locations without validating and enforcing that resolved paths remain within an approved directory. Extracting archive members without a destination boundary can let member paths escape that directory.

Potential impact

  • An attacker may cause files to be written to locations the Termux user can modify.
  • Shell startup files or executable scripts could be replaced or altered.
  • Malicious changes could lead to code execution when affected files are later loaded or run.
  • User data or the Termux environment could be damaged or manipulated.

General mitigation guidance

Defensive patterns focus on treating backup contents and metadata as untrusted and confining all filesystem operations.

  • Use archive extraction methods that prevent paths from escaping a designated destination.
  • Resolve and validate each output path, rejecting paths outside the approved extraction root.
  • Validate backup names and manifest paths before using them in temporary or destination paths.
  • Prefer restrictive allowlists for expected archive entries and file types.
  • Limit the permissions of the restore process and avoid restoring backups from untrusted sources without review.

How teams detect issues like this

  • Use static analysis to identify archive extraction calls and filesystem operations that consume untrusted paths.
  • Review whether resolved extraction paths are checked against a canonical destination boundary.
  • Check that manifest fields and backup names are validated before being used in filesystem paths.
  • Add tests and CI policy checks for path traversal attempts in archive entries and metadata.
  • Monitor restore operations for unexpected writes outside the intended backup destination.

Sources

SourceLink
github.comgithub.com/djunekz/termux-sync/commit/9c8637b280ee3e126885def5ff5b326c289ee7cf
github.comgithub.com/djunekz/termux-sync/releases/tag/v1.2.4
github.comgithub.com/djunekz/termux-sync/security/advisories/GHSA-259w-wmqg-fp76

Frequently asked

questions

The described attack requires a victim to restore a malicious or tampered backup. The backup may be obtained through local or shared storage, GitHub, or Google Drive; the description does not indicate that simply accessing a remote service triggers the issue.

An attacker needs a way to supply or tamper with a backup that the victim will restore. The victim's restore action is the trigger.

Confine extraction to a canonical, explicitly approved destination and reject any archive or metadata paths that resolve outside it. Validate backup names before using them in filesystem paths.

Treat archive contents and backup metadata as untrusted, use safe extraction patterns, test path boundary enforcement, and apply least privilege to restore operations.

Find out what's already
exploitable in your codebase.