Blog / A07:2021 Identification and Authentication Failures
A07:2021 · Identification and Authentication Failures

Last session's blink still counts this session

Global liveness counters that never reset let a blink from one scan satisfy the next. The check passes for a photo because a real person passed it earlier.

earlier scanrecords a blinkglobal countersnever resetnew scan startswith creditthreshold metwith no…ATTACKER INPUTIMPACTtrust boundary crossed
Attack path · earlier scan records a blink → global counters never reset → new scan starts with credit → threshold met with no live blink

Global liveness counters that never reset let a blink from one scan satisfy the next. The check passes for a photo because a real person passed it earlier.

What goes wrong

A photo held up to the camera should never pass a liveness check. This one can, as long as a real person blinked at the same app earlier. The signal that proves liveness lives in module-global variables: a blink counter, some eye-state flags, a timestamp. They accumulate as blinks are detected, and once confidence crosses a threshold the scan is accepted.

Nothing resets them when a new scan starts. A blink from any previous session still counts, so the next scan begins with confidence already banked. Present a static photo, add no blink at all, and the stale credit alone can push it over the line. State that outlives the session it describes is the bug. Liveness that carries over is not liveness.

The pattern

Vulnerable
let blinkScore = 0            // module-global, never reset
let eyesWereClosed = false

function onFace(face) {
  if (blinked(face)) blinkScore += WEIGHT
  if (blinkScore >= THRESHOLD) accept()   // credit from any past scan
}
Hardened
function startScan() {
  const s = { blinkScore: 0, eyesWereClosed: false }  // per-session
  return {
    onFace(face) {
      if (blinked(face, s)) s.blinkScore += WEIGHT
      if (s.blinkScore >= THRESHOLD) accept()
    }
  }
}
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

Presentation attacks against liveness usually take effort, a printed mask or a replayed video loop. This one needs a photo and patience, because the app did the hard part by remembering a blink it should have forgotten. Any check whose state is global and long-lived will eventually accept the wrong thing.

Scope liveness state to a single scan and initialize it at the start of every attempt. If a value from a previous session can change the outcome of this one, the session boundary is not real.

Check your own code