BLE Security Architecture
Bluetooth & Wireless Attack Surfaces · Mobile Advanced Security track
9 min read
In this module
Two Bluetooth Worlds
"Bluetooth" is two completely different protocol stacks wearing the same logo. Bluetooth Classic (BR/EDR) was built for continuous, high-bandwidth streams — audio, file transfer, serial. Bluetooth Low Energy (BLE) arrived with Bluetooth 4.0 in 2010, aimed at intermittent, low-power chatter: fitness trackers, smart locks, medical sensors, beacons.
The split matters because each stack has its own pairing model, its own encryption, its own attack surface. A bug in BLE often won't touch Classic, and the reverse is just as common.
Classic runs across 79 channels at 1 MHz spacing, hopping frequencies 1600 times a second. BLE works in 40 channels at 2 MHz spacing, with three reserved purely for advertising. The radios are so different that attack tooling for one rarely transfers cleanly to the other.
BLE Pairing Methods
BLE pairing builds a shared secret between two devices. The Security Manager Protocol (SMP) runs the pairing dance and defines four association models, each with its own security flavour.
Just Works
Just Works provides no authentication. Under LE Legacy pairing, both devices use a temporary key (TK) of zero and derive the Short Term Key (STK) from it. It's the default whenever neither device has a display or keyboard — your typical cheap sensor, beacon, or IoT widget.
The killer flaw in the legacy version: TK is zero and the other pairing values fly across in cleartext. A passive observer with a sniffer can recompute the STK and decrypt everything that follows. Just Works under LE Secure Connections is better: the key comes from an ECDH exchange, so a passive sniffer gets nothing. It still has no authentication, though, so an active MitM who sits between the devices during pairing can run a separate exchange with each side and neither will notice.
Passkey Entry
One device shows a six-digit number, the user types it into the other. That passkey becomes the TK. Result: authenticated pairing. A MitM who doesn't know the passkey can't build a valid session.
LE Legacy spoiled the party though. The passkey is at most 999,999, about 20 bits of entropy, and it's the only secret in the exchange. Anyone who sniffs the pairing can try every passkey offline against the captured confirm values in well under a second; Mike Ryan's Crackle tool (2013) automates exactly that, recovers the TK, then the STK and the LTK. No active attack needed. LE Secure Connections (Bluetooth 4.2+) fixed this by switching to ECDH for the key exchange, with the passkey demoted to authentication only.
Numeric Comparison
Both devices flash a six-digit number; the user eyeballs them and confirms a match. Available only in LE Secure Connections (4.2+), this gives you authenticated MITM protection. The number comes from both devices' ECDH public keys, so any MitM swapping in their own keys produces a number that won't match.
Out-of-Band (OOB)
The pairing secret travels over a different channel entirely — an NFC tap, a QR code scan, anything else with side-channel integrity. OOB is strong precisely because the attacker now has to subvert two channels at once.
BLE pairing methods form a security hierarchy. Just Works provides no authentication: under LE Legacy it falls to passive eavesdropping, and under Secure Connections it still falls to an active MitM. Passkey Entry (LE Legacy) authenticates the devices, but a sniffed pairing can be brute-forced offline (Crackle). Numeric Comparison (LE Secure Connections) provides authenticated MitM protection. OOB provides the strongest authentication by using a separate channel. The vast majority of consumer BLE devices use Just Works because they lack displays and keyboards.
GATT: The Application Layer
The Generic Attribute Profile (GATT) is how BLE devices show each other their data. If you're auditing BLE, you'll spend most of your time here — applications live at this layer, and so do most BLE bugs.
GATT Hierarchy
GATT lays out data in a strict hierarchy:
- Profile: A collection of services that implement a use case (e.g., Heart Rate Profile, Blood Pressure Profile).
- Service: A logical grouping of related data (e.g., Heart Rate Service, Battery Service). Each service has a UUID - either a 16-bit UUID from the Bluetooth SIG's assigned numbers (standard services) or a 128-bit UUID (custom/vendor services).
- Characteristic: An individual data value within a service (e.g., Heart Rate Measurement, Battery Level). Each characteristic has properties defining how it can be accessed: read, write, write without response, notify, indicate.
- Descriptor: Metadata about a characteristic (e.g., Client Characteristic Configuration Descriptor, which enables notifications).
Security Implications
GATT security is set per-characteristic. Each one picks its own permission level for reads and writes:
- No security: Any connected device can read/write.
- Encryption required: The link must be encrypted (paired devices only).
- Authenticated encryption required: The link must be encrypted with an authenticated pairing method (not Just Works).
Plenty of BLE devices ship with characteristics requiring no security at all. Any peer that can connect can read and write everything. Bad enough on a fitness tracker. On smart locks, medical devices, and industrial sensors, this gets people hurt.
BLE Encryption
BLE encrypts with AES-CCM — AES in Counter mode paired with CBC-MAC. Confidentiality and integrity for link-layer packets, in one primitive.
Key Hierarchy
The key hierarchy differs between LE Legacy Pairing and LE Secure Connections:
LE Legacy Pairing (Bluetooth 4.0-4.1):
- TK (Temporary Key): Derived from the pairing method (zero for Just Works, passkey value for Passkey Entry).
- STK (Short Term Key): Derived from TK and random values exchanged during pairing. Used to encrypt the link during key distribution.
- LTK (Long Term Key): Generated randomly and distributed over the STK-encrypted link. Stored for future reconnections.
LE Secure Connections (Bluetooth 4.2+):
- ECDH shared secret: Derived from Elliptic Curve Diffie-Hellman using P-256.
- LTK: Derived directly from the ECDH shared secret using AES-CMAC. No STK step - the LTK is computed, not exchanged.
The big win in Secure Connections: deriving the LTK from ECDH means a passive sniffer who records the pairing can't compute it. That isn't forward secrecy, though. The LTK is stored and reused for every later reconnection, and each session key is derived from it, so anyone who later extracts the LTK from either device can decrypt every recorded session.
BLE Vulnerabilities
Passive Eavesdropping on Just Works
Just Works on LE Legacy sends all the keying material in the clear, as covered above. Anyone with a BLE sniffer who happens to catch the pairing exchange recovers the STK and LTK, decrypting everything that ever flowed (or will flow) across that link.
Step through a legacy Just Works pairing from the sniffer's seat. Everything it needs crosses the air in the clear, and the one secret input, TK, is zero by definition. Secure Connections swaps that exchange for ECDH, and the sniffer is left holding two public keys it can't do anything with.
The KNOB Attack
The Key Negotiation of Bluetooth (KNOB) attack (CVE-2019-9506) hits Bluetooth BR/EDR (Classic), not BLE. During link setup, master and slave negotiate the entropy — the effective key length — of the encryption key. That negotiation runs after authentication but before encryption kicks in, and it isn't integrity-protected.
A MitM in the middle of that exchange can force both devices into accepting 1 byte of entropy. 8 bits, 256 possible keys, brute-forced live. All subsequent traffic decrypts in real time.
KNOB ate basically every BR/EDR implementation in the wild because the spec allowed a minimum entropy of 1 byte. The Bluetooth SIG eventually amended the spec to require 7. BLE has a similar key-size negotiation (7 to 16 bytes), and a follow-up paper from the same team showed it can be pushed down to the 7-byte floor.
The follow-up, BLUFFS (Antonioli, 2023, CVE-2023-24023), goes after BR/EDR session key derivation itself: an attacker can force the same weak session key to be reused across sessions, breaking the forward and future secrecy that Secure Connections was supposed to give each session.
BIAS (Bluetooth Impersonation Attacks)
BIAS (CVE-2020-10135) lets an attacker impersonate a previously paired device without holding the link key. The bug rides on a generosity in BR/EDR: mutual authentication isn't mandatory. A device will happily accept a connection where only one side authenticates. The attacker opens the connection and steers the authentication procedure to dodge being challenged.
BLE security depends on three layers: the pairing method (which determines authentication strength), the encryption algorithm (AES-CCM for link-layer confidentiality and integrity), and the GATT permission model (which controls per-characteristic access). The weakest layer determines the overall security. Most consumer BLE devices use Just Works pairing with no GATT-level security requirements, making them vulnerable to eavesdropping, replay, and unauthorised access by any device within radio range.
BLE Privacy and Address Randomisation
BLE devices throw out advertising packets containing their Bluetooth address. Anyone with a receiver can stalk you. To take the edge off this, BLE supports address randomisation — the device rotates its advertised address every so often. Two flavours:
- Resolvable Private Address (RPA): Generated using an Identity Resolving Key (IRK) shared during pairing. Paired devices can resolve the random address back to the real identity; unpaired devices see a changing, unlinkable address.
- Non-resolvable Private Address: A purely random address with no way to link it to the device's identity. Used for non-connectable advertising (beacons).
In practice, the randomisation leaks. Researchers have shown how timing patterns, advertising intervals, and packet payloads (manufacturer-specific data, service UUIDs) get strung together to fingerprint a device through address rotations.