Stored XSS Leads to Plaintext Password Disclosure
The profile image upload feature allowed an HTML file to be uploaded and served from the same domain as the web application, leading to stored cross-site scripting. An attacker could execute JavaScript in a victim's browser to read the AUTHH cookie, which contained base64-encoded HTTP Basic Authentication credentials in plaintext, and disclose the victim's username and password.
This post documents another vulnerability I found in the same company as the last post. I disclosed both vulnerabilities on the same day and was told that both vulnerabilities have been resolved.
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 server accepted an HTML MIME type for profile pictures and served the uploaded file from the main application domain without authentication, allowing stored cross-site scripting.
Impact
An attacker could steal a victim's plaintext username and password by getting them to visit a malicious profile image link, leading to account takeover.
What the attacker needed
Ability to upload a profile image; victim visits the malicious image URL; victim is logged into the web application
The fix
The issues were fixed by the company, though the specific fix is not described.
How it was found
- Intercept the profile image upload request and note the ProfilePictureMIME parameter.
- Change the MIME type to text/html and replace the image data with a base64-encoded HTML file.
- Send the request and confirm the HTML renders when accessed via the raw file URL.
- Log into the web application and visit the uploaded HTML file URL.
- Observe that the script can read the AUTHH cookie and decode it to plaintext credentials.
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.
The app let users upload a profile picture, but it did not check that the file was really an image. Someone could upload a web page with a script instead. Because that page was served from the same website, the script could read a cookie that held the user's login details in an easily decodable form, revealing their password.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.