Web Security · Junior · Question 48 of 75

Why is storing an access token in localStorage risky?

Explanation

localStorage has no HttpOnly equivalent. With XSS, a stolen token can be used from the attacker's machine until it expires.

Further reading

Problem with a question

Web Security · Junior · question 48

Test yourself

Take the Web Security · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz