Skip to content

Commit

Permalink
Attempt to fix CheckOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
Tithugues committed Jan 30, 2025
1 parent 430c57c commit 1d64b61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/webauthn/src/CeremonyStep/CheckOrigin.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public function process(
'Invalid scheme. HTTPS required.'
);
}
// Companion application
if (in_array($parsedRelyingPartyId['scheme'], ['android', 'ios'])) {
in_array($C->origin, $this->securedRelyingPartyId, true) || throw AuthenticatorResponseVerificationException::create(
'Unauthorized origin.'
);
return;
}
// Web
$clientDataRpId = $parsedRelyingPartyId['host'] ?? '';
$clientDataRpId !== '' || throw AuthenticatorResponseVerificationException::create('Invalid origin rpId.');
$rpIdLength = mb_strlen($facetId);
Expand Down

0 comments on commit 1d64b61

Please sign in to comment.