Bluetooth & BLE · Study deck

BLE Attack Labs: PIN Brute-Force Timing

A four-digit PIN is a short passcode.

Radio Remi is your guide for this deck.

securitydefense
Radio Remi, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: IoT devices without a mechanism to remotely revoke bonding keys (via cloud command + BLE or local physical trigger) remain permanently open to the lost device reconnecting with the stolen key.
  • Explain: The layers answer different threats, so the lab results should record which control stopped which attack rather than claiming one successful pairing test proves end-to-end security.
  • Explain: Provide authorized bond revocation and re-pairing when a key is lost or compromised; rotate and re-pair on a risk-based schedule, deleting the old LTK.
  • Explain: A script can try every value until one works.
iotclass.org

Major section

Start With the Decision

A four-digit PIN is a short passcode.

  • A script can try every value until one works.
  • Lockout time is the wait imposed after the allowed number of failed tries.
  • A retry limit is how many failed tries it permits.
  • Those rules decide how long the attack takes.
iotclass.org

Major section

Defense-in-Depth Security Layers · BLE Attack Timeline Visualization

Secure BLE deployments require protection at multiple layers.

  • The layers answer different threats, so the lab results should record which control stopped which attack rather than claiming one successful pairing test proves end-to-end security.
  • Understanding when attacks can occur helps prioritize defenses.
Five BLE layers run from physical security through radio exposure, pairing and link protection, application authorization, and device and data protection. No single layer is enough.
Defense-in-depth layers for BLE security showing how each layer blocks different attack vectors.
iotclass.org

Major section

Visual Reference Gallery · Visual: Bluetooth Pairing Process

This stops the visible “connected” state from being confused with authenticated, encrypted application access.

  • The chosen capabilities determine whether the exchange can resist MITM; encryption alone does not retroactively authenticate Just Works.
  • This ordered path connects the gallery reference to the secure and insecure lab modes and tells you which event each callback should log.
Geometric sequence diagram of Bluetooth pairing process showing IO capability exchange, authentication method selection, key generation, and encryption establishment
Bluetooth pairing key exchange
iotclass.org

Major section

Visual: BLE State Machine

Attack surface changes with state, so a single connected-state test is incomplete.

  • The state view connects the lab's callbacks to security timing: apply controls and logging at the transition where the relevant evidence actually appears.
BLE connection state machine
BLE connection state machine
iotclass.org

Major section

Visual: Bluetooth Power Classes · Visual: Bluetooth Protocol Stack Security

Class 1 uses 100 mW and Class 2 uses 2.5 mW, so 100 mW / 2.5 mW = 40: the nominal power is 40 times greater.

  • More power can enlarge the area from which someone may hear the link.
  • The range in a product sheet is not a fence.

Why it matters

This prevents encrypted radio frames from being presented as proof that a connected user may perform every application action.

Bluetooth power class and range
Bluetooth power class and range
iotclass.org

Major section

Common Mistake: Ignoring Bonded Key Storage Security

The Scenario: A smart lock manufacturer implements authenticated BLE pairing with Numeric Comparison but stores bonded LTK keys in unencrypted flash memory.

  • After deployment, a security researcher extracts the keys through exposed debug access and demonstrates that cloned clients can reconnect as trusted devices.
  • Many developers focus on the pairing ceremony (Numeric Comparison, OOB) but neglect key storage, assuming the device's physical security is sufficient.
  • JTAG or SWD debug access remains enabled in production.

Why it matters

The enclosure allows simple access to programming pads.

iotclass.org

Major section

Common Mistake: Ignoring Bonded Key Storage Security (continued)

Provide authorized bond revocation and re-pairing when a key is lost or compromised; rotate and re-pair on a risk-based schedule, deleting the old LTK.

  • Bonding keys are saved to ordinary flash without flash encryption.
  • Attacker removes smart lock cover (2 screws).
  • Locks now accept attacker's device as trusted.
iotclass.org

Major section

Common Mistake: Ignoring Bonded Key Storage Security (continued)

The enclosure allows simple access to programming pads.

  • Use tamper-evident enclosures (security screws, ultrasonic welds).
  • Add intrusion detection (accelerometer detects case opening).
  • Deployment cost lesson: Retrofitting hardware security after release is usually more expensive than designing for protected storage and debug-port lockdown before manufacturing.
iotclass.org

Major section

Checkpoint: Defense Stack · Concept Relationships

Defense-in-depth and security layers: Link encryption protects traffic in transit, but production devices also need application authorization, secure boot, and protected key storage.

  • Attack timeline and lifecycle security: Vulnerabilities can appear during manufacturing, pairing, normal operation, firmware update, resale, and decommissioning.
  • LE Secure Connections and key agreement: ECDH-based pairing improves key establishment and prevents passive recovery of past session keys.
  • Key storage protection and bonding security: Flash encryption, secure elements, and debug-port lockdown reduce the risk of LTK extraction.
  • Secure boot and firmware integrity: Signed boot prevents malicious firmware from disabling encryption or leaking bonded keys.
iotclass.org

Major section

Code Challenge · Start With the Story

The phone and lock may have made a protected link.

  • It also does not prove the lock will reject a changed or repeated command.
  • A security lab turns these hidden questions into visible tests.
  • The wireless link can hide data from a nearby listener.
  • The product must still check permission.
iotclass.org

Major section

Deep Dive: ATT Permissions and Write Validation

Changing from Write Command to Write Request only adds an ATT response; changing the UUID only delays discovery.

  • A useful BLE security lab starts by inventorying the ATT operations before testing pairing or packet capture.
  • The classic vulnerability is a writable command characteristic left at Open.
  • Permissions are still only one layer.
iotclass.org

Major section

Deep Dive: ATT Permissions and Write Validation (continued)

A smart lock whose unlock characteristic accepts a Write Command with no security lets anyone within range enumerate the UUID, send 0x01, and open the door.

  • The meaningful test result changes only when the write permission becomes authentication-required and the unauthenticated write fails before the latch callback runs.
  • A bonded, authorized client can send malformed or malicious data through a legitimate Write, so the application must validate every written value.
  • In the lab, prove both sides: one unauthorized write fails at ATT permission checks, and one malformed authorized write fails in the application parser.
iotclass.org

Major section

3. Not Revoking Bonding Keys After Security Incident · 4. Ignoring Firmware Update Authentication

IoT devices without a mechanism to remotely revoke bonding keys (via cloud command + BLE or local physical trigger) remain permanently open to the lost device reconnecting with the stolen key.

  • An OTA DFU implementation that accepts unsigned firmware images allows an attacker within BLE range to flash arbitrary malicious firmware.
  • All production BLE OTA implementations must verify firmware image signatures (ECDSA or RSA) before applying updates.
  • The public key for signature verification should be stored in a protected flash region that cannot be overwritten by OTA updates themselves.
iotclass.org

Deck summary

Key takeaways

A four-digit PIN is a short passcode.

  • Secure BLE deployments require protection at multiple layers.
  • This stops the visible “connected” state from being confused with authenticated, encrypted application access.
  • Attack surface changes with state, so a single connected-state test is incomplete.
  • Class 1 uses 100 mW and Class 2 uses 2.5 mW, so 100 mW / 2.5 mW = 40: the nominal power is 40 times greater.
iotclass.org

Retrieval practice

Recall check 1 of 5

Radio Remi says: answer from memory, then check your reasoning.

Q1A four-digit PIN has 10,000 values. A tester can try 10 guesses each second with no lockout. About how long is the average search?

A10,000 seconds
B500 seconds
C100 seconds
D1,000 seconds
Show answer

Answer: B Average search tries half the space, then divides by the guess rate.

iotclass.org

Retrieval practice

Recall check 2 of 5

Radio Remi says: answer from memory, then check your reasoning.

Q2What is the main security improvement introduced by BLE 4.2 LE Secure Connections?

ALonger symmetric keys as the sole LE Secure Connections change.
BECDH key exchange instead of the legacy pairing key setup.
CFaster advertising intervals rather than a key-agreement change.
DReduced RF power rather than a new cryptographic exchange.
Show answer

Answer: B LE Secure Connections (BLE 4.2+) replaces legacy pairing with ECDH-based key agreement, providing protection against passive eavesdropping of pairing exchanges.

iotclass.org

Retrieval practice

Recall check 3 of 5

Radio Remi says: answer from memory, then check your reasoning.

Q3What does BLE's Resolvable Private Address (RPA) primarily protect against?

AData interception of the encrypted BLE application payload.
BDevice tracking through a stable, publicly observable address.
CReplay of an old command over an otherwise encrypted link.
DA man-in-the-middle during unauthenticated pairing.
Show answer

Answer: B Resolvable private addresses rotate and can be resolved by peers holding the IRK.

iotclass.org

Retrieval practice

Recall check 4 of 5

Radio Remi says: answer from memory, then check your reasoning.

Q4Why is BLE link-layer encryption alone insufficient for securing an IoT smart lock?

ABecause BLE encryption uses easily broken AES-64 instead of AES-128.
BBecause link encryption protects transit, not authorization at the lock.
CBecause encryption always makes lock commands too slow for use.
DBecause a screen is mandatory before any smart lock can pair securely.
Show answer

Answer: B Even with encrypted BLE links, an attacker who extracts stored LTK keys (physical access), clones a bonded device, or compromises firmware can bypass link-layer security.

iotclass.org

Retrieval practice

Recall check 5 of 5

Radio Remi says: answer from memory, then check your reasoning.

Q5During which phase of the BLE device lifecycle is secure boot most critical?

ADuring initial pairing, to prevent man-in-the-middle attacks
BDuring normal operation, to encrypt all BLE packets
CDuring boot and firmware update verification
DDuring decommissioning, to securely erase all stored keys
Show answer

Answer: C Secure boot verifies the cryptographic signature of firmware at boot time, ensuring only authorized code runs.

Q6Complete the authorization guard for a sensitive BLE command:

Aif not ctx.link_encrypted:
Bif ctx.device_name == command:
Cif ctx.rssi > -60:
Dif command in ctx.advertisements:
Show answer

Answer: A Sensitive commands should require both encrypted transport and fresh user authorization.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. B · Average search tries half the space, then divides by the guess rate.
  2. B · LE Secure Connections (BLE 4.2+) replaces legacy pairing with ECDH-based key agreement, providing protection against passive eavesdropping of pairing exchanges.
  3. B · Resolvable private addresses rotate and can be resolved by peers holding the IRK.
  4. B · Even with encrypted BLE links, an attacker who extracts stored LTK keys (physical access), clones a bonded device, or compromises firmware can bypass link-layer security.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. C · Secure boot verifies the cryptographic signature of firmware at boot time, ensuring only authorized code runs.
  2. A · Sensitive commands should require both encrypted transport and fresh user authorization.
iotclass.org