Skip to content
XSS Write-up Beginner

HTML Injection - Return of the P2 Elevator

A stored HTML injection vulnerability allowed an attacker to inject a div with a style attribute that created a full-page black overlay, hiding the application from all users. The attacker could deface the homepage for other users and admins in the same organisation.

medium.com

Published on medium.com

HTML Injection is a type of web vulnerability where an attacker is able to inject arbitrary HTML code into a web page that is viewed by other users. It happens when user-supplied input is not properly sanitized before being rendered in the browser.

Jerry Shah (Jerry), 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 HTML sanitiser used an allow-list that permitted the style attribute on div tags, which allowed CSS-based defacement.

Impact

An attacker could inject a payload that would restrict all users and admins in the organisation from accessing the web application, as the homepage becomes completely black.

What the attacker needed

Attacker and victim in same organisation; attacker has an account; victim visits the homepage

The fix

The application should implement proper input sanitisation and validation on both client and server sides, using regular expressions to check for special characters, HTML tags, and other malicious code, and apply input filtering and output encoding.

How it was found

  1. Log into the website and find the ticket creation option where the description field supports some HTML tags.
  2. Enter details and click Create.
  3. Intercept the request and inject the payload after the closing paragraph tag in the ticketDescription parameter.
  4. Forward the request.
  5. Log into another user account from a different browser and visit the homepage.
  6. Observe that a black overlay has been created.

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.

HTML injection is when a website lets you type HTML code that other people will see. Normally this is limited to harmless formatting, but here the allowed HTML included a style attribute that could cover the whole page with a black box. This meant an attacker could make the site unusable for everyone else.

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.