Skip to content
XSS Write-up Intermediate

How I Discovered a Reflected XSS on the MOD UK Police Website (WAF Bypass)

The search parameter on the MOD UK Police website was reflected into an HTML input attribute after HTML-encoding, but a crafted payload bypassed the Cloudflare WAF and executed script in the victim's browser. An attacker could run arbitrary JavaScript in a victim's session via a crafted search link.

Hassan Ali Arshad Follow

Published on 0xhassan.medium.com

Assalamualaikum everyone, and welcome to my first write-up. In this post I describe a reflected XSS I discovered on the Ministry of Defence (UK) Police website that required bypassing a Web Application Firewall.

Hassan Ali Arshad, on 0xhassan.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 application HTML-encoded special characters but still placed user input inside an HTML attribute, and the WAF's filter could be bypassed with a differently cased or structured payload.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser via a crafted search link, potentially stealing cookies or performing actions as the victim, though the report only demonstrated a confirm dialog.

What the attacker needed

Victim clicks a crafted link; WAF bypass payload

The fix

The vulnerability was fixed by the team, as stated in the report.

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 takes what you type in a search box and puts it back into the page without proper handling, an attacker can craft a link that makes the site run their code in your browser. This is called reflected cross-site scripting (XSS). Here, a firewall (Cloudflare) tried to block malicious input, but a differently written payload slipped past it.

What is XSS?

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

More by Hassan Ali Arshad

View all

1 more disclosed report, best first.

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.