Commit Graph

3 Commits

Author SHA1 Message Date
Leonid Pliushch 7e89e130ce apply prefix verification patches again - now shouldn't cause crash 2020-09-28 02:54:13 +03:00
Leonid Pliushch a6102de687 Revert "add patches for prefix verification"
This reverts commit 2703e4f68f856bb816c695ab53118306ba8104a4.

https://github.com/termux/termux-packages/issues/5858 - seem to be buffer overflow...
2020-09-28 01:37:34 +03:00
Leonid Pliushch 9d92a7360c add patches for prefix verification - prevent use of prebuilt packages by third parties
Add a small stub which verifies whether /data/data/com.termux/files/usr is readable
into few important packages such like Bash or APT. If this check fails, e.g.
in case if binary was executed in program with different package name (non-Termux),
program will print warning and exit with error status immediately.

This should prevent use of prebuilt packages by third-party applications.

NOTE: for now it uses /data/data/com.termux/files/usr in reversed order to
prevent automatic "blind" patching with sed. Will replace with randomized
XOR-based variant in case if that measure won't be enough.
2020-09-28 00:10:00 +03:00