Skip to content
XSS Write-up Beginner

I found two security issues on my college blog website

The comment box on a college blog accepted HTML tags such as bold, and the site sent no Content-Security-Policy header, so a harmless inline script ran unblocked. The author argues that together these weaknesses could let an attacker run script in a visitor's browser if a way to inject code is ever found.

medium.com

Published on medium.com

Alone these may look minor, but together they can make the site easier to attack if not fixed.

Alanbiju, 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 comment field renders user input as HTML without sanitising it, and the site sends no Content-Security-Policy header to restrict inline scripts.

Impact

The author claims that together these issues raise the risk from low to medium-high, but only bold text and a harmless pop-up were shown; no actual script injection or data theft was demonstrated.

What the attacker needed

Ability to post a comment; victim views the comment

The fix

The site should stop allowing HTML in comments or allow only a small set of safe tags, and should add a Content-Security-Policy header, starting in report-only mode before enforcing it.

How it was found

  1. Type a bold HTML tag into the comment box and submit it.
  2. Observe that the comment text is displayed in bold.
  3. Submit a harmless inline script in a comment and observe that it runs without being blocked.

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.

A comment box that accepts HTML lets people change how text looks, and if it ever accepts a tag that runs code, that code runs in other visitors' browsers. A Content-Security-Policy is a rule the site sends to the browser listing which scripts are allowed; without it, the browser runs any script it is given. The author only showed bold text and a harmless pop-up, so no real attack was demonstrated.

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.