Skip to content
DoS Write-up Intermediate

Null Byte Injection in Token Name Blocks Admin From Deleting It

A user with a Reader role could create an API token whose name contains a null byte, which is stored but not displayed. Because the deletion confirmation compares the typed name against the stored name, the admin could never match it, so the token could not be deleted and the token limit could be exhausted.

medium.com

Published on medium.com

Bug Bounty

Islam Hamdy, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is a feature flag application that organises access around organizations, members and roles. Users can create API tokens to communicate with the API, and a token can be assigned any role that is Reader or above. The report refers to the application as target.com.

A token can be deleted only by its owner and by the admin. Deletion is not a single click: to confirm, you have to type the token name again, and the delete action only proceeds when the typed name matches the stored one.

Setup

The researcher was navigating the application normally and tested this flow first. The only precondition for the attack is an account that can create tokens, which means any role of Reader or above. No special tooling is described. The report is dated Cairo, Egypt, June 5, 2026, and rates the issue High with CVSS 7.1 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H).

Finding it

The researcher's guiding question was whether input given to the application is later used in another request as part of a fetch process. Here the token name is supplied at creation time and then reused at deletion time as the confirmation value. That reuse is what makes the name interesting.

The creation request looks like this:

HTTP
POST /api/v2/tokens HTTP/2Host: target.comAccept: application/jsonContent-Type: application/json{"name":"apitoken","role":"reader","defaultApiVersion":20240415,"serviceToken":false,"creationDate":0}

The "name":"apitoken" field decides the token name. The idea was to embed a hidden byte in that name so that when the admin retypes it for confirmation, the typed value cannot match the real stored name. A null byte was chosen because it can sit inside the text without being visible.

The researcher also considered making the name itself empty. That was tried, but typing spaces makes the confirmation button work, so it is not a valid issue with real impact.

Exploitation

Step 1: create a token with a null byte in its name

The payload is test\u0000hidden. The parser used in JavaScript treats this as only test, ignoring the rest of the name.

HTTP
POST /api/tokens HTTP/2Host: target.comAccept: application/jsonContent-Type: application/json{"name":"test\u0000hidden","role":"reader","defaultApiVersion":20240415,"serviceToken":false,"creationDate":0}

The token is created with the role reader. The stored name contains the null byte, but the interface shows only the visible part.

Step 2: observe the name in the interface

The token name looks totally normal in the listing:

From the original on medium.com

Nothing in the displayed name hints that a hidden byte is present.

Step 3: try to delete it

Trying to delete the token by copying its name or typing it manually does not work: the delete button stays inactive. There is parsing confusion, and even typing it as test\u0000hidden will not make it work.

From the original on medium.com

Step 4: repeat up to the cap

One undeletable token is a nuisance. An organization can have at most 200 tokens, so 200 undeletable tokens block the whole token management feature: the admin cannot delete any of them.

From the original on medium.com

Root cause

The name is accepted with a null byte, while the JavaScript parser treats it as only test, ignoring the rest of the name. The visible value and the stored value therefore diverge: the interface shows test, the store holds test\u0000hidden. The parser compares the typed name with the stored name, so the visible name does not match. The report does not describe the server-side comparison itself, so whether the mismatch happens on the client, the server, or both is not stated.

The empty-name variant was considered and rejected because typing spaces makes the confirmation button work, so it has no real impact.

Impact

An attacker with a Reader role can chain this null byte injection to achieve a complete and unrecoverable denial of service on the organization's token management system. The report notes that the 200-token cap can be reached directly or chained with a race condition. Because the tokens cannot be deleted, the Access Tokens feature is blocked and, in the researcher's words, unrecoverable.

The CVSS vector reflects the conditions: network attack, low complexity, low privileges required, no user interaction, unchanged scope, no confidentiality impact, low integrity impact and high availability impact.

Fix

The report does not describe a fix or a vendor response. Based on the root cause, the name should be validated on input so that control characters such as the null byte are rejected or stripped before storage, and the deletion confirmation should compare against the same normalised value that is displayed. Neither change is confirmed in the report.

Variants to test

  1. Other control characters in names. Submit names containing other non-printing bytes and check whether the listing shows a shorter string than the one stored. A positive result is a name that cannot be reproduced by typing or copying it into the confirmation field.
  2. Null bytes in other confirmation flows. Look for any feature where a user must retype a value to confirm a destructive action, such as project names, webhook names or API key labels. A positive result is a confirmation that cannot be completed for an object you created.
  3. Null bytes in identifiers used in later requests. Where a name is reused in a subsequent fetch, as the researcher's opening note suggests, try a null byte and observe whether the request targets a truncated value. A positive result is a mismatch between the object shown and the object acted on.
  4. Cap exhaustion. On any product with a per-organization limit on a resource that only an admin can delete, create undeletable entries up to the cap. A positive result is a management screen where the admin can no longer remove any entry.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

What happened, in plain words

A security researcher found a way to create an API token that nobody, not even the organisation's admin, can delete. The trick is to put a hidden character (a null byte) inside the token's name. The screen shows the name as something short and normal, but the app actually stores a longer name with an invisible character in it. When the admin tries to confirm deletion by typing the name they see, it never matches what is stored, so the delete button stays disabled. Because an organisation can hold at most 200 tokens, someone with a Reader role can fill all 200 slots with tokens that cannot be removed, and the whole token management feature stops working.

The report rates this High with a CVSS score of 7.1, using the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H. It is dated Cairo, Egypt, June 5, 2026.

Some background first

Before the details, a few ideas that come up throughout the report.

  • API: an API (Application Programming Interface) is the way one piece of software talks to another. Think of a restaurant: you do not walk into the kitchen, you give your order to a waiter, and the waiter brings back the food. The API is the waiter. In a web app, your browser sends requests to the API and gets answers back, usually in a format called JSON.
  • JSON: a simple text format for structured data, made of names and values in curly braces, like {"name":"apitoken"}. It is how the browser and the server exchange information.
  • Token: a token is a long secret string that acts like a password for software rather than a person. If a program needs to use the API, it presents the token instead of logging in with a username and password. Think of it as a key card you hand to a machine so it can get through doors on your behalf.
  • Feature flag app: a product that lets teams switch features on and off for different users without changing code. It organises people into organizations (a company or team), members (the people in it) and roles (what each person is allowed to do).
  • Role: a label that decides permissions. This app has a lowest useful role called Reader, and above it higher roles including admin. A Reader can read things but not change much; an admin can manage the organisation.
  • Null byte: a single byte with the value zero, written \u0000 in JavaScript-style text. It is invisible on screen. Many programs treat it as "the string ends here", which is exactly what causes the problem in this report.
  • Parser: the part of a program that reads text and decides what it means. Different parsers can read the same text differently, and that disagreement is the heart of this bug.
  • Denial of Service (DoS): making a feature unusable for the people who need it, without necessarily stealing anything. Think of blocking a shop's doorway so customers cannot get in.
  • CVSS: a standard scoring system for security bugs. The vector is a compact string of letters that records the conditions of the attack.

About the target

The target is a feature flag application that organises access around organizations, members and roles. Users can create API tokens to communicate with the API, and a token can be assigned any role that is Reader or above. The report refers to the application as target.com.

A token can be deleted only by its owner and by the admin. Deletion is not a single click: to confirm, you have to type the token name again, and the delete action only proceeds when the typed name matches the stored one. This retyping step is the confirmation the researcher attacks. It is also the step the researcher attacks.

Setup

The researcher was navigating the application normally and tested this flow first. The only precondition for the attack is an account that can create tokens, which means any role of Reader or above. No special tooling is described.

Finding it

The researcher's guiding question was whether input given to the application is later used in another request as part of a fetch process. In plain terms: if I type something now, will the app reuse that same text later, somewhere I cannot see? Here the token name is supplied at creation time and then reused at deletion time as the confirmation value. That reuse is what makes the name interesting.

The creation request looks like this:

HTTP
POST /api/v2/tokens HTTP/2Host: target.comAccept: application/jsonContent-Type: application/json{"name":"apitoken","role":"reader","defaultApiVersion":20240415,"serviceToken":false,"creationDate":0}

Line by line:

  • POST /api/v2/tokens is the request that creates a new token. POST means "send data to create something", and /api/v2/tokens is the address of the token feature on the server.
  • HTTP/2 is the version of the web protocol being used.
  • Host: target.com says which website the request is for.
  • Accept: application/json tells the server the client expects a JSON answer.
  • Content-Type: application/json tells the server the body of the request is JSON.
  • The body {"name":"apitoken","role":"reader","defaultApiVersion":20240415,"serviceToken":false,"creationDate":0} is the data being sent. "name":"apitoken" decides the token name. "role":"reader" gives the token the Reader role. The other fields set an API version, say this is not a service token, and set a creation date.

The "name":"apitoken" field decides the token name. The idea was to embed a hidden byte in that name so that when the admin retypes it for confirmation, the typed value cannot match the real stored name. A null byte was chosen because it can sit inside the text without being visible.

The researcher also considered making the name itself empty. That was tried, but typing spaces makes the confirmation button work, so it is not a valid issue with real impact.

Exploitation

Step 1: create a token with a null byte in its name

The payload is test\u0000hidden. The parser used in JavaScript treats this as only test, ignoring the rest of the name.

HTTP
POST /api/tokens HTTP/2Host: target.comAccept: application/jsonContent-Type: application/json{"name":"test\u0000hidden","role":"reader","defaultApiVersion":20240415,"serviceToken":false,"creationDate":0}

Line by line:

  • POST /api/tokens is the same creation request as before, at a slightly different address.
  • Host: target.com, Accept: application/json and Content-Type: application/json play the same roles as in the first request.
  • The body is the same shape, but "name" is now "test\u0000hidden". The \u0000 is the null byte written in JavaScript notation. The name is meant to read as test, then an invisible byte, then hidden.
  • "role":"reader" keeps the token at the same low role the attacker already holds, so no extra privilege is needed.

The token is created with the role reader. The stored name contains the null byte, but the interface shows only the visible part.

Step 2: observe the name in the interface

The token name looks totally normal in the listing:

From the original on medium.com

Nothing in the displayed name hints that a hidden byte is present. To anyone looking at the screen, the token is simply called test. The hidden part is invisible, which is why the admin has no reason to suspect anything when they later try to delete it.

Step 3: try to delete it

Trying to delete the token by copying its name or typing it manually does not work: the delete button stays inactive. There is parsing confusion, and even typing it as test\u0000hidden will not make it work.

From the original on medium.com

This is the core of the bug. The screen shows test, so the admin types test. But the app stored test\u0000hidden, and the confirmation compares the typed value with the stored value. They do not match, so the delete button never becomes active. Even someone who knows the trick and types it as test\u0000hidden fails.

Step 4: repeat up to the cap

One undeletable token is a nuisance. An organization can have at most 200 tokens, so 200 undeletable tokens block the whole token management feature: the admin cannot delete any of them.

From the original on medium.com

Root cause

The name is accepted with a null byte, while the JavaScript parser treats it as only test, ignoring the rest of the name. The visible value and the stored value therefore diverge: the interface shows test, the store holds test\u0000hidden. The parser compares the typed name with the stored name, so the visible name does not match. The report does not describe the server-side comparison itself, so whether the mismatch happens on the client, the server, or both is not stated.

The empty-name variant was considered and rejected because typing spaces makes the confirmation button work, so it has no real impact.

Impact

An attacker with a Reader role can chain this null byte injection to achieve a complete and unrecoverable denial of service on the organization's token management system. The report notes that the 200-token cap can be reached directly or chained with a race condition. Because the tokens cannot be deleted, the Access Tokens feature is blocked and, in the researcher's words, unrecoverable.

The CVSS vector reflects the conditions: network attack, low complexity, low privileges required, no user interaction, unchanged scope, no confidentiality impact, low integrity impact and high availability impact. In everyday terms: the attacker can do this remotely, it is easy, they only need a low-level account, they do not need to trick anyone into clicking anything, and the main damage is that a feature stops working.

Fix

The report does not describe a fix or a vendor response. Based on the root cause, the name should be validated on input so that control characters such as the null byte are rejected or stripped before storage, and the deletion confirmation should compare against the same normalised value that is displayed. Neither change is confirmed in the report.

Variants to test

  1. Other control characters in names. Submit names containing other non-printing bytes and check whether the listing shows a shorter string than the one stored. A positive result is a name that cannot be reproduced by typing or copying it into the confirmation field.
  2. Null bytes in other confirmation flows. Look for any feature where a user must retype a value to confirm a destructive action, such as project names, webhook names or API key labels. A positive result is a confirmation that cannot be completed for an object you created.
  3. Null bytes in identifiers used in later requests. Where a name is reused in a subsequent fetch, as the researcher's opening note suggests, try a null byte and observe whether the request targets a truncated value. A positive result is a mismatch between the object shown and the object acted on.
  4. Cap exhaustion. On any product with a per-organization limit on a resource that only an admin can delete, create undeletable entries up to the cap. A positive result is a management screen where the admin can no longer remove any entry.

Glossary

  • API: the way one piece of software talks to another, like a waiter carrying orders between you and the kitchen.
  • JSON: a text format for structured data, made of names and values in curly braces.
  • Token: a secret string that lets software use an API, like a key card for a machine.
  • Feature flag app: a product that switches features on and off for users, organised into organizations, members and roles.
  • Organization: a company or team inside the product.
  • Member: a person who belongs to an organization.
  • Role: a label that decides what a member is allowed to do.
  • Reader: the lowest useful role in this app, able to read but not change much.
  • Admin: a high role that can manage the organization.
  • Null byte: a single byte with the value zero, written \u0000, invisible on screen and often treated as the end of a string.
  • Payload: the crafted input an attacker sends to trigger a bug.
  • Denial of Service (DoS): making a feature unusable for the people who need it.
  • Race condition: a situation where two actions happen at nearly the same time and interfere with each other.
  • CVSS: a standard scoring system for security bugs, with a vector string that records the conditions of the attack.
  • Confirmation flow: a step where a user must retype a value before a destructive action is allowed.
  • Control character: a non-printing byte that affects how text is processed rather than being shown.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.