-
Notifications
You must be signed in to change notification settings - Fork 538
Open
Labels
auth-jsRelated to the auth-js library.Related to the auth-js library.bugSomething isn't workingSomething isn't working
Description
Bug report
- 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
Using data from session.user to render user information is just as insecure on the client side as it is on the server side.
This is because an attacker can signup for an account, login, then change the value of session.user.id in their own cookie, then make a request to the vulnerable app page.
To Reproduce
As with the server side vulnerability, this one also relies on an attacker knowing the Supabase user id of the targeted victim user.
- Login to an app
- Copy the value of your own auth token
- Remove the
base64-prefix from the value - Decode the value to get the session
- Replace
session.user.idwith the victim's user id. - Base64 encode the tampered session and prefix it with
base64- - Copy the value back into your cookie.
- Go to a page that renders sensitive user data based on
session.user.id. The victim user's data will be revealed.
Additional Context
Metadata
Metadata
Assignees
Labels
auth-jsRelated to the auth-js library.Related to the auth-js library.bugSomething isn't workingSomething isn't working