Skip to content

BLE pairing on boards without a button accepts any phone for 60 s after every boot #18

Closed

Description

@Tichael

Problem

  • When pairing_button_pin isn't set (the WiCAN profile sets it to -1, in hardware-profiles/meatpi-wican-esp32c3.toml:32), ble_lifecycle_task opens the pairing window for pairing_window_seconds (60 s) on every boot (boards/esp/src/ble/lifecycle.rs:91).
  • Pairing uses IoCapabilities::NoInputNoOutput (boards/esp/src/ble/transport.rs:173). That's Just Works pairing: unauthenticated, with no MITM protection and no user confirmation.
  • So any phone in range after a reboot, watchdog reset or brownout can bond, and bonded phones are trusted from then on.
  • docs/ble.md doesn't describe the automatic opening on boot yet.

Impact
Low while v1 is read-only: someone can read the car's state. It must be fixed before E-GMP commands are enabled, because then a bonded phone can control the car.

Ideas

  • Open the window at boot only while no phone is bonded (first setup), and require a deliberate action after that: a bonded phone's command, or a physical action such as unplugging and replugging the device a set number of times.
  • Use authenticated pairing (passkey or numeric comparison) where the hardware allows it, e.g. a code shown in the app and confirmed with a pattern on the device's LED.
  • Cover this in the setup wizard (Create a proper setup wizard for vehicles contracts#10).
  • Document the behaviour in docs/ble.md.

Done when
A stranger near the car can't bond during a normal reboot, and the pairing flow is documented.

From the audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions