You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crossOrigin field in clientDataJSON not validated #124
The library does not check the crossOrigin field in clientDataJSON during either processCreate() or processGet().
Per the proposed W3C WebAuthn Level 3 spec (§7.1 Step 10 for registration, §7.2 Step 13 for authentication), if clientDataJSON.crossOrigin is true, the ceremony should be rejected unless the Relying Party has explicitly opted into cross-origin behaviour.
Attack scenario
An attacker hosts evil-example.com which embeds the legitimate site's WebAuthn ceremony in a cross-origin iframe. The browser sets crossOrigin: true in clientDataJSON to signal this, but because the library doesn't check it, the ceremony succeeds. This could allow an attacker to trick a user into registering or authenticating a passkey from a context they didn't intend.
Suggested fix
Add a check in both processCreate() and processGet(), after the existing origin validation, that rejects requests where crossOrigin is explicitly true:
if (\property_exists($clientData, 'crossOrigin') && $clientData->crossOrigin === true) {
thrownewWebAuthnException('cross-origin request not allowed', WebAuthnException::INVALID_ORIGIN);
}
This is backwards-compatible — crossOrigin is optional in the spec, so existing clients that don't send it are unaffected. Only explicitly cross-origin requests are rejected.
Activity
Reject cross-origin requests in processCreate and processGet
ScottHelme commentedon May 20, 2026
Just a heads-up for anyone landing here: we've published a security-focused fork of this library as report-uri/passkeys-php
It already includes this fix, along with several other hardening changes. Huge thanks to @lbuchs for the original work!
This PR is still very much open for upstream consideration, but the fork is available in the meantime for anyone who needs the change today.