Skip to content

QuizNot attempted

Does memory storage stop XSS?

Your access token lives only in React state. An attacker finds an XSS bug. What can they still do?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Send requests as the user from inside the page while it is open
  • Memory storage only stops the token from being persisted or easily exfiltrated
  • script running on your page can still call your API as the user while the tab is open.
  • Not read the HttpOnly cookie: HttpOnly blocks all JS access.
  • Not nothing: XSS still runs with the user's session in the page.
  • Not use it for months: the access token expires in minutes.
  • Preventing XSS is what matters
  • short lifetimes limit the damage.