Skip to content

Commit 28d95f0

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 a4ba3ba commit 28d95f0

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
@@ -61,6 +61,9 @@ public function saveAndReturnCredentialSource(PublicKeyCredentialSource $publicK
6161
$entity = PublicKeyCredentialEntity::fromPublicKeyCrendentialSource($name, $publicKeyCredentialSource, $userVerification);
6262

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

0 commit comments

Comments
 (0)