mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 12:16:53 +00:00
Prevent reg lock bypass on alternate phone number forms
This commit is contained in:
1 parent
288b9f82d7
commit
bb7d855aca
2 files changed
+38
-1
No files matched your search
+8
-1
@@ -136,7 +136,14 @@ public class RegistrationController {
|
||||
final PhoneVerificationRequest.VerificationType verificationType =
|
||||
phoneVerificationTokenManager.verify(requestContext, number, registrationRequest);
|
||||
|
||||
final Optional<Account> existingAccount = accounts.getByE164(number);
|
||||
// There can be at most one existing account for a set of numbers in the same equivalence class, so it's sufficient
|
||||
// to find the first one.
|
||||
final Optional<Account> existingAccount = Util.getAlternateForms(number)
|
||||
.stream()
|
||||
.map(accounts::getByE164)
|
||||
.filter(Optional::isPresent)
|
||||
.map(Optional::get)
|
||||
.findFirst();
|
||||
|
||||
existingAccount.ifPresent(account -> {
|
||||
final Instant accountLastSeen = Instant.ofEpochMilli(account.getLastSeen());
|
||||
|
||||
Reference in new issue
Block a user