Skip to content
Business logic Disclosed report Intermediate

Password Reset - query param overrides postdata

The password change endpoint accepted GET parameters that overrode the POST values submitted in the form, so an attacker could craft a link that set a victim's new password to a value the attacker chose. If the victim visited the link and completed the form with their current password and CAPTCHA, their password would be changed to the attacker-known value.

reecer Follow

Originally disclosed on HackerOne

Bounty$1,500 View original
  • Triaged in 15 days
  • Fixed in 18 days
  • Paid in 18 days
  • Disclosed after 56 days

Summary by the program

This bug was a result of the server being unable to distinguish GET and POST parameters, oftentimes defaulting to using a GET parameter value over that of a POST parameter. If an attacker convinced a user to visit a URL with the attacker-specified password as a parameter, then if the user provided their current password and solved the CAPTCHA, this could allow an attacker to overwrite the user's credentials. The attacker would specify "newpassword" and "newpassword2" GET parameters which would override the POST values that the user specified - thus, changing the user's password to the attacker-known value.

The report

Suppose a user were to reset their password at the following url (with the given query parameters):

https://accounts.snapchat.com/accounts/change_password?
newpassword={someNewPass}&newpassword2={someNewPass}

Then regardless of the new password entered into the form, {someNewPass} becomes the user's new password. This becomes malicious when an attacker refers a users to this url which contains these query parameters to change the user's password.

Even though this requires some level of social engineering -- convincing a user (whose username is known) not only to change his/her password, but do so via a given url -- I don't see a good reason to allow this behavior. Bottom line, don't read username/passwords from query string.

I look forward to your response.

The original report as published on HackerOne, by reecer. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server merged GET and POST parameters and gave the GET value precedence, so query-string values overrode the submitted form fields.

Impact

An attacker could change a victim's password to a known value, but only if the victim was convinced to visit a crafted link and complete the form with their current password and CAPTCHA.

What the attacker needed

Attacker knows victim's username; victim visits attacker-crafted link; victim enters current password; victim solves CAPTCHA

The fix

The server should not read password values from the query string and should only use the submitted form data.

How it was found

  1. Craft a password change URL containing the attacker-chosen new password in query parameters.
  2. Send the URL to a victim whose username is known.
  3. The victim enters their current password and solves the CAPTCHA.
  4. The server uses the query-string password instead of the submitted one, changing the account password to the attacker's value.

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 report has not been written yet. The Original tab links to the source.

When you submit a form, the data usually travels in the request body (POST). Here the server also looked at values in the web address (GET) and let those win. An attacker could send a link containing a chosen new password, and if the victim filled in the form, that chosen password would be set instead of the one they typed.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Snapchat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.