CVE-2026-86046: termux-sync Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-259w-wmqg-fp76
CVSS 7.1
CWE-22
Published
Advisory Summary

CVE-2026-86046 is a HIGH (CVSS 7.1) remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting termux-sync libraries in the PyPI ecosystem. The issue involves arbitrary file write during restore via attacker-controlled manifest source path. Remediation is available by upgrading affected packages to version 1.2.4.

CVE-2026-86046 at a Glance

CVE Identifier CVE-2026-86046
GHSA Identifier GHSA-259w-wmqg-fp76
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product termux-sync
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-86046

To remediate this vulnerability, upgrade all affected termux-sync dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

termux-sync fixed: 1.2.4
pip install termux-sync>=1.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show termux-sync

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-86046, inspect your installed packages using pip:

pip show termux-sync

Analyze the terminal output to locate any version of termux-sync in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.4), your application is affected.

Note: The pip show termux-sync command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In termux-sync, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

termux-sync restore trusts fields inside an untrusted backup manifest and uses them as the extraction destination without validation. During restore, each archive entry is handled as: src_dir = Path(info.get("source", ...)).parent extract_archive(archive, src_dir, ...) extract_archive opens the archive and runs tarfile.extract for every member with no path jail and no filter: with tarfile.open(archive_path, "r:*") as tf: for member in tf.getmembers(): tf.extract(member, dest_path, set_attrs=True) There is no check that manifest "source" stays under an expected restore root, that tar members stay inside dest_path, or that backup_name used in temporary paths cannot contain ".." or separators. Impact: A victim who restores a malicious backup (local, shared, or from a compromised GitHub/Google Drive storage backend) can have arbitrary files written anywhere the Termux user can write. Overwriting shell startup files or executable scripts leads to local code execution on later use. Reproduction (benign markers only): 1. Build a backup directory with home.tar.gz (members: proof filename + optional config names) and manifest.json. 2. Set files.home.source to any path whose parent is the desired write directory (e.g. $HOME/dummy_for_parent so parent is $HOME). 3. Run the same extract path the tool uses: src_dir = Path(source).parent; tarfile.extract each member into src_dir. 4. Observe attacker-controlled files created under $HOME and under other chosen roots (config / shell-rc style overwrite). Expected: restore only writes under fixed, validated roots; reject unsafe source values and members that resolve outside dest. Actual: write destination is fully controlled by manifest.source; proof files and overwrites appear outside any intended jail. Fix direction: - Do not trust manifest "source" for extract roots; use fixed app-defined destinations - Sanitize backup_name (basename; reject ".." and separators) - Extract with tarfile filter="data" (or equivalent boundary checks) and refuse escape - Treat backups as untrusted input Actual result (local marker-only reproduction): PROOF path: /data/data/com.termux/files/home/PWNED_BY_TERMUX_SYNC_RESTORE.txt PROOF exists? True PROOF content: PWNED This file was written by a malicious termux-sync backup restore path. Root cause: manifest files.*.source controls extract destination. *** VULN CONFIRMED: arbitrary write to $HOME *** important.conf => secret=ATTACKER_CONTROLLED *** VULN CONFIRMED: overwrite under attacker-chosen root *** .bashrc_sim shows injected: export ATTACKER=1 *** VULN CONFIRMED: startup-file style overwrite *** Extract roots used: home -> parent($HOME/dummy_for_parent) = $HOME config -> parent(.../victim_sim/nested_dummy) = .../victim_sim Reported and credited to Niranj R Mahaswar ( GitHub: @NiranjMahaswar )

CVE-2026-86046 Affected termux-sync Versions

1 component(s)
Fixed Versions:
1.2.4
Product / Package Ecosystem Affected Versions Fixed Version
termux-sync
PyPI
< 1.2.4
1.2.4

References

Frequently Asked Questions

What is CVE-2026-86046?
CVE-2026-86046 is a security vulnerability in termux-sync involving Arbitrary file write during restore via attacker-controlled manifest source path under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which termux-sync versions are affected?
Affected versions include releases prior to 1.2.4 across affected packages: termux-sync.
What version fixes CVE-2026-86046?
Upgrading to 1.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is termux-sync affected?
Yes, termux-sync is affected in releases prior to 1.2.4. Upgrade your dependency to 1.2.4 or later.
What is the CVSS score of CVE-2026-86046?
CVE-2026-86046 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2026-86046?
CVE-2026-86046 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2026-86046?
Run the dependency tree command: 'pip show termux-sync'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-259w-wmqg-fp76",
  "modified" : "2026-11-16T22:09:24Z",
  "published" : "2026-11-16T22:09:24Z",
  "aliases" : [ "CVE-2026-86046" ],
  "summary" : "termux-sync: Arbitrary file write during restore via attacker-controlled manifest source path",
  "details" : "termux-sync restore trusts fields inside an untrusted backup manifest and uses them as the extraction destination without validation.\n\nDuring restore, each archive entry is handled as:\n\n  src_dir = Path(info.get(\"source\", ...)).parent\n  extract_archive(archive, src_dir, ...)\n\nextract_archive opens the archive and runs tarfile.extract for every member with no path jail and no filter:\n\n  with tarfile.open(archive_path, \"r:*\") as tf:\n      for member in tf.getmembers():\n          tf.extract(member, dest_path, set_attrs=True)\n\nThere is no check that manifest \"source\" stays under an expected restore root, that tar members stay inside dest_path, or that backup_name used in temporary paths cannot contain \"..\" or separators.\n\nImpact:\nA victim who restores a malicious backup (local, shared, or from a compromised GitHub/Google Drive storage backend) can have arbitrary files written anywhere the Termux user can write. Overwriting shell startup files or executable scripts leads to local code execution on later use.\n\nReproduction (benign markers only):\n\n1. Build a backup directory with home.tar.gz (members: proof filename + optional config names) and manifest.json.\n2. Set files.home.source to any path whose parent is the desired write directory (e.g. $HOME/dummy_for_parent so parent is $HOME).\n3. Run the same extract path the tool uses: src_dir = Path(source).parent; tarfile.extract each member into src_dir.\n4. Observe attacker-controlled files created under $HOME and under other chosen roots (config / shell-rc style overwrite).\n\nExpected: restore only writes under fixed, validated roots; reject unsafe source values and members that resolve outside dest.\nActual: write destination is fully controlled by manifest.source; proof files and overwrites appear outside any intended jail.\n\nFix direction:\n- Do not trust manifest \"source\" for extract roots; use fixed app-defined destinations\n- Sanitize backup_name (basename; reject \"..\" and separators)\n- Extract with tarfile filter=\"data\" (or equivalent boundary checks) and refuse escape\n- Treat backups as untrusted input\n\nActual result (local marker-only reproduction):\n\nPROOF path: /data/data/com.termux/files/home/PWNED_BY_TERMUX_SYNC_RESTORE.txt\nPROOF exists? True\nPROOF content:\nPWNED\nThis file was written by a malicious termux-sync backup restore path.\nRoot cause: manifest files.*.source controls extract destination.\n\n*** VULN CONFIRMED: arbitrary write to $HOME ***\n\nimportant.conf => secret=ATTACKER_CONTROLLED\n*** VULN CONFIRMED: overwrite under attacker-chosen root ***\n\n.bashrc_sim shows injected:\nexport ATTACKER=1\n*** VULN CONFIRMED: startup-file style overwrite ***\n\nExtract roots used:\n  home  -> parent($HOME/dummy_for_parent) = $HOME\n  config -> parent(.../victim_sim/nested_dummy) = .../victim_sim\n\nReported and credited to Niranj R Mahaswar ( GitHub: @NiranjMahaswar )",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "termux-sync"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/djunekz/termux-sync/security/advisories/GHSA-259w-wmqg-fp76"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-86046"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/djunekz/termux-sync/commit/9c8637b280ee3e126885def5ff5b326c289ee7cf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/djunekz/termux-sync"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/djunekz/termux-sync/releases/tag/v1.2.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-16T22:09:24Z",
    "nvd_published_at" : "2026-11-16T17:17:35Z"
  }
}