Hi! LocalStorage is not a correct solution for User/Admin sessions.
All user can read data from Browser / Inspect / Application
I see the whole user api response.
This is a test user session in local storage. userID: 3
{"user":{"userId":3,"firstName":"Test","lastName":"Test","email":"test@gmail.com","isAdmin":0,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NzQsImlzQWRtaW4iOjAsImlhdCI6MTY1NTA2MzYzMSwiZXhwIjoxNjU1MDcwODMxfQ.z_O54n3fkr2_suVDMxHNagfvJMv5PL-onETxNb6i8cE"}}
And This is an admin session in local storage. UserID: 144
{"user":{"userId":144,"isAdmin":1,"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQ0LCJpc0FkbWluIjoxLCJpYXQiOjE2NTUwNjQ2NTMsImV4cCI6MTY1NTA3MTg1M30.n9p3WWO5PIsSF4xld97XXNrfGShsWY6H5MeKUKrjbis","firstName":"test"}}
ISSUE 1.
If you overwrite isAdmin: 0 to isAdmin: 1, and open admin page (https://jacksgardenadmin.netlify.app/), you will get full access to the admin page!
How to reproduce
- Login as normal user
- Open developer tools in browser
- Navigate to Application
- Select The
Storage / Local Storage
- Edit
jg_user and overwrite isAdmin: 0 to isAdmin: 1
ISSUE 2.
If you overwrite userId: 3, to userId: 144 you can privilege escalate to Admin user, and you can do everything.
How to reproduce
- Login as normal user
- Open developer tools in browser
- Navigate to Application
- Select The
Storage / Local Storage
- Edit
jg_user and overwrite userId: 3 to userId: 144
ps: jg_user is overwritable too to jg_admin but I don't know, is this required for use this bug.
Btw, I like your work, The Admin panel looks very cool! ;)
Statistics, design, and api solutions good, just this issues is really dangerous.
Have a nice day!
Hi! LocalStorage is not a correct solution for User/Admin sessions.
All user can read data from
Browser / Inspect / ApplicationI see the whole user api response.
This is a test user session in local storage. userID: 3
And This is an admin session in local storage. UserID: 144
ISSUE 1.
If you overwrite
isAdmin: 0toisAdmin: 1, and open admin page (https://jacksgardenadmin.netlify.app/), you will get full access to the admin page!How to reproduce
Storage/Local Storagejg_userand overwriteisAdmin: 0toisAdmin: 1ISSUE 2.
If you overwrite
userId: 3, touserId: 144you can privilege escalate to Admin user, and you can do everything.How to reproduce
Storage/Local Storagejg_userand overwriteuserId: 3touserId: 144Btw, I like your work, The Admin panel looks very cool! ;)
Statistics, design, and api solutions good, just this issues is really dangerous.
Have a nice day!