Prevent MFA factor hijacking
@J0 is already working on this.
Since Jun 16, 2024.
Assessment
This issue has not been assessed yet.
Description
Bug report / security issue
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Currently, a new MFA can be enrolled at any time after AAL2 has been reached. Which leaves the door open to potential account hijackings if one gains access to a session ( / open browser tab) – just add a new factor and delete the old one.
It's generally a good practice to require re-verification of the 2nd factor close to making dangerous changes to the account from security POV.
I wish this was configurable in user land though, as it may be difficult to come up with a solid middle ground for all use cases here. What would be great is if GoTrue would set the request.jwt.claims current_setting with all its (authenticated) requests, similar to PostgREST, so developers could create custom triggers to customize the logic (e.g. raise an exception if the AMR claim ts is older than x seconds when DELETE'ing from auth.mfa_factors). This would open up a myriad of other use cases as well (we have at least 5 other use cases off the top of my head where we now have had to resort to contrived backend code and re-creating JWTs to add custom logic).
To Reproduce
- Enroll an MFA
- Leave your session open in a public computer
- Someone can enroll their own factor and unenroll yours, effectively locking you out of your account
Expected behavior
Re-verification of the 2nd factor should be required if x-amount of time has passed from initial verification.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 764
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/auth
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100