Blog / A01:2021 Broken Access Control
A01:2021 · Broken Access Control

A second BLE connection can hijack the first's data

The peripheral tracks one peer in one field, replaced on every connect. An attacker who connects at the right moment becomes the destination for someone else's notifications.

Peripheral storesthe…The field isreplaced…Attacker connectsor interleaves…Their devicebecomes…Notifications forthe real…ATTACKER INPUTIMPACTwindow between check and use
Attack path · Peripheral stores the connected peer in one field → The field is replaced whenever any peer connects → Attacker connects or interleaves a callback → Their device becomes the stored target → Notifications for the real peer arrive at the attacker

The peripheral tracks one peer in one field, replaced on every connect. An attacker who connects at the right moment becomes the destination for someone else's notifications.

What goes wrong

Same shape as the classic single-peer bug, dialed up. The peripheral keeps one device field and replaces it on every connection callback, with no authentication of the remote and no per-peer bookkeeping. Whatever connected most recently is where the next notification goes.

An attacker in range can turn that into a hijack. Connect at the right moment, or interleave a callback with the legitimate peer's, and your device becomes the stored target. The peripheral then streams its outbound notifications to you, including whatever the real peer was supposed to receive. No pairing check stands in the way because the code never binds the data channel to an identity.

The reason this rates higher than a simple mix-up is intent. A confused-peer race is bad luck. A mutable target with no authentication is an invitation, and the attacker controls the timing.

The pattern

Vulnerable
currentPeer = None

def onConnectionChange(peer, state):
    if state == CONNECTED:
        currentPeer = peer      # no auth, no prior-peer check

def pushUpdate(data):
    currentPeer.notify(CHAR, data)   # whoever is current
Hardened
def onConnectionChange(peer, state):
    if state != CONNECTED:
        return
    if not peer.isBonded():          # require pairing/auth
        peer.disconnect()
        return
    sessions[peer.id] = bind(peer)   # per-peer, authenticated

def pushUpdate(peerId, data):
    s = sessions.get(peerId)
    if s: s.peer.notify(CHAR, data)  # named target only
How the pipeline adjudicated itPROVEN
ABCDEFGH

Every gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.

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

Why it matters to you

If those notifications carry anything the peer treats as private or as a command, an attacker with a cheap radio gets to read or receive it by winning a timing window you never defended. Physical proximity is the only cost, and for a device that ships in volume, proximity is not much of a barrier.

Treat a BLE data channel like any other session. Require pairing or bonding before you send anything sensitive, keep state per peer, and send each notification to a named, authenticated target instead of to a field anyone in range can overwrite.

Check your own code