firmware icon indicating copy to clipboard operation
firmware copied to clipboard

fix(HeavyButter): add SHA-256 integrity verification for App Store downloads

Open r13xr13 opened this issue 5 months ago • 0 comments

Summary

Adds SHA-256 integrity checking to App Store downloads to prevent tampered scripts from being installed.

Changes

  • Add verify_sha256() helper using mbedtls SHA-256
  • Add EXPECTED_APPSTORE_SHA256 build-time macro (empty = check skipped)
  • Download content is fetched first, hash verified, then only saved if integrity check passes
  • If hash mismatch, user sees warning and file is not written

Security Impact

Before: Anyone who can MITM the HTTP connection (or compromise the server) can inject arbitrary JS that runs with full device permissions.

After: The App Store script hash is pinned in firmware. Mismatched content is rejected. The maintainer sets the expected hash once the server content is verified.

r13xr13 avatar Jun 08 '26 07:06 r13xr13