No Salt, Weak Security — How a Cookie Design Flaw Led to Accoun
The authentication cookie was constructed as Base64 of the username plus an unsalted MD5 hash of the password, making it predictable. An attacker who knows the format could generate cookies for guessed passwords and take over an account while its session was active.
Published on medium.com
Hello everyone! My name is Vamsi Kandukuru, a Cybersecurity graduate.
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
The cookie was built from predictable data (username and an unsalted MD5 hash of the password) instead of a random, server-side session identifier.
Impact
An attacker could take over a user's account, but only while that user's session remained active; once the session expired, access was terminated.
What the attacker needed
A free account; ability to intercept traffic; victim's session must be active
The fix
The application should use strong hashing algorithms with proper salting and secure session management instead of predictable cookies.
How it was found
- Create an account and log in while capturing requests with Burp Suite.
- Inspect the Cookie or Set-Cookie header after login and decode the value in layers.
- Identify the hash type as MD5 using a hash analyser tool.
- Generate candidate cookies by hashing passwords from a wordlist with MD5, prefixing the username, and Base64-encoding the result.
- Send an authenticated request to Burp Intruder with the cookie value as the payload position and run the attack.
- Find the response with a different length and a 200 OK status, then decode that cookie to recover the password and log in.
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 your browser stores and sends back to a website to prove who you are. Here the cookie was just the username and a scrambled version of the password, with no random extra value (salt) to make it unique. Because the scrambling method (MD5) is fast and well known, an attacker could guess passwords, create matching cookies, and log in as someone else.
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.