Skip to content

Reject token binding status "present" in processCreate and processGet#131

Open
ScottHelme wants to merge 1 commit intolbuchs:masterfrom
ScottHelme:reject-token-binding-present
Open

Reject token binding status "present" in processCreate and processGet#131
ScottHelme wants to merge 1 commit intolbuchs:masterfrom
ScottHelme:reject-token-binding-present

Conversation

@ScottHelme
Copy link
Copy Markdown

Per the W3C WebAuthn Level 2 spec (§7.1 Step 6 for registration, §7.2 Step 10 for authentication), if clientDataJSON.tokenBinding.status is "present", the server must verify the tokenBinding.id matches the Token Binding ID of the TLS connection.

The library does not implement Token Binding (which has been deprecated and removed from the Level 3 spec — no major browser supports it), so it cannot verify a binding ID. Currently tokenBinding is completely ignored, meaning status: "present" is silently accepted as an unverifiable claim.

This adds a check in both processCreate() and processGet() that rejects "present":

if (\property_exists($clientData, 'tokenBinding') && \is_object($clientData->tokenBinding)
    && \property_exists($clientData->tokenBinding, 'status') && $clientData->tokenBinding->status === 'present') {
    throw new WebAuthnException('token binding not supported', WebAuthnException::INVALID_DATA);
}

The "supported" status is still accepted — it simply means the browser supports Token Binding but did not use it for this connection.

Fixes #130

Per Level 2 spec (§7.1 Step 6, §7.2 Step 10), if tokenBinding.status
is "present" the server must verify the binding ID against the TLS
connection. Since the library does not implement Token Binding (which
is deprecated and removed from Level 3), reject "present" rather than
silently accepting an unverifiable claim.

The "supported" status is still accepted — it simply means the browser
supports Token Binding but did not use it for this connection.

Fixes lbuchs#130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Token binding status "present" silently accepted without verification

1 participant