Skip to content
Business logic Disclosed report Intermediate

Bypass auth.email-domains

Phabricator did not check the length of email addresses during registration, while the database column could only store 128 characters. An attacker could register with an overlong address ending in an allowed domain, have the domain part truncated away, and still receive the verification email, thereby bypassing the allowed email-domains restriction.

tomvg Follow

Originally disclosed on HackerOne

Bounty$1,000 View original
  • Triaged in 1 hour
  • Fixed in 2 hours
  • Paid in 3 hours
  • Disclosed after 30 days

Email addresses are stored as VARCHAR(128). However, Phabricator does not verify the length of an email address upon registration. This allows attackers to bypass the allowed email-domains defined in auth.email-domains.

Exploiting this is rather straightforward: get an email address of 128 characters long (This StackOverflow answer indicates that the maximum length of an email address is 254 characters). Now register with your 128 character email address with @allowed-domain.com appended to it. The @allowed-domain.com part will be truncated because MySQL can’t store it, and you will receive a verification email on your 128 character email address.

This is especially easy if you’re using a Gmail address: if you own [email protected], you’ll also receive any mails sent to attacker+aaaaaaaaaaa…[email protected].

The original report as published on HackerOne, by tomvg. 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 application accepted an email address longer than the database column could hold, and the database silently truncated it.

Impact

An attacker could create an account using an email address outside the permitted domains, defeating the domain restriction.

What the attacker needed

An email address exactly 128 characters long; the ability to receive mail at that address

How it was found

  1. Obtain an email address that is exactly 128 characters long.
  2. Append the allowed domain to that address.
  3. Register with the resulting overlong address.
  4. Receive the verification email at the original 128-character address.

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.

A website can restrict sign-ups to certain email domains, such as only company addresses. Here the site stored the email in a fixed-size box that silently cut off anything past 128 characters. By putting an allowed domain at the very end of a very long address, the cut removed that domain, so the check passed even though the real address was elsewhere.

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 by tomvg

View all

4 more disclosed reports, best first.

More from Phabricator

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.