Authenticator-Extension / Authenticator-Extension/Authenticator

Authenticator suddenly stopped working

Aperta
#1,399 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
TypeScript
Stelle
4.7k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Describe the issue

![Image](https://github.com/user-attachments/assets/eaf55247-4687-419f-b392-765b3bd90084)
**Figure 1**. Visit the [ChesslaBlab](https://github.com/chesslablab/website) website and click on **Sign In**

![Image](https://github.com/user-attachments/assets/fc2868d3-67d8-4239-8870-8981d7b09659)
**Figure 2**. Click on the **Extensions** icon and select **Authenticator**

![Image](https://github.com/user-attachments/assets/988db0aa-47f4-4450-b47f-4ef96feb5241)
**Figure 3**. Type the username and password and click on **Sign In**

It seems as if the TOTP sign in task in [src/Command/Auth/Blocking/TotpSignInTask.php](https://github.com/chesslablab/chess-server/blob/main/src/Command/Auth/Blocking/TotpSignInTask.php) is not working as expected with the newest Chrome update.

```php
env['totp']['secret'], new InternalClock());
$otp->setDigits(9);

if ($otp->verify($this->params['password'], null, 5)) {
$sql = "SELECT * FROM users WHERE username = :username";
$values[] = [
'param' => ":username",
'value' => $this->params['username'],
'type' => \PDO::PARAM_STR,
];
$arr = $this->db->query($sql, $values)->fetch(\PDO::FETCH_ASSOC);

$sql = "UPDATE users SET lastLoginAt = now() WHERE username = :username";
$values[] = [
'param' => ":username",
'value' => $this->params['username'],
'type' => \PDO::PARAM_STR,
];
$this->db->query($sql, $values);

$payload = [
'iss' => $this->env['jwt']['iss'],
'iat' => time(),
'exp' => time() + 3600, // one hour by default
'username' => $arr['username'],
'elo' => $arr['elo'],
];

return [
'access_token' => JWT::encode($payload, $this->env['jwt']['secret'], 'HS256'),
];
}

return null;
}
}
```
The chess server will always return null as if the otp cannot be verified for some reason. However, this exact same use case is working like a charm with FreeOTP.

🙏 Any help will be much appreciated!

### Browser

Chrome

### Browser Version

134.0.6998.35 (Official Build) (64-bit)

### Extension Version

8.0.1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Riprodurre il malfunzionamento in Chrome 134.0.6998.35 con Authenticator 8.0.1 seguendo i passaggi di accesso di ChesslaBlab, quindi esaminare src/Command/Auth/Blocking/TotpSignInTask.php e il percorso di verifica TOTP. Il lavoro è completato quando è stato identificato il motivo per cui la verifica restituisce null e è stato ripristinato l'accesso corretto senza compromettere il caso FreeOTP documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
authentication, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.