How can a zero width character leads to privilege escalation
medium.com
Published on medium.com
Bug Bounty
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.
Context
The target is a SaaS application with a workspace and invitation model. Every workspace has four roles:
| Role | Invitation rights |
|---|---|
| owner | not described beyond owning the workspace |
| admin | can invite any role |
| manager | can invite members only |
| member | cannot invite any user |
The admin role can do anything, while managers and members are restricted. The invitation workflow is the feature under test: a user with the right role submits an email address and the application creates an invitation that the recipient can later redeem to join the workspace with a given role.
The application also prevents users from inviting their own email address through its normal invitation workflow.

The researcher's interest was the invitation surface itself: a member whose role had been downgraded from admin, or a manager downgraded from manager, might be able to get the old privileges back through an invitation created earlier.
Setup
The report does not describe specific accounts, tools or versions. The preconditions that matter are:
- A workspace with the four roles above and an invitation feature that assigns a role on redemption.
- A user who holds
Admin(orManager) and can therefore create invitations. - The ability to have that user's role changed by the workspace owner, or to have the user removed from the workspace.
- An invitation that can be created and left unredeemed.
Finding it
The researcher treated the invitation workflow as an attack surface and looked at two things: whether the self-invitation restriction could be bypassed, and whether an invitation stays valid after the account's authorization state changes.
The self-invitation restriction is enforced on the email string submitted in the invitation request. Inserting a U+200B ZERO WIDTH SPACE character into the email input bypasses that restriction: the application accepts the invitation request and creates an invitation associated with the user's own account.

This suggests the application does not handle different representations of an email address consistently across its validation, duplicate-checking and invitation-processing logic. The invitation can then be kept without redeeming it immediately.
Exploitation
The attack combines two related behaviours: bypassing the self-invitation restriction, and reusing an invitation after the account's authorization state changes.
Step 1: Initial state
A user has the Admin role in a workspace.
Step 2: Create a self-invitation
The application normally rejects invitations targeting the user's own email address. Inserting a U+200B ZERO WIDTH SPACE character into the email input allows the invitation request to be accepted. The report does not show the exact payload, only that a U+200B character is inserted into the email input.
What it states is that the request is accepted and an invitation associated with the user's account is created.
Step 3: Retain the invitation
The user leaves the invitation unused while it remains available for redemption.
Step 4: Role downgrade
The workspace owner deliberately changes the user's role from Admin to Member.
Step 5: Redeem the old invitation
The user redeems the invitation created before the downgrade.
Step 6: Restore privileges
The application restores the user's previous Admin privileges without a new approval from the workspace owner.
A related scenario occurs when a user is removed from a workspace but can subsequently regain membership by redeeming an invitation that was created beforehand.
Root cause
The observed behaviour suggests the application may not consistently validate email identity across its invitation workflow. When a backend checks whether an invitation targets the current user's own email address, it must compare the underlying identity reliably rather than relying solely on the submitted email string.
A likely explanation is inconsistent input canonicalization:
- The backend receives an email address containing a zero-width Unicode character.
- The self-invitation or duplicate-invitation check evaluates the supplied string without applying the same canonicalization used elsewhere in the application.
- Because the resulting string differs from the stored email representation, the restriction does not match the existing account.
- The invitation request is accepted, even though the resulting invitation can later be associated with the same account.
The report presents this as a plausible explanation based on the observed behaviour; confirming the exact root cause would require examining the backend implementation or additional evidence about how the application processes the email address.
There is also a separate authorization concern. When the invitation is redeemed, the application appears to allow an invitation created under an earlier authorization state to restore the account's former role. This suggests the redemption workflow may not sufficiently revalidate the invitation against the user's current membership and permissions.
In short, the first weakness concerns how the invitation is created, while the second concerns whether it remains valid after the account's authorization state changes.
Impact
Under the conditions described, a user who holds Admin can create an invitation to their own account, keep it, and redeem it after the workspace owner downgrades them to Member, regaining Admin privileges without a new approval from the owner. A related scenario occurs when a user is removed from a workspace but can regain membership by redeeming an invitation created beforehand.
The effect is a privilege escalation that defeats the owner's decision to downgrade or remove the account.
Fix
Based on the described behaviour, the fixes would be:
- Canonicalize the submitted email address before the self-invitation and duplicate-invitation checks, using the same representation the application stores and compares elsewhere, so that a zero-width character cannot make the string differ from the account's email.
- Revalidate an invitation at redemption time against the user's current membership and permissions, rather than restoring the role recorded when the invitation was created.
- Invalidate outstanding invitations when a user's role changes or the user is removed from the workspace.
Variants to test
- Other invisible or confusable characters in the email field. Try other zero-width and formatting characters, and Unicode lookalikes, in the local part and domain. A positive result is an invitation created for your own account where the self-invitation check should have rejected it.
- Case and whitespace variations. Try changing the case of the address or adding leading and trailing whitespace. A positive result is the same as above: the check passes but the invitation resolves to your account.
- Invitation reuse after downgrade. Create an invitation while holding a privileged role, have the role downgraded, then redeem it. A positive result is the old role being restored without owner approval.
- Invitation reuse after removal. Create an invitation, get removed from the workspace, then redeem it. A positive result is regaining membership.
- Invitation reuse after role change of the inviter. Check whether an invitation created by an admin who is later downgraded still grants the role it was created with.
- Duplicate invitations. Create several invitations for the same address and redeem them in sequence. A positive result is more than one redemption succeeding, or a role being applied from an invitation that should have been superseded.
Conclusion
A single zero-width character in the email input was enough to bypass the self-invitation restriction, and the invitation it produced outlived the account's authorization state, restoring privileges after a downgrade.

What happened, in plain words
A security researcher was looking at a SaaS product. SaaS means "software as a service": a website you sign in to and use in your browser, where the company runs the servers for you. Think of it like renting a flat instead of building a house: you get the rooms, but someone else owns and maintains the building.
This particular product lets people work together in a shared space, which the report calls a workspace. Inside a workspace, each person has a role. A role is a label that says what you are allowed to do, like a badge that opens some doors and not others. The product has four roles: owner, admin, manager and member.
The feature the researcher tested is the invitation feature. An invitation is how you ask someone to join your workspace. You type their email address, the product creates an invitation, and when they accept it (the report says "redeem" it), they join the workspace with a role.
The researcher found two problems that work together:
- The product normally stops you from inviting your own email address. By putting an invisible character into the email address, the researcher got around that check, and the product created an invitation for the researcher's own account.
- That invitation stayed usable. If the workspace owner later downgraded the researcher from admin to member, the researcher could accept the old invitation and get admin back, without the owner agreeing to it.
Getting a higher level of access than you are supposed to have is called privilege escalation. "Privilege" here just means permission, and "escalation" means going up. It is like being moved from the staff car park to the manager's car park, then finding an old pass in your pocket that still opens the manager's gate.

The roles and why invitations are interesting
In a SaaS product there is always a lot to test, because there are many features and many ways for users to interact. The researcher focused on invitations.
The four roles behave like this:
| Role | What it can do with invitations |
|---|---|
| owner | owns the workspace; the report does not describe more |
| admin | can invite any role |
| manager | can invite members only |
| member | cannot invite any user |
An admin can do anything. Managers and members have restrictions. For example, a member cannot invite anyone, and a manager can only invite members.
The researcher's idea was simple: if someone who used to be an admin is downgraded to member, can they use an invitation they made earlier to become admin again? The same question applies to a manager who is downgraded. This is why the invitation feature is worth testing: it is a place where the product decides who gets which role, and decisions like that are where mistakes tend to hide.
1. Getting around the self-invitation restriction
The product has a rule: you cannot invite your own email address through the normal invitation workflow. A workflow is just the sequence of steps a feature goes through, like a recipe: fill in the form, submit it, the product checks it, the product creates the invitation.

To get around this, the researcher put a special character into the email input: U+200B ZERO WIDTH SPACE. This is a Unicode character. Unicode is the standard that gives every character in every writing system a number, so computers can agree on what a character is. U+200B is a space that takes up no width on screen: you cannot see it, and it does not push other characters apart. It is like a blank tile in a word game that looks like nothing but still counts as a tile.
The product accepted the invitation request and created an invitation linked to the user's own account. So the check that was supposed to say "you cannot invite yourself" did not fire.
Why does this happen? The report suggests the product does not handle different representations of an email address consistently. An email address is text, and text can be written in more than one way. If one part of the product compares the raw text you typed and another part compares a cleaned-up version, the two can disagree. Think of a bouncer checking names on a list: if the list says "John" and your ID says "John " with an invisible space at the end, a strict character-by-character comparison says they are different people, even though they are the same person.
The invitation can then be kept without accepting it straight away. It just sits there, waiting.
How the attack works, step by step
The attack has two parts: getting around the self-invitation restriction, and using an invitation after the account's permissions have changed.
- Starting point: a user has the
Adminrole in a workspace. - Create a self-invitation: the product normally rejects invitations to your own email address. Putting a
U+200B ZERO WIDTH SPACEcharacter into the email input makes the request accepted. - Keep the invitation: the user does not accept it yet. It stays available.
- Role downgrade: the workspace owner deliberately changes the user's role from
AdmintoMember. - Accept the old invitation: the user accepts the invitation that was created before the downgrade.
- Get the privileges back: the product restores the user's old
Adminprivileges, without the workspace owner approving it again.
There is a related case: a user who is removed from a workspace can get back in by accepting an invitation that was created before the removal.
Why the backend accepts this
The report says the product may not check email identity consistently across the invitation workflow. "Backend" means the part of the product that runs on the company's servers, out of sight of your browser. Your browser is the front end; the backend is the kitchen where the food is actually cooked.
When the backend checks whether an invitation is aimed at the current user's own email address, it has to compare the real identity, not just the text that was typed. The report offers a likely explanation: inconsistent input canonicalization. Canonicalization means turning different spellings of the same thing into one standard form. For example, "Example.COM" and "example.com" are the same domain, and a canonicalizing system would treat them as one. It is like a library that files "The Hobbit" and "Hobbit, The" under the same shelf mark.
The explanation runs like this:
- The backend receives an email address containing a zero-width Unicode character.
- The self-invitation or duplicate-invitation check looks at the submitted text without applying the same canonicalization used elsewhere in the product.
- Because the text is different from the stored email address, the check does not match the existing account.
- The invitation request is accepted, even though the invitation can later be linked to the same account.
The report presents this as a plausible explanation based on what was observed. Confirming the exact cause would need access to the backend code or more evidence about how the product processes the email address.
There is a second, separate concern about authorization. Authorization means deciding what a signed-in user is allowed to do. When the invitation is accepted, the product seems to let an invitation created under an earlier permission state restore the account's old role. That suggests the acceptance step does not properly re-check the invitation against the user's current membership and permissions.
Put simply: the first weakness is about how the invitation is created, and the second is about whether it is still valid after the account's permissions change.
2. Using an invitation again after a role change
Take a workspace where a user starts with the Admin role.
- The user creates a self-invitation by getting around the product's restriction.
- The workspace owner later changes the user's role from
AdmintoMember. - The user accepts the invitation created earlier.
- The product restores the user's old
Adminprivileges, without a new decision from the workspace owner.
The same underlying issue can affect removal from a workspace: an invitation created before a user is removed may still work to get membership back.
What the impact is
Under the conditions described, a user with Admin can create an invitation to their own account, keep it, and accept it after the workspace owner downgrades them to Member. They get Admin back without the owner approving it. A related case is a user who was removed from a workspace getting back in through an invitation created beforehand.
The effect is a privilege escalation that defeats the owner's decision to downgrade or remove the account. The report does not say which roles can be assigned through the accepted invitation beyond the user's own former role, and it does not say whether the invitation can be used to get a role higher than the one the user had when it was created.
How to fix it
The report does not say what was changed. Based on the behaviour described, the fixes would be:
- Canonicalize the submitted email address before the self-invitation and duplicate-invitation checks, using the same representation the product stores and compares elsewhere, so a zero-width character cannot make the text differ from the account's email.
- Re-check an invitation when it is accepted against the user's current membership and permissions, instead of restoring the role recorded when the invitation was created.
- Cancel outstanding invitations when a user's role changes or the user is removed from the workspace.
Other things to test
- Other invisible or lookalike characters in the email field. Try other zero-width and formatting characters, and Unicode characters that look like ordinary letters, in the part before the @ and in the domain. A positive result is an invitation created for your own account where the self-invitation check should have rejected it.
- Case and whitespace variations. Try changing the case of the address, or adding spaces at the start and end. A positive result is the same: the check passes but the invitation ends up linked to your account.
- Invitation reuse after downgrade. Create an invitation while you hold a privileged role, have the role downgraded, then accept it. A positive result is the old role coming back without the owner's approval.
- Invitation reuse after removal. Create an invitation, get removed from the workspace, then accept it. A positive result is getting membership back.
- Invitation reuse after the inviter's role changes. Check whether an invitation created by an admin who is later downgraded still grants the role it was created with.
- Duplicate invitations. Create several invitations for the same address and accept them one after another. A positive result is more than one acceptance succeeding, or a role being applied from an invitation that should have been replaced.
Conclusion
A single zero-width character in the email input was enough to get around the self-invitation restriction, and the invitation it produced outlived the account's permission state, restoring privileges after a downgrade.

Glossary
- Admin: a role in the workspace that can do anything, including inviting any role.
- Attack surface: all the parts of a product that an attacker can interact with and try to break.
- Authorization: the process of deciding what a signed-in user is allowed to do.
- Backend: the part of a product that runs on the company's servers, not in your browser.
- Canonicalization: turning different spellings of the same value into one standard form so they can be compared reliably.
- Duplicate-invitation check: a check that stops more than one invitation being created for the same address.
- Email address: the text identifier used to send someone an invitation, in the form name@domain.
- Front end: the part of a product you see and use in your browser.
- Invitation: a request created by a workspace member that lets a recipient join the workspace with a role when accepted.
- Manager: a role that can invite members only.
- Member: a role that cannot invite any user.
- Owner: the role that owns the workspace.
- Privilege escalation: getting a higher level of permission than you are supposed to have.
- Redeem: to accept an invitation and join the workspace with the role it carries.
- Role: a label that says what a user is allowed to do in a workspace.
- SaaS: software as a service; a product you use through a browser, run by a company on its own servers.
- Self-invitation restriction: the rule that stops a user inviting their own email address.
- U+200B ZERO WIDTH SPACE: a Unicode character that takes up no visible width on screen.
- Unicode: the standard that assigns a number to every character in every writing system.
- Workflow: the sequence of steps a feature goes through, such as filling in a form, submitting it, checking it and creating the result.
- Workspace: a shared space in the product where a group of people work together with different roles.