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

How long is the code valid? A change is not possible. #164

Open
RK202103 opened this issue Mar 22, 2021 · 3 comments
Open

How long is the code valid? A change is not possible. #164

RK202103 opened this issue Mar 22, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed security Pull requests that address a security vulnerability

Comments

@RK202103
Copy link

How long is the code valid?
Is it possible to adjust the validity of the code? How is it possible?

@nursoda
Copy link
Owner

nursoda commented Sep 30, 2021

Currently, codes are valid infinitely and there's no possibility to configure a validity time period. I consider this a security issue to some extent. Question is: How long may a code be valid to not pose a risk, and what is user expectance. My first guess: 1h? I don't think 24h is necessary, one may easily send another code (abort login, re-login). In case we implemented 1h, does it still need to be configurable? I'd like to keep the app simple…

@nursoda nursoda added enhancement New feature or request help wanted Extra attention is needed security Pull requests that address a security vulnerability labels Feb 26, 2022
@binaryhq
Copy link

binaryhq commented Apr 8, 2022

Any thoughts on this?

@nursoda
Copy link
Owner

nursoda commented Apr 8, 2022

While testing 2.2.0 release, we did a black box test: We tried to log in from two different devices:

  1. Log in (username+password) on device A, 2FA→Email (wait)
  2. Log in (username+password) on device B, 2FA→Email (wait)
  3. (two emails with codes are sent and received)
  4. Continue login 1. on device A but using the second code sent from device B → cannot be used
  5. Continue login 2. on device B but using the first code sent from device A → cannot be used
  6. (search for the 2FA codes in the database → no match)
  7. Continue login 1. on device A using the first code sent → login successful
  8. Continue login 2. on device B using the second code sent → login successful

This leads to several conclusions: 2FA codes…

  1. can only be used on the device the login was started with
  2. seem not to be stored persistently (to be verified further: what happens upon intermediate reboot?)
  3. are not "overwritten" (concurrent logins do work fine)

Especially conclusion 1 implies that there is no immanent security risk, even if they were stored permanently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed security Pull requests that address a security vulnerability
Projects
None yet
Development

No branches or pull requests

3 participants