Skip to content
Business logic Write-up Intermediate

How a UTF‑7 Quirk Let Me “Break” Email Domain Validation

The registration form only allowed email addresses from a trusted domain, but the application decoded the local part of the email using UTF-7 while checking the domain separately. An attacker could craft an encoded email that passed the domain check but was delivered to an unauthorised address, allowing them to register and gain admin privileges.

marwan20hisham05 Follow

Published on medium.com

I sat there, staring at the registration form. All I wanted to do was register with [email protected], but the lab only accepted @ginandjuice.shop.

GhostX_101, 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 application used different parsers for validating the email domain and for delivering the email, so an encoded local part was interpreted differently by each.

Impact

An attacker could bypass domain-based access control, register with an unauthorised email address, and gain admin privileges, including deleting other users.

What the attacker needed

A registration form that accepts encoded local parts; attacker controls an external email address

The fix

The application should normalise email addresses before validating the domain, reject encoded local parts unless needed, and use the same parser for validation and delivery.

How it was found

  1. Craft an email address with a UTF-7 encoded local part that decodes to an @ symbol and a space, followed by the trusted domain.
  2. Submit the registration form with this crafted email address.
  3. Receive the confirmation email in the unauthorised mailbox and click the link.
  4. Log in with the new credentials and delete user carlos to prove admin access.

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.

Email addresses have two parts: the name before the @ and the domain after it. This site only let people sign up if the domain was the trusted one. The attacker used a special encoding for the name part so the site's check saw the trusted domain, but the email was actually sent to a different address. That let them create an account and then delete another user.

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.