Background / Context:
Take any out of box ASP.NET Core template with user logins enabled. You may use external login providers google, facebook, msft etc. as well. Alternatively, just clone this sample web application: https://github.com/dotnet-architecture/eShopOnWeb
Test:
- Login to the test website created. (test user name we used : neel)
- Record any authorized web request using Fiddler or web developer tools etc. We recorded /basket request of eShopOnWeb sample website which shows personalized shopping cart of the logged in user.
- Logout.
- Close browser.
- Open website in guest mode. (do not login). You may choose a different browser altogether.
- Replay step 2. (This uses exact same headers containing cookies, token etc.)
Observation: This successfully returns shopping cart items of the user neel.
I am faced with two questions:
- Is this a login related vulnerability? I think it is!! Shouldn't the token expire (session destroy) with logout?
- If this is a vulnerability, how to fix it? Anti-forgery token comes built in with Identity, but it doesn't seem to help.