fix(controller): verify download integrity + fail closed on TLS (D6)#12
Merged
Merged
Conversation
The rootfs is downloaded (latest_*.meta4 -> .tar.gz) and then extracted and executed as root, but Aria2Manager performed no integrity check and silently downgraded to --check-certificate=false when cacert.pem was missing. A compromised mirror or MITM could deliver a malicious rootfs (tech-debt D6). - TLS fail-closed: require cacert.pem (abort with a clear error if it cannot be provisioned) and always pass --check-certificate=true. The insecure fallback is removed. Applies to all aria2 downloads (rootfs + ZIM). - Integrity: add --check-integrity=true so aria2 verifies the SHA-256 checksums published in the .meta4 (file-level + per-piece) during the download. On mismatch aria2 exits non-zero, onError fires and the archive is never extracted/executed. This uses the server's published hash over a verified TLS channel, so no redundant on-device re-hash of the ~1.2 GB file is needed. Out of scope (separate items): ZIM content integrity (Kiwix publishes no embedded hash today) and the cleartext OTA APK path in MainActivity (F15).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rootfs is downloaded (latest_*.meta4 -> .tar.gz) and then extracted and executed as root, but Aria2Manager performed no integrity check and silently downgraded to --check-certificate=false when cacert.pem was missing. A compromised mirror or MITM could deliver a malicious rootfs (tech-debt D6).
Out of scope (separate items): ZIM content integrity (Kiwix publishes no embedded hash today) and the cleartext OTA APK path in MainActivity (F15).