Bluetooth & BLE · Study deck

BLE Attack Labs: PIN Brute-Force Timing

A four-digit PIN can look safe until a script tries every value.

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:

  • Calculate interactive: pin brute-force time calculator from stated measurements and limits.
  • Test 4. ignoring firmware update authentication against named attack, failure, and recovery cases.
  • 'calculate interactive: pin brute-force time calculator from stated measurements and limits'
  • test 4. ignoring firmware update authentication against named attack, failure, and recovery cases
iotclass.org

Major section

Defense-in-Depth Security Layers

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.
Defense-in-depth layers for BLE security showing how each layer blocks different attack vectors.
Defense-in-depth layers for BLE security showing how each layer blocks different attack vectors.
iotclass.org

Major section

BLE Attack Timeline Visualization

Understanding when attacks can occur helps prioritize defenses.

  • This sequence connects the hands-on lab to lifecycle policy: secure mode must include provenance, commissioning, maintenance, reset, and verified key destruction.
Attack timeline showing vulnerability windows throughout the BLE device lifecycle.
Attack timeline showing vulnerability windows throughout the BLE device lifecycle.
iotclass.org

Major section

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.
Bluetooth pairing key exchange
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

The class labels are planning references, not guarantees of installed range.

  • The security connection is practical: pairing-window, discovery, and rate-limit tests should include locations outside the intended user area rather than assuming the device stops at a catalogue distance.
Bluetooth power class and range
Bluetooth power class and range
iotclass.org

Major section

Visual: Bluetooth Protocol Stack Security

Link protection provides confidentiality and integrity over the air; GATT restricts attribute operations; the application decides whether an authenticated identity may invoke the requested business function and how sensitive data is handled.

  • The layered walk-through reconnects this gallery item to defense in depth: a complete test needs evidence at all three boundaries.

Why it matters

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

BLE stack security layers
BLE stack security layers
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)

Deployment cost lesson:: Retrofitting hardware security after release is usually more expensive than designing for protected storage and debug-port lockdown before manufacturing.

  • 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

Concept Relationships

Secure boot and firmware integrity: Signed boot prevents malicious firmware from disabling encryption or leaking bonded keys.

  • 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.
iotclass.org

Major section

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

Start With the Story (continued)

Under the Hood examines data permissions, write checks, key storage, and the cases that a simple pairing test cannot cover.

  • The device must limit repeated guesses.
  • New software must come from a trusted source.
  • Lost phones and old keys need a removal path.
  • Physical access also changes the risk.
iotclass.org

Major section

Start With the Story (continued)

A passing result should name the exact action and setup.

  • It should not claim that the whole product is safe.
  • This first view uses a small door command.
  • Real attacks can cross the phone, device, cloud service, and recovery process.
  • The Practitioner layer builds repeatable lab records and fixes.
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

Deck summary

Key takeaways

Secure BLE deployments require protection at multiple layers.

  • Understanding when attacks can occur helps prioritize defenses.
  • 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.
  • The class labels are planning references, not guarantees of installed range.
iotclass.org

Retrieval practice

Recall check 1 of 4

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

Q1Which BLE pairing method provides the strongest protection against eavesdropping?

AJust Works
BPasskey Entry
CNumeric Comparison
DOut-of-Band (OOB)
Show answer

Answer: D OOB uses a separate channel (e.g., NFC) to exchange pairing data, raising the bar for attackers because they must compromise both channels simultaneously.

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

ALonger symmetric keys
BECDH key exchange
CFaster advertising intervals
DReduced RF transmit power
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 2 of 4

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

Q3What is the key difference between pairing and bonding in BLE?

APairing encrypts all traffic, bonding does not
BBonding is required for LE Secure Connections
CBonding stores keys for future reconnection
DPairing is only used for BLE 5.x devices
Show answer

Answer: C Pairing creates the shared secrets for the current session; bonding persists them so trusted devices can reconnect securely without repeating the full pairing flow.

iotclass.org

Retrieval practice

Recall check 3 of 4

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

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

ABLE link-layer encryption uses weak AES-64 that can be easily broken
BLink encryption only protects data in transit
CLink-layer encryption prevents the lock from receiving commands fast enough
DSmart locks cannot use BLE encryption because they lack display screens for pairing
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 4 of 4

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

Q5Place each BLE defense control where it lives so you can distinguish link protection from application authorization.

AThreat Assessment
BSecure Pairing
CEncrypted Transport
DCommand Authorization
Show answer

Answer: A Place each control at its real boundary so you can see why secure pairing and encryption do not replace command-level authorization.

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. D · OOB uses a separate channel (e.g., NFC) to exchange pairing data, raising the bar for attackers because they must compromise both channels simultaneously.
  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. C · Pairing creates the shared secrets for the current session; bonding persists them so trusted devices can reconnect securely without repeating the full pairing flow.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. 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.
  2. A · Place each control at its real boundary so you can see why secure pairing and encryption do not replace command-level authorization.
  3. A · Sensitive commands should require both encrypted transport and fresh user authorization.
iotclass.org