Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOTP bypass issue after password authentication #15

Open
binayag1 opened this issue Dec 18, 2023 · 0 comments
Open

TOTP bypass issue after password authentication #15

binayag1 opened this issue Dec 18, 2023 · 0 comments

Comments

@binayag1
Copy link

binayag1 commented Dec 18, 2023

The user is able to bypass the TOTP page just by refreshing the page.

Issue:
The variable 'lastverified' is intended to track the time when the user last successfully verified the TOTP code. However, in the current code, 'lastverified' is set as soon as the user lands on the authentication page, which appears to be incorrect. 'lastverified' should only be set when the TOTP is successfully matched and verified. As a workaround, I have moved the code to set 'lastverified' within the authenticate.php file, under the section where the TOTP code is matched.

 if ($code === $_REQUEST['code']) {
    $now = time();
    **$session->setData(
        '\SimpleSAML\Module\simpletotp',
        'lastverified',
        $now,
        Session::DATA_TIMEOUT_SESSION_END
    );**
    ProcessingChain::resumeProcessing($state);
  } else {
      $displayed_error = "You have entered the incorrect TOTP token.";
  }

This needs to be fixed asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant