Skip to content
Account takeover Write-up Intermediate

UUIDv1 And Sandwich Attacks

UUIDv1 tokens used for password reset are predictable because they are based on a timestamp and a fixed node ID. An attacker who can obtain two tokens generated around the victim's token can brute-force the timestamp range to recover the victim's reset token.

offsec12 Follow

Published on medium.com

Today, I will talk about UUID Version 1 Sandwich Attacks. What is a UUID, and What’s the Difference Between UUID Version 1 and Version 4?

Diman, 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 the application uses UUIDv1, which embeds a predictable timestamp and a constant node ID, as a password reset token instead of a cryptographically random value.

Impact

An attacker could take over a victim's account by predicting their password reset token, provided they can trigger reset requests for their own account immediately before and after the victim's request.

What the attacker needed

Attacker can request password resets; victim's reset request occurs between attacker's; server uses UUIDv1 for reset tokens

How it was found

  1. Send a password reset request for the attacker's own account to obtain a UUIDv1 token.
  2. Send a password reset request for the victim's account.
  3. Send another password reset request for the attacker's own account to obtain a second UUIDv1 token.
  4. Brute-force the timestamp range between the two attacker tokens to generate candidate UUIDs.
  5. Test each candidate UUID against the reset password endpoint until the victim's token is found.

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 UUID is a long string used as a unique identifier, often for things like password reset links. Some UUIDs are made from the current time and the server's hardware address, so if you know roughly when one was created, you can guess the exact value. This article shows that if you can get two reset links created just before and after a victim's link, you can work out the victim's link by trying all times in between.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.