Blog / A07:2021 Identification and Authentication Failures
A07:2021 · Identification and Authentication Failures

A CRC Check Is Not a Signature

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.

peer sends chunkshandlerreassembles bytesonly CRC ischeckeddata passed toappforged responseacceptedATTACKER INPUTIMPACTtrust boundary crossed
Attack path · peer sends chunks → handler reassembles bytes → only CRC is checked → data passed to app → forged response accepted

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

Vulnerable
function onFrame(frame) {
  if (crc(frame) != frame.checksum) {
    crcFailures++
    return
  }
  buffer.append(frame.bytes)
  if (frame.isLast) {
    listener.onResponse(buffer.complete())  // trusted as authentic
  }
}
Hardened
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)
  }
}
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

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