Blog / A09:2021 Security Logging and Monitoring Failures
A09:2021 · Security Logging and Monitoring Failures

Protocol Bytes in the Device Log

A byte off a BLE characteristic gets logged for debugging. If that channel carries keys or identity data, your log is now where it lives.

characteristicvalue receivedvalue written todevice loglog collected offdevicereader withaccess opens itsensitive bytesexposedATTACKER INPUTIMPACTwritten to logs
Attack path · characteristic value received → value written to device log → log collected off device → reader with access opens it → sensitive bytes exposed

A byte off a BLE characteristic gets logged for debugging. If that channel carries keys or identity data, your log is now where it lives.

What goes wrong

A value arriving on a wireless characteristic gets written to the device log, the kind of line that starts as debug output and never gets removed. On a shared platform that log is readable by more than your app, including background tooling that uploads crash data and anyone holding a pulled log bundle.

The content of that characteristic decides how bad this is. If the protocol ever carries credentials, identity records, or key material on that channel, logging even part of it puts secret data somewhere it was never meant to go, with retention and a wide audience. A byte today becomes a habit of logging the whole payload tomorrow.

This is a low-severity finding whose impact depends entirely on what flows through that characteristic. Do not log raw protocol data by default. If you need it while debugging, gate it behind a build flag that never ships, and keep anything sensitive out of the log regardless.

The pattern

Vulnerable
function onNotification(char) {
  log.debug('BLE', 'value: ' + char.value[0])   // raw protocol byte
  handle(char.value)
}
Hardened
function onNotification(char) {
  if (DEBUG_BUILD) {
    log.debug('BLE', 'notification received, len=' + char.value.length)
  }
  handle(char.value)
}
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

Logs get copied to places the original data was never cleared for: crash uploads and the support bundle a user emails you. Anything sensitive that reaches a log inherits all of those destinations. The fix costs nothing. Log that an event happened and how large it was, and keep the bytes themselves out of it.

Check your own code