Skip to content

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

Open
r13xr13 wants to merge 1 commit into
BruceDevices:mainfrom
r13xr13:fix/app-hash-verify-heavybutter
Open

fix(HeavyButter): add SHA-256 integrity verification for App Store downloads#2523
r13xr13 wants to merge 1 commit into
BruceDevices:mainfrom
r13xr13:fix/app-hash-verify-heavybutter

Conversation

@r13xr13

@r13xr13 r13xr13 commented Jun 8, 2026

Copy link
Copy Markdown

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.

…wnloads (AV-004)

- Add verify_sha256() helper using mbedtls SHA-256
- Add EXPECTED_APPSTORE_SHA256 macro (empty = check disabled)
- Verify downloaded App Store script hash before saving to LittleFS
- Reject downloads that fail integrity check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant