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

Who supplies the reference face wins the match

A face match is only as trustworthy as the reference it compares against. If the caller supplies both sides, the caller decides the result.

caller passesreference imagespayload extractedwith no…used as thetrusted referencelive capturematched,…ATTACKER INPUTIMPACTtrust boundary crossed
Attack path · caller passes reference images → payload extracted with no integrity check → used as the trusted reference → live capture matched, auth passes

A face match is only as trustworthy as the reference it compares against. If the caller supplies both sides, the caller decides the result.

What goes wrong

The camera works perfectly. The reference it compares against is the attacker's own face. A biometric match answers one question: does the live capture match the enrolled reference. The security of the whole thing rests on that reference being real, meaning it came from a signed credential the user actually holds. This code skips that part.

The reference images arrive as a parameter and get used as-is. Nothing checks that they came from an authenticated, tamper-evident source, and the payload is pulled out of a data URI without honoring the declared type. So an attacker who can influence that parameter supplies a reference matching their own face, presents that face to the camera, and the comparison returns a clean match. The state machine flips to authenticated. The camera never lied. The reference did.

The pattern

Vulnerable
function buildScanner(referenceImages) {
  const ref = extractPayload(referenceImages[0])  // trusted blindly
  return scanner.onCapture(live => {
    if (faceMatch(live, ref)) state = "authenticated"
  })
}
Hardened
function buildScanner(credential) {
  verifySignature(credential)                 // reject unsigned or tampered
  assertBoundToUser(credential, session.user)
  const ref = extractPayload(credential.image)
  return scanner.onCapture(live => {
    if (faceMatch(live, ref)) state = "authenticated"
  })
}
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

Biometrics feel strong because a face is hard to fake in front of a camera. That intuition hides the real trust boundary, which is the reference, not the capture. Let the reference in through an unauthenticated channel and you have built an identity check that verifies the attacker against the attacker.

Anywhere you compare a live signal to a stored template, the template has to arrive over a path you trust, signed and bound to the right user, and verified before a single comparison runs. If you cannot prove where the reference came from, the match proves nothing.

Check your own code