Skip to content

P1: OTA Binary Verification — Verify firmware before flashing #78

Description

@stritti

Background

The OTA download path streams the firmware binary directly into Update.write() without any integrity check before committing. A MITM on the shared network can replace the .bin during download and the device will flash the attacker-controlled binary.

Required Changes

  1. SHA-256 hash verification: Compute hash of downloaded stream and compare against expected hash from GitHub release metadata
  2. Ed25519 signature verification (long-term): Verify binary signature using compiled-in public key
  3. Graceful failure: On verification failure, abort update, keep UI state for retry

Affected Files

  • src/OtaUpdater.cppdownloadAndApply(), fetchLatestRelease()
  • src/OtaUpdater.hpp — New constants and helpers
  • scripts/sign-release.sh — New signing script (phase 2)
  • .github/workflows/release.yml — Add signing step (phase 2)

OpenSpec

Full specification: openspec/specs/ota-binary-verification.spec.md
Change marker: openspec/changes/p1-ota-binary-verification/

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 — must fix before next releaseenhancementNew feature or requestsecuritySecurity-related issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions