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 31, 2025
1 parent 1d64b61 commit c74b7c5
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 @@ -40,6 +40,14 @@ public function process(
is_array($parsedRelyingPartyId) || throw AuthenticatorResponseVerificationException::create(
'Invalid origin'
);
// Companion application
if (in_array($parsedRelyingPartyId['scheme'], ['android', 'ios'])) {
in_array($C->origin, $this->securedRelyingPartyId, true) || throw AuthenticatorResponseVerificationException::create(
'Unauthorized origin.'
);
return;
}
// Web
if (! in_array($facetId, $this->securedRelyingPartyId, true)) {
$scheme = $parsedRelyingPartyId['scheme'] ?? '';
$scheme === 'https' || throw AuthenticatorResponseVerificationException::create(
Expand Down

0 comments on commit c74b7c5

Please sign in to comment.