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

Logging a whole characteristic value logs whatever it holds

A read handler drops the full characteristic value into a debug line. If that value is a key or an identifier, your log now holds it too.

read requestarrivesvalueinterpolated…log persisted orcollectedreadable by otherprincipalsATTACKER INPUTIMPACTwritten to logs
Attack path · read request arrives → value interpolated into log → log persisted or collected → readable by other principals

A read handler drops the full characteristic value into a debug line. If that value is a key or an identifier, your log now holds it too.

What goes wrong

A read handler formats the entire characteristic value straight into a debug string. Whatever that characteristic carries is now in the log, verbatim. It could be a credential. It could be application data caught mid-transfer. The handler takes whatever is there, the same way.

Reach is the problem. Debug logs get shipped to collectors and tailed by tools, and read by far more people than the one engineer who wrote the line. A value meant to exist only for the length of a transfer now sits in a store with weaker access rules than the data deserved.

Whether this bites depends entirely on what flows through that characteristic. That is the reason not to log it blind. The handler does not know what it holds, and the log keeps everything you give it.

The pattern

Vulnerable
void onReadRequest(Characteristic c) {
  log('read value=' + c.getValue());
  respond(c.getValue());
}
Hardened
void onReadRequest(Characteristic c) {
  log('read id=' + c.getUuid() + ' len=' + c.getValue().length);
  respond(c.getValue());
}
How the pipeline adjudicated itDISPROVEN
ABCDEFGH

Grounding and reachability checked out, then the exploit-path gate failed to stand up. The pipeline recorded the finding as disproven and signed that result, so the same false alarm will not come back next quarter.

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

Why it matters to you

The moment sensitive bytes hit a general purpose log, your blast radius is everyone who can read that log, which is usually wider than you think. Treat a characteristic value like a response body. You would not print a response body to logs on every request, so do not print this one.

Check your own code