Skip to content
Business logic Write-up Intermediate

Email Body Truncation via Null Byte Injection

The application interpreted Unicode escape sequences in the user's display name when constructing invitation emails, so a null byte (\u0000) in the name truncated the email body. An attacker could send emails from the company's official address containing arbitrary text, such as a phishing message.

0xcyborg Follow

Published on medium.com

Hello, I’m 0xcyborg and today I’m going to share a vulnerability I discovered recently on a bug bounty program.

0xcyborg, 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 failed to sanitise or escape Unicode escape sequences in user-controlled input before using it in email generation, allowing a null byte to terminate the string.

Impact

An attacker could send emails from the company's official, verified email address containing arbitrary text, such as a phishing message, to any recipient.

What the attacker needed

A free account; ability to set display name; victim receives invitation email

How it was found

  1. Create a note and share it with a second email address to receive an invitation email.
  2. Change the account name to include a backslash and observe that no email is received.
  3. Remove the backslash and confirm the email is received again.
  4. Set the name to a Unicode escape sequence (e.g., \u0061) and verify it is rendered as the corresponding character in the email.
  5. Set the name to \u0000 and observe that the email body is truncated to empty.
  6. Set the name to a phishing message ending with \u0000 and confirm the email contains only that message.

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 sign up, you can set a display name. The app put that name into emails it sent to others. The app also treated certain backslash codes in the name as special characters. One code stands for a 'null byte', which some programs treat as the end of a piece of text. By putting that code in the name, the attacker made the email stop early, so they could control the visible message.

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 0xcyborg

View all

2 more disclosed reports, best first.

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.