Skip to content
File upload Write-up Beginner

Breaking It During a Hackathon

The application validated file uploads only by the Content-Type header, allowing an attacker to upload an HTML file that executed JavaScript when accessed. The login endpoint lacked rate limiting and password policy, enabling brute-force attacks, and password reset tokens were not invalidated after use, allowing reuse. User enumeration was possible via different responses from the forgot-password endpoint.

debang5hu Follow

Published on medium.com

Worked on security testing for target.com with a team of four, this write-up highlights the bugs I found and how I approached them.

debang5hu, 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

Impact

An attacker could upload malicious files to execute scripts in victims' browsers, brute-force login credentials due to lack of rate limiting, reuse old password reset tokens, and enumerate valid user accounts.

What the attacker needed

Ability to intercept HTTP requests; valid user account for some tests; victim opens uploaded file link

How it was found

  1. Intercept a file upload request.
  2. Replace the file with an HTML file and set the content type to application/pdf.
  3. Upload the file and obtain the returned file path.
  4. Access the uploaded file via the provided URL to execute the embedded JavaScript.

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 website trusted the file type label that the browser sends, so someone could upload a web page that runs code when opened. The login page let people try passwords endlessly, and old password reset links kept working even after new ones were made. Also, the password reset page revealed whether an email address was registered.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by debang5hu

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.