Skip to content
XSS Write-up Intermediate

How I found an XSS vulnerability via using emojis

The site's input filter removed common XSS characters but mishandled emoji and other Unicode input, allowing an attacker to inject a working script payload. An attacker could execute JavaScript in a victim's browser.

Patrik Fabian Follow

Published on medium.com

One day I was working on Swisscom’s bug bounty program and I found a subdomain let’s call now redacted.swisscom.ch

Patrik Fabian, 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 server applied character encoding conversions (Windows-1252 to UTF-8, then UTF-8 to ASCII) after filtering, which turned benign Unicode characters into dangerous ones like < and >.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing data or performing actions as the victim.

What the attacker needed

Victim visits a crafted URL

How it was found

  1. Find a subdomain and test its parameters for XSS.
  2. Notice that common malicious characters are removed.
  3. Try emoji and Unicode characters and observe that some produce quote characters.
  4. Use a GitHub emoji list to find characters that also produce angle brackets.
  5. Craft a payload using an emoji that becomes an image tag with an error handler.
  6. Reproduce the encoding behaviour locally with a PHP script to understand the conversion.

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.

Cross-site scripting (XSS) is when a website lets an attacker sneak JavaScript into a page that other people view. Here the site tried to block dangerous characters, but emojis and other Unicode characters slipped through and turned into the characters needed for an attack.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Swisscom

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.