GitHub advisory · PyPI
termux-sync: Restore extracts archive members outside the backed-up directory because the extraction jail is the parent of each backup root
Description
termux-sync restore extracts each archive into the parent of the directory that archive is supposed to hold. The containment check then compares members against that wider directory, so an archive declared as usr_etc or usr_lib can write anywhere under $PREFIX, including $PREFIX/bin.
This is a residual gap in the fix for GHSA-259w-wmqg-fp76 / CVE-2026-86046. The guards that advisory added all work. What survives is the choice of destination they are checked against.
Tested on:
termux-sync 1.3.6 installed from PyPI (termux_sync-1.3.6-py3-none-any.whl)054e6d88acf16c7d9b025846bcc2652b2975c68a on maintarfile.data_filter is availablerich==15.0.0, markdown-it-py==4.3.0, mdurl==0.1.2, Pygments==2.21.0Only 1.3.6 was tested. The primitive looks present in earlier releases, but unchecked. Releases before 9c8637b are already covered by CVE-2026-86046.
Main and the release differ only inside cmd_daemon. Lines 1 to 700, which hold all the archive and extraction code, are identical, so main has the same behaviour. termux-sync.py is a byte-identical copy of src/termux_sync/__init__.py, so the line numbers below apply to both.
An attacker who controls the content of a backup that a victim restores can write files anywhere under $PREFIX, overwriting existing ones. Replacing an executable such as $PREFIX/bin/sh gives code execution as the Termux user the next time anything invokes it, and it leaves dpkg's record of $PREFIX disagreeing with what is on disk.
Attacker requirements:
Manual fix · PyPI
pip install --upgrade "termux-sync>=1.3.8"Sources