Skip to content
Business logic Write-up Intermediate

From Ghost to Glitch: Null Byte Injection in Registration & Passw

The registration form failed to properly handle null bytes in usernames and emails, allowing creation of unverified 'ghost' accounts that bypassed uniqueness checks. These ghost accounts could then trigger password reset emails to legitimate users, potentially leading to account takeover or confusion.

Maxcyber Follow

Published on medium.com

While testing a government-owned web portal under their Vulnerability Disclosure Program (VDP), I uncovered a subtle but impactful logic flaw involving null byte (%00) injection. This flaw enabled me to bypass username and email uniqueness validation during registration, resulting in the creation of "ghost accounts."

Maxcyber, 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 did not consistently normalise or validate input containing null bytes across different components, leading to inconsistent handling during registration and password reset.

Impact

An attacker could create ghost accounts that bypass uniqueness checks and trigger password reset emails to legitimate users, potentially leading to account takeover through social engineering or causing user confusion and database pollution.

What the attacker needed

Access to the registration form; knowledge of a valid username/email

The fix

The application should normalise and validate input consistently across all components, rejecting null bytes and ensuring that registration and password reset use the same validation logic.

How it was found

  1. Append a null byte to a username that already exists and submit the registration form.
  2. Append a null byte to an email address and submit the form manually.
  3. Observe that the account is created in a pending state without email verification.
  4. Use the ghost username in the 'Forgot Password' feature.
  5. Observe that a password reset email is sent to the legitimate user's email 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 write-up has not been written yet. The Original tab links to the source.

A null byte is a special character that some systems treat as the end of a string. The website's checks for duplicate usernames and emails were fooled by adding this character, so it allowed creating accounts that looked almost like existing ones. Later, the password reset system ignored the null byte and sent a reset email to the real user's address.

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.