The advertisement carried the first five bytes of the key. The scan response returned the other 27 in the clear. A radio and a few seconds gets you the whole thing.
What goes wrong
BLE advertisements and scan responses are public. Anything you put in them is readable by any radio in range, with no pairing required and nobody's permission asked. So when a scan response returns bytes 5 through 31 of a key as-is, those bytes are on the air for anyone who cares to listen.
Splitting the key across two payloads feels like it hides something, but both payloads are observable in the same pass. Combine the five bytes riding in the advertisement with the 27 here and you have reconstructed a 32-byte key without touching the device. Obscurity across two public channels is still two public channels.
The pattern
byte[] buildScanResponse(byte[] key) {
// return the tail of the key so the advert stays small
byte[] out = new byte[27];
copy(key, 5, out, 0, 27); // raw key bytes, no masking
return out;
}byte[] buildScanResponse(DeviceId id) {
// advertise a public handle, never key material
return publicHandle(id);
}
// the shared key is agreed after an authenticated pairing,
// off the air, and never appears in a broadcast payloadGrounding 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.
Why it matters to you
If your device broadcasts anything derived straight from a long-term secret, treat that secret as published. An attacker records the payloads once and can decrypt your traffic or clone the device for as long as the key lives.
For a shipped BLE product this is a field-level compromise, not a lab curiosity. Every unit that ever transmitted is exposed to anyone who was in range with a cheap sniffer.
Check your own code
- List every byte you place in advertisements and scan responses; none should originate from a key.
- Treat all pre-connection radio data as world-readable and permanently recorded.
- Move key agreement into an authenticated pairing step instead of the beacon.