Skip to content
XSS Write-up Intermediate

Exploiting Auto-save Functionality To Steal Login Credentials

The filename of an uploaded file was reflected into the public file page without proper sanitisation, allowing HTML injection. An attacker could craft a filename containing a hidden login form that, when a victim visited the public link, would be auto-filled by the browser's password manager and submitted to an attacker-controlled server, stealing credentials.

Saad Ahmed Follow

Published on saadahmedx.medium.com

Hi Folks! hope you all doing well it’s being a long time since I do a write-up, so this write-up is all about my tweet Exploiting/Chaining auto-save functionality to takeover the victim account.Make sure to follow @xSaadAhmedand @SecurityFosterfor more upcoming amazing write-ups & tools.

Saad Ahmed, on saadahmedx.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

Impact

An attacker could steal a victim's login credentials if the victim's browser auto-fills saved passwords and the victim submits the hidden form.

What the attacker needed

Victim has saved credentials in browser; victim visits attacker's public link; victim clicks submit on hidden form

The fix

The application should sanitise or encode filenames before displaying them to prevent HTML injection.

How it was found

  1. Upload a file with a crafted filename containing HTML form code.
  2. Obtain the public link to the uploaded file.
  3. Send the public link to a victim.
  4. Victim visits the link; browser auto-fills hidden form fields with saved credentials.
  5. Victim clicks submit; credentials are sent to the attacker's server.

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.

When you upload a file, the website shows its name on a public page. The site did not clean the name properly, so an attacker could put HTML code in the filename. That code made a fake login form that the browser's password manager filled in automatically, sending the victim's username and password to the attacker.

What is XSS?

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

More by Saad Ahmed

View all

9 more disclosed reports, best first.

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.