humanprotocol / human-protocol

Human Protocol python/js/ts Monorepo with example
https://dashboard.humanprotocol.org
MIT License
23 stars 33 forks source link

Sensitive User token Storage in LocalStorage #1526

Open basit511 opened 8 months ago

basit511 commented 8 months ago

Title:- Sensitive User token Storage in LocalStorage

Description:- localStorage is a property that allows JavaScript sites and apps to save key-value pairs in a web browser with no expiration date. This means the data stored in the browser will persist even after the browser window is closed. what if this local storage user important personal data in clear text this can be further proved to be a problem if chained with other vulnerabilities like cross sites scripting, an attacker can directly steal user data with a simple XSS payload, otherwise, it is very for an attacker to steal user data but due to exposed weak local storage an attacker can directly perform this attack

Steps:- 1.Open local storage in developer tools (F12 or CTRL+SHIFT+I) or you can do the same using console (command: localstorage) 2.now in localstorage see the value of token and check this then you will get value like the below string text: ------------- here show the user pii leaked data ------------- 3.the same thing can be achieved using the console command line command: localStorage.getItem('token') this will return the same output as shown in localstorage then again decode the value you will get the same. also if you want to popup ,,,try this command below alert(localStorage.getItem('token'))

Impact or Attack Scenario: Now, let us see the attack scenario as we have already seen that the important personal information is stored in localstorage now an attacker can chain this vulnerability with other vulnerabilities such as cross-site scripting and thus increase the impact to the next level. https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/KtbxLvHLpkzRqczrbKWSxCzCdwvvfVCCbV?projector=1&messagePartId=0.1

ansaqib commented 1 month ago

@Dzeranov - Can you please have a look at this and assign to resolve if needed?

basit511 commented 1 month ago

@Dzeranov What is the update on this?