Blog / A02:2021 Cryptographic Failures
A02:2021 · Cryptographic Failures

The first five bytes of your key ride in the beacon

An advertisement payload is a broadcast to anyone in range. This one carried the leading bytes of a 32-byte key, and the scan response shipped the rest.

the device powerson and…the payloadbuilder…the beacontransmits…a sniffer inrange records itthe rest arrivesvia the…ATTACKER INPUTIMPACTwritten to logs
Attack path · the device powers on and starts advertising → the payload builder copies key bytes in → the beacon transmits several times a second → a sniffer in range records it → the rest arrives via the scan response

An advertisement payload is a broadcast to anyone in range. This one carried the leading bytes of a 32-byte key, and the scan response shipped the rest.

What goes wrong

An advertisement is a beacon your device shouts to nobody in particular, over and over. There's no session and no pairing, and nothing about a beacon is private. Copying key bytes into that payload puts them on the air for anyone holding a radio.

Here bytes 0 through 4 went into the advertisement. It does not matter that it is only five bytes. The scan response leaks the other 27, and even on its own a known five-byte prefix turns a brute force of the remainder from hopeless into a weekend. The mistake is treating identity and secrets as the same kind of data. A beacon should carry an identifier you're happy to publish, and key material should stay off the radio until you've authenticated the peer.

The pattern

Vulnerable
byte[] buildAdvertisement(byte[] key) {
  byte[] adv = new byte[5];
  // pack the leading bytes of the key into the beacon
  copy(key, 0, adv, 0, 5);
  return adv;   // now broadcasting several times a second
}
Hardened
byte[] buildAdvertisement() {
  // broadcast a rotating, non-secret handle only
  byte[] handle = rotatingId();
  return handle;
}
// key material is exchanged after pairing,
// and never appears in a broadcast payload
How the pipeline adjudicated itHELD
ABCDEFGH

Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.

Ed25519 · per-tenant signing key · gate ledger A–H · verify offline against the published payload hash

Why it matters to you

Once a secret has been broadcast it cannot be un-broadcast. A capture recorded at any point in the device's life still decrypts its traffic, because the key never changed.

If you ship BLE hardware, walk the advertisement builder line by line and ask where each byte came from. Anything sourced from a key or a seed is a recall-class bug waiting for the first person with a scanner.

Check your own code