Skip to content
XSS Write-up Beginner

Exposing HTML Injection:$500 Bounty (6/30DAYS)

The search page on Snapchat's Newsroom site reflected the query parameter without sanitising it, so an attacker could inject arbitrary HTML. A crafted link could display a fake offer banner and redirect visitors to an attacker-controlled site.

medium.com

Published on medium.com

I’m a security researcher, and I’ve taken on the challenge of explaining one bug bounty report every day for the next 30 days — 30 reports!

0day stories, 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 search parameter was written into the page without sanitising or encoding it.

Impact

An attacker could alter how the page looks and trick users with fake offers or links, though the report rates the severity as low.

What the attacker needed

Victim clicks a crafted link; no account needed

The fix

The application should validate and sanitise user input on the server side.

How it was found

  1. Open the Newsroom search endpoint for a country.
  2. Put HTML into the q parameter of the URL.
  3. Load the crafted URL in a browser and see the HTML rendered.

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.

When a website puts something you typed into the page without cleaning it first, you can type HTML (the code that builds web pages) instead of normal text. Here the search box did that, so a link could make the page show a fake banner and send people to another site.

What is XSS?

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

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.