Skip to content
Business logic Write-up Beginner

Bypassing Bad-Word Filters with Unicode Homoglyphs

A short URL service's bad-word filter compared raw text, so a word with one Latin letter replaced by a visually identical Cyrillic letter was accepted. An attacker could publish an offensive word as a live link under the company's own domain.

adhammedhat Follow

Published on medium.com

Security Researchers

Adham Medhat (SemZ), 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

A short URL service that issues branded links under the company's own domain runs a bad-word filter over the slugs users choose. The filter's purpose, as the report frames it, is to stop bad words from appearing on the company's own links: it protects the brand name, not merely tidiness. The finding was reported through a bug bounty program. The researcher did not break the filter's logic; he supplied a word the filter did not know how to recognise.

The word `fuck` was blocked immediately. The word `fuсk`, which looks identical on screen with one letter swapped for a Cyrillic look-alike, was accepted and went live in seconds, visible to anyone.

## Setup

The report describes no accounts, roles, tooling or versions. The only precondition it establishes is that the service accepts a user-chosen slug and applies a bad-word filter to it before creating the link. The researcher sent requests directly and then checked the result with an unauthenticated request.

## Finding it

The observation is about how text is compared. Computers store letters as numbers called code points. The Latin `c` and the Cyrillic `с` render the same on screen but are different numbers: Latin `c` is U+0063, Cyrillic `с` is U+0441. A human reading the two sees no difference; a filter comparing raw text sees two different letters.

These look-alike letters are called homoglyphs, or confusables. The report notes they have long been used to build fake phishing sites, for example by swapping a Cyrillic `а` into a brand name. The same trick defeats any filter that only checks letter case or strips symbols but never checks for look-alike letters.

## Exploitation

### Step 1: Try the blocked word

The researcher sent the word `fuck` as a slug. The server rejected it right away.


{{media:1}}


At this point the filter behaves as intended, as long as the input is plain ASCII text.

### Step 2: Swap one letter

The Latin `c` was replaced with the Cyrillic look-alike `с`, and the request was sent again.


{{media:2}}


The filter did not catch it, because the two words are not made of the same bytes. The link was created and went live immediately.

### Step 3: Check that anyone can open it

A simple `GET` request, requiring no login, returns the link:

```http
GET /tidy/fuсk HTTP/2Host: api.example.la
```

```http
HTTP/2 200 OK{"id":"fuсk","short_url":"http://example.la/fuсk","long_url":"https://www.example.com/x"}
```

The response confirms the slug was stored and published as `fuсk` on the short domain, resolving to the supplied long URL. Anyone who sees the link reads a word that looks exactly like the one the platform tried to block.

## Root cause

The filter compares the raw text of the slug against its word list. Because the Cyrillic `с` (U+0441) is a different code point from the Latin `c` (U+0063), the string `fuсk` does not match the blocked entry `fuck`, even though the two are indistinguishable to a reader. The report states plainly that the filter was checking something different from what a person actually sees on screen. The report does not describe the filter's implementation, so the exact comparison method is not stated.

## Impact

According to the report, the consequences are:

- Any user can publish a rude, offensive or hateful word as a link under the company's own domain.
- The link looks exactly like the blocked word to anyone who sees it shared, in a screenshot or printed out.
- Each bad link is permanent and goes live the moment it is created; no one reviews it first.

The report frames the issue as brand protection rather than a break of the filter's mechanics, and does not claim any impact beyond the publication of such links.

## Fix

The report does not state what was changed. Based on the root cause it describes, the filter should normalise input before comparison, so that look-alike code points are mapped to a canonical form and `fuсk` is treated the same as `fuck`.

## Variants to test

1. **Other homoglyph substitutions.** Replace individual letters in a blocked word with visually identical characters from other scripts (for example Cyrillic `а`, `е`, `о`, `р`, `с`, `�

` for their Latin counterparts). A positive result is a slug that renders as the blocked word but is accepted and published.
2. **Mixed-script words.** Combine Latin and Cyrillic letters in a single slug rather than swapping just one. A positive result is acceptance of a slug that a reader cannot distinguish from the blocked term.
3. **Case and symbol handling.** Try case variants and inserted symbols or separators around a blocked word. A positive result is a published slug that still reads as the blocked word.
4. **Verification without authentication.** After any accepted slug, issue an unauthenticated `GET` for the short path, as in Step 3. A `200` response containing the slug in `id` and `short_url` confirms the link is live to anyone, not just to the creator.

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. 9 min read.

## What happened, in plain words

A company runs a service that turns long web addresses into short links. The links use the company's own domain name, so they look official. To keep its brand clean, the service checks the short name you choose (the "slug") against a list of rude or offensive words and refuses any slug that matches. The researcher found that the check can be fooled by swapping one ordinary letter for a look-alike letter from another alphabet. The swapped word looks exactly the same to a human reader, but the computer treats it as a different word, so the filter lets it through. The link goes live immediately and anyone can open it. This was reported through a bug bounty programme, which is a scheme where companies pay independent researchers for finding security problems.

## The service and the filter

The product is a short URL service. You give it a long web address and a short name you would like to use, and it creates a short link under the company's domain that redirects to your long address. The short name is called a **slug**. For example, if the company's short domain is `example.la`, a slug of `hello` would produce a link like `http://example.la/hello`.

Because those links carry the company's name, the company does not want them to contain offensive words. So before creating a link, the service runs the slug through a **bad-word filter**: a list of words that are not allowed, checked automatically. If the slug matches a word on the list, the request is rejected. The report explains that the purpose of this filter is brand protection, not just tidiness: the company does not want its own domain used to publish rude, offensive or hateful words.

The researcher did not break the filter's logic. He did not find a bug in how the filter works. He simply supplied a word that the filter did not know how to recognise, because the filter compares text in a way that does not match what a human sees.

## The trick: letters that look the same

Computers store text as numbers. Each character has a number called a **code point**. The letter `c` in the Latin alphabet (the one used for English) has the code point U+0063. The letter `с` in the Cyrillic alphabet (used for Russian and some other languages) has the code point U+0441. On screen they look identical: both are a small curve open on the right. But they are different numbers, and a computer comparing raw text sees two different characters.

These look-alike characters are called **homoglyphs**, or **confusables**. The report notes that attackers have used them for years to build fake phishing websites, for example by swapping a Cyrillic `а` into a brand name so the address looks right but is not the real one. The same trick defeats any filter that only checks letter case (upper versus lower) or removes symbols, but never checks for look-alike letters.

A useful everyday comparison: imagine a bouncer with a list of banned names. If the list says "Smith" and someone shows an ID that says "Smith" but with one letter from a foreign alphabet that looks the same, the bouncer reading quickly might let them in. The bouncer is checking the letters, not the meaning. That is what the filter does.

## The bypass, step by step

### Step 1: Try the blocked word

The researcher first sent the word `fuck` as the slug. This is the control step: it confirms that the filter is active and that this particular word is on the list. The server rejected it right away.


{{media:1}}


At this point the filter is doing its job, as long as the input is plain ASCII text. **ASCII** is the basic set of characters that English text uses: the letters A to Z in both cases, digits, punctuation and a few control characters. If every character in the slug comes from that set, the filter recognises it.

### Step 2: Swap one letter

The researcher replaced the Latin `c` with the Cyrillic look-alike `с` and sent the request again. The slug was now `fuсk`. To a human reader it looks exactly like the blocked word. To the filter, it is a different string, because the two words are not made of the same bytes. A **byte** is a unit of digital information; text is stored as a sequence of bytes, and different characters can have different byte representations. The filter did not catch it. The link was created and went live immediately.


{{media:2}}


Why this step was taken: the goal was to test whether the filter compares what a person sees or the raw characters. By changing only one character to a visually identical one, the researcher isolates that question. If it accepts, it is comparing raw text.

### Step 3: Check that anyone can open it

A link that only the creator can see would be less serious. So the researcher checked that the new link works for anyone, without logging in. He sent a simple `GET` request. **GET** is the method a browser uses when you type an address or click a link: it asks the server to return the resource at that address. No login is needed for this request.

```http
GET /tidy/fuсk HTTP/2Host: api.example.la
```

Line by line:

- `GET /tidy/fuсk HTTP/2` is the request line. `GET` is the method. `/tidy/fuсk` is the path being requested, where `tidy` is presumably the part of the service that handles short links and `fuсk` is the slug. `HTTP/2` is the version of the web protocol being used.
- `Host: api.example.la` tells the server which website name the request is for. One server can host many sites, so this header picks the right one. `api.example.la` is the address of the service's programming interface.

The server's reply:

```http
HTTP/2 200 OK{"id":"fuсk","short_url":"http://example.la/fuсk","long_url":"https://www.example.com/x"}
```

Line by line:

- `HTTP/2 200 OK` is the status line. `200` is the standard code for success: the request worked and the server is returning the resource.
- The rest is a JSON object. **JSON** is a common text format for structured data, made of names and values in curly braces. `"id":"fuсk"` says the identifier of the link is the slug `fuсk`. `"short_url":"http://example.la/fuсk"` is the public short link. `"long_url":"https://www.example.com/x"` is the destination the short link points to.

The response confirms that the slug was stored and published as `fuсk` on the short domain, resolving to the supplied long URL. Anyone who sees the link reads a word that looks exactly like the one the platform tried to block.

## Why this is a real problem

A bad-word filter on a branded link service exists to protect the brand's name, not just to keep things neat. Getting around it means:

- Any user can publish a rude, offensive or hateful word as a link under the company's own domain.
- The link looks exactly like the blocked word to anyone who sees it shared, in a screenshot or printed out.
- Each bad link is permanent and goes live the moment it is created. No one checks it first.

The real problem is not that the word list was missing a few words. The filter was checking something different from what a person actually sees on screen.

## Root cause

The filter compares the raw text of the slug against its word list. Because the Cyrillic `с` (U+0441) is a different code point from the Latin `c` (U+0063), the string `fuсk` does not match the blocked entry `fuck`, even though the two are indistinguishable to a reader. The report states plainly that the filter was checking something different from what a person actually sees on screen. The report does not describe the filter's implementation, so the exact comparison method is not stated.

## Fix

The report does not state what was changed. Based on the root cause it describes, the filter should normalise input before comparison, so that look-alike code points are mapped to a canonical form and `fuсk` is treated the same as `fuck`.

## Variants to test

1. **Other homoglyph substitutions.** Replace individual letters in a blocked word with visually identical characters from other scripts (for example Cyrillic `а`, `е`, `о`, `р`, `с`, `�

` for their Latin counterparts). A positive result is a slug that renders as the blocked word but is accepted and published.
2. **Mixed-script words.** Combine Latin and Cyrillic letters in a single slug rather than swapping just one. A positive result is acceptance of a slug that a reader cannot distinguish from the blocked term.
3. **Case and symbol handling.** Try case variants and inserted symbols or separators around a blocked word. A positive result is a published slug that still reads as the blocked word.
4. **Verification without authentication.** After any accepted slug, issue an unauthenticated `GET` for the short path, as in Step 3. A `200` response containing the slug in `id` and `short_url` confirms the link is live to anyone, not just to the creator.

## Glossary

- **API**: Application Programming Interface; a way for one program to talk to another over the web, usually by sending requests to specific addresses and getting structured replies.
- **ASCII**: the basic character set for English text, covering letters A to Z in both cases, digits, punctuation and a few control characters.
- **Bad-word filter**: an automatic check that compares user input against a list of disallowed words and rejects matches.
- **Bug bounty programme**: a scheme where a company rewards independent researchers for finding and reporting security problems.
- **Byte**: a unit of digital information; text is stored as a sequence of bytes, and different characters can have different byte representations.
- **Code point**: the number a computer uses to represent a character, such as U+0063 for Latin `c`.
- **Confusable**: another name for a homoglyph; a character that looks like another but is different to a computer.
- **Cyrillic**: the alphabet used for Russian and several other languages; some of its letters look identical to Latin letters.
- **GET**: the HTTP method a browser uses to request a resource, for example when you type an address or click a link.
- **Homoglyph**: a character from one alphabet that looks the same as a character from another, such as Cyrillic `с` and Latin `c`.
- **HTTP/2**: a version of the protocol used to transfer web pages and API requests.
- **JSON**: a text format for structured data, made of names and values in curly braces.
- **Normalisation**: converting text to a standard form so that visually equivalent strings compare as equal.
- **Phishing**: a fake website or message designed to look like a real one, to trick people into giving away information.
- **Slug**: the short, user-chosen name in a short link, such as `hello` in `http://example.la/hello`.
- **Status code**: a number in an HTTP response that says what happened, such as `200` for success.
- **U+0063 / U+0441**: the code points for Latin `c` and Cyrillic `с` respectively.

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.