Skip to content

Replace hardcoded PROVISION_KEY authentication-bypass opcodes #481

Description

@coderabbitai

Summary

Replace the fragile hardcoded PROVISION_KEY bypass opcodes in PROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cpp with an authoritative command-ID source or generated binding.

Rationale

The current bypass allowlist uses literal values for the UART, LoRa, and S-band TcSecurityDeframer.PROVISION_KEY commands:

  • 0x2100B002
  • 0x2200B002
  • 0x2300B002

These values depend on the command order in TcSecurityDeframer.fpp. Adding or reordering commands before PROVISION_KEY could silently cause authentication bypass to apply to a different command.

Affected area

  • PROVESFlightControllerReference/Components/ProvesRouter/Bypasser.cpp
  • Generated/deployment command-ID definitions or the deployment topology dictionary
  • Tests for bypass policy / command-ID mapping, if available

Required changes

  1. Identify a build-time or generated source of truth for the deployed command IDs.
  2. Make the bypass policy refer to that source instead of manually maintained opcode literals, while retaining the UART, LoRa, and S-band provisioning mappings.
  3. Add validation or tests that catch a command-order change causing the provisioning bypass mapping to drift.
  4. Keep the bootstrap-only behavior: only PROVISION_KEY should bypass authentication.

Acceptance criteria

  • No manually maintained 0x2100B002, 0x2200B002, or 0x2300B002 provisioning opcode literals remain in the bypass allowlist.
  • The three intended PROVISION_KEY commands remain bypassable.
  • A future insertion/reordering of TcSecurityDeframer commands cannot silently bypass a different command.
  • Relevant tests or validation pass.

Backlinks

Requested by: @nateinaction

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions