Skip to content
Business logic Write-up Beginner

Bypass Password Confirmation on Change Email

The server only enforced the password check when the request Content-Type was application/json. By sending the email-change request with a different Content-Type, an attacker could change the account email without supplying the password.

karim.hikal1 Follow

Published on medium.com

بِسْ� ِ اللَّهِ الرَّحْ� َنِ الرَّحِي� ِ “يَا أَيُّهَا الَّذِينَ آ� َنُوا كُلُوا � ِن طَيِّبَاتِ � َا رَزَقْنَاكُ� ْ وَاشْكُرُوا لِلَّهِ إِن كُنتُ� ْ إِيَّاهُ تَعْبُدُونَ”

Karim Hekal, 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

Root cause

Likely the server applied its password and captcha validation only inside the JSON parsing path, so requests with other content types bypassed those checks.

Impact

An attacker who has stolen a victim's session cookies could change the victim's email and take over the account completely.

What the attacker needed

Victim's session cookies stolen; account with email-change feature

The fix

The server should accept only application/json, reject other content types with 415, and always validate required fields such as password and captcha on the server before any update logic runs.

How it was found

  1. Open the change-email function and observe that it asks for the account password.
  2. Capture the update-email request, which contains a session cookie, a captcha header and a JSON body with the new email and password.
  3. Try removing the captcha or the password, and try changing the request method; both attempts fail.
  4. Change the Content-Type header from application/json to another type such as text/html or application/xml.
  5. Send the request; the server accepts it and changes the email without checking the password.

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 change your email on a website, the site should ask for your password to prove it is really you. Here, that check only happened if the request was labelled in one particular way (as JSON, a common data format). Sending the same request with a different label skipped the password check entirely.

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.

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.