Control character allowed in username
The application allowed a newline control character to be included in a username during registration. An attacker could register a name that matches an existing user's name plus a newline, causing the profile to return a 404 and potentially impersonating the other user in the interface.
Originally disclosed on HackerOne
- Fixed in 7 hours
- Paid in 7 hours
- Disclosed after 30 days
It turns out, that it is possible to register a user with a special sign %0a (appended in proxy). Possible consequences:
- You can't see the profile of this newly created user after registration (404 response)
- You can use this to spoof another user - just use the name of another user during registration, append %0a in proxy (when registration request is sent) and you will be finally recognized as this user in Phabricator (the same name presented/displayed). This way you can try to spoof another user.
What the report shows
The target is Phabricator, and the feature under test is user registration. The researcher found that a control character, the line feed %0a, could be smuggled into a username by appending it in the proxy, that is, by editing the registration request after the browser had built it but before it reached the server.
The payload as written in the report is:
The researcher describes two consequences.
- After registration, the profile of the newly created user cannot be viewed: the request returns a 404 response.
- The name can be used to impersonate another user. The attacker registers using the name of an existing user, appends
%0ain the proxy when the registration request is sent, and is then recognised in Phabricator as that user, because the same name is presented and displayed.
The report gives no request or response captures, no version numbers and no fix details. The platform records a bounty of 300.00 USD and a disclosure date of 12 April 2014; severity and weakness classification are not recorded.
Root cause
The report does not state a cause; the behaviour is consistent with the server accepting the value as sent.
Impact
As the report frames it, the impact is impersonation: an attacker can present themselves under another user's name inside Phabricator and "try to spoof another user". The researcher hedges this with "you can try to spoof another user". The secondary effect is a broken profile page for the crafted account, returning 404. The report describes no other consequences.
How this kind of bug works
Many applications validate input in the browser and trust it on the server. When a field is meant to be a short identifier, such as a username, the server should enforce the same rules the form implies: an allowed character set, a length limit, and rejection of control characters. Control characters are easy to miss because they are invisible in rendered output and in most logs. A line feed, carriage return, tab or null byte can survive JSON or form encoding and end up in a database column.
Once stored, the value can behave differently in different code paths. A uniqueness check may compare raw bytes, so alice and alice followed by a line feed are two distinct rows. A display layer may strip or collapse the trailing whitespace, so both render as alice. A routing or lookup layer may fail on the unexpected character, producing a 404. The result is a name collision that the application never intended to allow, which is the basis for impersonation in any system where names are used to identify people.
How to test for it
- Identify features where a user-chosen string becomes an identity: registration, profile rename, display name, team or organisation name, API key labels, email local parts.
- Register or rename an account with a normal value and confirm the baseline behaviour: profile loads, name displays as typed.
- Intercept the request in a proxy and append a control character to the value, one at a time: line feed, carriage return, tab, null byte, and combinations. Send the request and observe the response code.
- Check the stored result: does the profile load, and does the displayed name match the raw value or a trimmed version of it?
- Attempt a collision: take the name of an existing account, append the control character, and register. Then compare how both accounts are displayed in listings, mentions, audit logs and permission checks.
- Look for secondary effects: broken profile pages, failed logins, duplicate entries in search, or notifications routed to the wrong account.
A positive result is a stored value that the server accepted but that renders identically to another identity, or that breaks a page that should work. Common false positives are client-side trimming that the server also applies (the value is normalised before storage), characters that are rejected with a validation error, and display differences that exist only in the attacker's own session. Confirm the behaviour from a second account and, where possible, from an unauthenticated view.
How it is fixed
The standard fix is server-side validation of the username against an explicit allowlist of characters, with control characters rejected outright, applied on every path that writes the field, not only the registration form. Normalise input before the uniqueness check so that visually identical names cannot coexist, and trim surrounding whitespace consistently. Reject or encode control characters in output as well, so any legacy rows cannot break rendering. Where names are used for identity, prefer an immutable internal identifier and treat the display name as presentation only.
Hunting notes
This class of bug hides wherever a string is both user-controlled and used as an identity: sign-up flows, rename endpoints, invitation forms, SSO profile sync, and admin panels that create users. Recon signals include registration forms with client-side-only validation, APIs that accept JSON bodies directly, and applications that display names in many places (mentions, audit trails, email notifications), since each display path is a chance for a mismatch.
What happened, in plain words
Phabricator is a web application that teams use to manage software projects. Like most such tools, it lets people create accounts, and each account has a username that other people see. The researcher was testing that sign-up feature and found that a hidden control character could be slipped into a username.
The character in question is a line feed, written %0a. A line feed is what happens when you press Enter: it tells a computer to start a new line. It is invisible on screen, which is exactly why it is useful to an attacker. The payload as written in the report is:
The trick is that the browser normally will not let you type this into a username box. So the researcher edited the sign-up request after the browser had built it but before it reached the server. That editing is done with a proxy, a tool that sits between your browser and the website and lets you change messages in flight. Think of it as intercepting a letter after it has been sealed but before it is posted, opening it, adding a line, and sealing it again.
The report describes two consequences.
- After registration, the profile page of the newly created user cannot be viewed. The request returns a 404 response, which is the standard web answer for "this page does not exist".
- The crafted name can be used to impersonate another user. The attacker registers using the name of an existing user, appends
%0ain the proxy when the registration request is sent, and is then recognised in Phabricator as that user, because the same name is presented and displayed.
The researcher hedges the second point with "you can try to spoof another user". It gives no captured requests or responses, no version numbers and no fix details. The platform records a bounty of 300.00 USD and a disclosure date of 12 April 2014; severity and weakness classification are not recorded.
Why it works
The report does not state a cause; the behaviour is consistent with the server accepting the value as sent.
What the impact is
As the report frames it, the impact is impersonation: an attacker can present themselves under another user's name inside Phabricator. The secondary effect is a broken profile page for the crafted account, returning 404. The report describes no other consequences.
In general, how this kind of bug works
Many applications check input in the browser and then trust it on the server. When a field is meant to be a short identifier, such as a username, the server should enforce the same rules the form implies: an allowed set of characters, a length limit, and rejection of control characters. Control characters are easy to miss because they are invisible in rendered output and in most logs. A line feed, carriage return, tab or null byte can survive encoding and end up in a database column.
Once stored, the value can behave differently in different parts of the code. A uniqueness check may compare raw bytes, so alice and alice followed by a line feed are two distinct rows. A display layer may strip or collapse the trailing whitespace, so both render as alice. A routing or lookup layer may fail on the unexpected character, producing a 404. The result is a name collision the application never intended to allow, which is the basis for impersonation in any system where names are used to identify people.
In general, how to test for it
- Identify features where a user-chosen string becomes an identity: registration, profile rename, display name, team or organisation name, API key labels, email local parts.
- Register or rename an account with a normal value and confirm the baseline behaviour: the profile loads and the name displays as typed.
- Intercept the request in a proxy and append a control character to the value, one at a time: line feed, carriage return, tab, null byte, and combinations. Send the request and observe the response code.
- Check the stored result: does the profile load, and does the displayed name match the raw value or a trimmed version of it?
- Attempt a collision: take the name of an existing account, append the control character, and register. Then compare how both accounts are displayed in listings, mentions, audit logs and permission checks.
- Look for secondary effects: broken profile pages, failed logins, duplicate entries in search, or notifications routed to the wrong account.
A positive result is a stored value that the server accepted but that renders identically to another identity, or that breaks a page that should work. Common false positives are client-side trimming that the server also applies, characters that are rejected with a validation error, and display differences that exist only in the attacker's own session. Confirm the behaviour from a second account and, where possible, from an unauthenticated view.
In general, how it is fixed
The standard fix is server-side validation of the username against an explicit allowlist of characters, with control characters rejected outright, applied on every path that writes the field, not only the registration form. Normalise input before the uniqueness check so that visually identical names cannot coexist, and trim surrounding whitespace consistently. Reject or encode control characters in output as well, so any legacy rows cannot break rendering. Where names are used for identity, prefer an immutable internal identifier and treat the display name as presentation only.
In general, where to look
This class of bug hides wherever a string is both user-controlled and used as an identity: sign-up flows, rename endpoints, invitation forms, single sign-on profile sync, and admin panels that create users. Signals worth watching for include registration forms with client-side-only validation, APIs that accept JSON bodies directly, and applications that display names in many places (mentions, audit trails, email notifications), since each display path is a chance for a mismatch.
Glossary
- Phabricator: a web application for managing software projects, including accounts and usernames.
- Username: the short name that identifies an account and is shown to other people.
- Control character: a character that instructs a computer rather than being printed, such as a line feed or tab; usually invisible on screen.
- Line feed (
%0a): a control character meaning "start a new line", the same thing that happens when you press Enter;%0ais how it is written when encoded in a URL. - Encoding: the way special characters are written so they can travel inside a web address or form without being confused with ordinary text.
- Request: the message your browser sends to a website when you click a button or submit a form.
- Response: the message the website sends back, including a status code such as 404.
- 404: the standard web answer meaning the requested page does not exist.
- Proxy: a tool that sits between your browser and a website and lets you inspect and change messages in flight.
- Server-side validation: checking input on the website's own computer rather than only in the browser, so it cannot be bypassed by editing the request.
- Normalisation: converting input to a standard form, for example trimming spaces, so that values that look the same are treated as the same.
- Uniqueness check: the test that stops two accounts having the same name.
- Impersonation: pretending to be another person, here by displaying their name on your own account.
- Spoofing: a broader word for faking an identity or origin.
- Allowlist: an explicit list of characters that are permitted, with everything else rejected.
- Privilege escalation: gaining more permissions than you should have; not described in this report.
- Account takeover: gaining control of someone else's account; not demonstrated in this report.
- False positive: a result that looks like a bug but is not, for example because the server quietly cleans the value.