Skip to content
XSS Write-up Advanced

Bug Bounty: Cookie timeline utilization when the system uses multiple authentication cookies

The write-up describes two ways a system that relies on several authentication cookies can be abused: a stored self-XSS on a core asset can be turned into an attack on other users by writing the attacker's cookie to the root domain, and a login CSRF can be exploited during the window when one cookie has expired but another is still valid. The author claims an attacker could then read or write data using the victim's other authentication cookies.

smilemil Follow

Published on medium.com

Just for reference, hope it can help you. If there is anything wrong, please reply and point it out.

smilemil, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely inconsistent cookie scope and lifetime handling across multiple authentication cookies, so one cookie can be written to the root domain or remain valid after another expires.

Impact

An attacker could potentially act with the victim's other authentication cookies to read and write data, or exploit a login CSRF during a cookie lifetime gap; the author notes the scenarios are not universal.

What the attacker needed

Multiple authentication cookies in use; a stored self-XSS on a core asset; a same-origin cookie-setting flaw; victim visits attacker's page

How it was found

  1. Find an authentication cookie and try changing its domain to the root domain, then refresh and observe how the system handles it.
  2. Find a cookie-setting vulnerability on a same-origin non-core asset, such as another XSS or an interface that sets cookies.
  3. Write the XSS payload in your own account.
  4. Use a script to write your own authentication cookie to the root domain and jump to the self-XSS page.
  5. Log in and compare the lifetime of each authentication cookie.
  6. During the window where lifetimes differ, use CSRF to send a request to the interface tied to the unexpired cookie.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A cookie is a small piece of data a site stores in your browser to remember who you are. This write-up says that when a site uses several cookies for login, a flaw in one cookie can be used to act as another user, or to send requests while one cookie is still valid after another has expired. The author gives general ideas rather than a full tested attack.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.