opyebPasskeyLab

The authenticatorData byte layout and flag bits

Byte layout · 7 min read

In one line: Offsets for the 37-byte header, AAGUID, credential ID, COSE key and extensions, with a worked hex example and the meaning of every flag.

authenticatorData is the heart of a WebAuthn response. It appears in both registration and authentication, and its length alone tells you most of what it contains. The minimum is 37 bytes.

The fixed 37-byte header

OffsetLengthFieldMeaning
032rpIdHashSHA-256 of the RP ID; the basis of site binding
321flagsUP, UV, BE, BS, AT, ED bits
334signCountBig-endian unsigned 32-bit
37variableattestedCredentialDataOnly when AT=1
…variableextensionsOnly when ED=1, a CBOR map

The flag byte

BitNameMeaning
0x01UPThe user really acted (a touch, for example)
0x02RFU1Reserved; 1 is a specification violation
0x04UVThe user proved who they are (PIN, biometrics)
0x08BEThe credential may be backed up to another device
0x10BSIt actually has been backed up; cannot be 1 when BE=0
0x20RFU2Reserved
0x40ATAttested credential data follows
0x80EDExtension data follows

When AT is set

offset 37  16 bytes  AAGUID       authenticator model identifier (UUID)
offset 53   2 bytes  credIdLen    big-endian
offset 55   N bytes  credId       credential ID
offset 55+N variable COSE key     CBOR map

An all-zero AAGUID means the authenticator does not disclose its model, which is common on platform authenticators. A non-zero value maps to a model identifier in the FIDO Metadata Service.

Reading a real example

0000  3a 6e b0 2f 8b a0 14 0d 9f 8e 0c 3d 3e 71 2f 6d   rpIdHash (example.com)
0010  c2 9c 1b 7f 91 76 65 4d ...  (continues)
0020  5d 00 00 00 00                                    flags=0x5D counter=0
0025  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   AAGUID = 00000000-…
0035  00 20                                              credIdLen = 32
0037  00 01 02 … (32 bytes)                                credId
0057  a5 01 02 03 26 20 01 21 58 20 …                    COSE: {1:2, 3:-7, -1:1, -2:…}

Reading signCount

The authenticator increments it on each signature. Servers compare the new value with the stored one to detect cloned authenticators. Synced passkeys often keep it at 0, so skipping or downgrading the check when BE=1 is a common implementation choice.

Checking the parse in practice

A quick sanity check is that the bytes you consumed must equal the length of the buffer. After reading the three fixed fields, add 18 bytes when AT is set plus credIdLen, then parse the COSE map and note where it ends. If the ED bit is set, one CBOR map should remain. A leftover byte usually means a wrong credIdLen or a truncated credential ID, and both are common when a payload was copied from a log that mangled it.

Extensions (ED)

When the ED bit is set a CBOR map follows with authenticator extension output such as credProtect, hmac-secret or largeBlobKey. If you do not parse its length with a CBOR decoder, the boundary of the structure is lost.

Common mistakes

  • Reading an AAGUID from an authentication response where AT=0 — there is no credential data there.
  • Treating signCount as little-endian; it is big-endian.
  • Calling UV=0 a failure — policy may not require UV. Synced passkeys with BE=1 usually do report UV=1.

Decoding happens right in the browser. The payload you paste is not stored.

Open the PasskeyLab decoder

Frequently asked questions

Why is 37 bytes the minimum length?

32 bytes of rpIdHash, one flag byte and four bytes of signCount add up to 37. When AT or ED is set, variable-length data follows.

Is an all-zero AAGUID a problem?

No. It only means the authenticator does not disclose its model. It is common on platform authenticators and says nothing about the validity of the credential.

What if AT=1 but the COSE key will not parse?

Either credIdLen was read wrongly or the offset slipped before the COSE map. The map starts at 37 + 16 + 2 + credIdLen.

Sources

Read next