Skip to content
XSS Write-up Intermediate

When Cookie Hijacking + HTML Injection become dangerous

A web page reflected user-controlled input into the HTML of the page without proper handling, allowing an attacker to inject arbitrary markup. The author combined this with a separate cookie hijacking weakness to escalate the impact, though the text does not detail the exact mechanism.

Daniel V Follow

Published on medium.com

{{media:0}}

Daniel V, 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 application reflected user-controlled input into HTML without encoding it, and separately exposed session cookies in a way that allowed them to be captured.

Impact

An attacker could inject arbitrary HTML into a vulnerable page and, combined with the cookie hijacking weakness, potentially impersonate a user, though the text does not show the full chain.

What the attacker needed

Victim visits a crafted page or link

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 means a website takes something a visitor types or sends and places it directly into the page's markup, so an attacker can add their own elements. On its own that is often low impact, but if the site also mishandles session cookies (the tokens that keep you logged in), the injected content can be used to steal them and impersonate the victim.

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 Daniel V

View all

5 more disclosed reports, 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.