Skip to content
XSS Write-up Beginner

HTML Injection, CSP Roadblocks & a $100 Win

A text input on a payroll platform reflected unsanitised HTML back into the page, allowing an attacker to inject script tags that executed on submission. However, the payload did not persist after a refresh and a strong Content Security Policy limited further exploitation, so the issue was classified as low-severity HTML injection rather than reflected XSS.

medium.com

Published on medium.com

Sometimes bug hunting is all about expectations vs reality. I went in thinking I’d found a reflected XSS, but in the end, it got classified as HTML Injection.

Sarv3shxploit, 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

Impact

An attacker could execute arbitrary JavaScript in the context of the victim's session on submission, potentially stealing cookies or CSRF tokens, but the payload did not persist after a refresh and a strong CSP blocked many escalation attempts, limiting the practical impact.

What the attacker needed

Access to the bonus setup page; ability to submit a bonus type

How it was found

  1. Navigate to the bonus setup page and locate the text input for adding a new bonus type.
  2. Enter a harmless HTML tag such as a marquee element to confirm the input is reflected.
  3. Enter a script tag to test for script execution.
  4. To bypass the 40-character limit, host a malicious script on GitHub, serve it via jsDelivr, shorten the URL, and inject a script tag with the shortened source.
  5. Observe that the script executes on submission and exfiltrates data to a webhook.
  6. Refresh the page and note that the payload does not persist.

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.

The website took text you typed into a box and put it directly into the page without cleaning it first. That meant you could type special code (HTML) that the browser would run, like a mini program. The site had a security rule (CSP) that stopped the program from doing much damage, and the code disappeared when you reloaded the page, so it was treated as a minor issue.

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.