chiark / gitweb /
update: reject APKs with invalid file sig, probably Janus exploits
authorHans-Christoph Steiner <hans@eds.org>
Mon, 11 Dec 2017 17:36:21 +0000 (18:36 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 14 Dec 2017 15:57:22 +0000 (16:57 +0100)
commitbde0558d82eb68c39d6c95eb80ed9c2eddea6ae6
tree1a16a05e0eb677c42b39219d36780c684ee3b872
parent5ce950e748fc064fe27d92eb81c0456b6a7b9d1b
update: reject APKs with invalid file sig, probably Janus exploits

This just checks the first four bytes of the APK file, aka the "file
signature", to make sure it is the ZIP signature and not the DEX signature.
This was checked against the test APK, and I ran it against some known
malware and all of f-droid.org to make sure it works.

All valid ZIP files (therefore APK files) should start with the ZIP
Local File Header of four bytes.

https://www.guardsquare.com/en/blog/new-android-vulnerability-allows-attackers-modify-apps-without-affecting-their-signatures
fdroidserver/update.py
tests/janus.apk [new file with mode: 0644]
tests/run-tests
tests/update.TestCase