Your device reassembles bytes from a wireless peer, confirms the checksum, and hands them to the app. Nobody checked whether the peer was who it claimed to be.
What goes wrong
A checksum tells you the bytes did not get scrambled in transit. It says nothing about who sent them. This handler tracks CRC failure counts, so it looks careful, but a passing CRC only means the frame is well formed. An impersonating peer produces well-formed frames too.
Once the payload is complete, it goes straight to the application listener as if the real device sent it. There is no signature and no check that this peer holds the key you paired with. If pairing is not enforced somewhere upstream, any radio in range that speaks the protocol can feed your app whatever response it likes.
The gap hides because the code is busy. Counters increment and frames get validated, and all of that is transport hygiene. Authenticity is a separate question, and this layer never asks it.
The pattern
function onFrame(frame) {
if (crc(frame) != frame.checksum) {
crcFailures++
return
}
buffer.append(frame.bytes)
if (frame.isLast) {
listener.onResponse(buffer.complete()) // trusted as authentic
}
}function onFrame(frame) {
if (crc(frame) != frame.checksum) { crcFailures++; return }
buffer.append(frame.bytes)
if (frame.isLast) {
let msg = buffer.complete()
if (!verifyMac(msg, sessionKey)) { reject(); return } // proves origin
listener.onResponse(msg)
}
}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.
Why it matters to you
If your app trusts this response for anything real (a balance shown to the user, a command marked done), an attacker within radio range can forge it. BLE range is short, but short includes the coffee shop table next to yours and the crowded train home. Treat data from a wireless peer the way you treat data from the internet: unauthenticated until a key says otherwise.
Check your own code
- Find every place a wireless payload reaches application code and ask what proves the sender's identity.
- Confirm checksum logic is never mistaken for an authenticity check.
- Require a MAC or signature bound to the paired session before delivering a response.
- Verify that pairing or bonding is actually enforced, not assumed to happen elsewhere.