Skip to content

Commit 954babe

Browse files
come-ncbackportbot[bot]
authored andcommitted
fix(webauthn): Throw on uid mismatch when updating registration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 20db5ef commit 954babe

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎lib/private/Authentication/WebAuthn/CredentialRepository.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public function saveAndReturnCredentialSource(PublicKeyCredentialSource $publicK
6262
$entity = PublicKeyCredentialEntity::fromPublicKeyCrendentialSource($name, $publicKeyCredentialSource, $userVerification);
6363

6464
if ($oldEntity) {
65+
if ($oldEntity->getUid() !== $entity->getUid()) {
66+
throw new \InvalidArgumentException('Uid mismatch');
67+
}
6568
$entity->setId($oldEntity->getId());
6669
if ($defaultName) {
6770
$entity->setName($oldEntity->getName());

0 commit comments

Comments
 (0)