TERMUX-SYNC · CVE-2026-86046 · Package
FIX → 1.2.4
termux-sync trusts the source path in a backup's manifest when restoring, so the extraction destination is chosen by the backup file. A crafted backup can make restore write or overwrite arbitrary files the Termux user can modify, such as shell startup files, which can lead to code running later.
first public Jul 28, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Anyone who runs termux-sync restore on a backup they did not create, including backups from shared folders or from a compromised cloud storage account. Users who only create backups or never restore untrusted ones are much less exposed. unknown for the exact vendor build range.
Not affected if no-untrusted-restore, version-1.2.4-or-later
Who cares android, python, shell, termux, termux-sync
pip show termux-sync; versions up to 1.2.3 are affected.termux-sync in any Termux setup scripts or Python environments that run restore.Upgrade to 1.2.4
termux-sync 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):
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:
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
1.2.4Actual 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 )
This page as .md · .json · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
NVD data is provided by NIST and is public domain · GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.