Skip to content
XSS Write-up Beginner

From Recon to DOM based XSS

A page reflected the URL fragment into an iframe's source attribute without validation, allowing an attacker to set the iframe to a javascript: URL and execute script in the page's origin. The author demonstrated this with a simple alert payload.

Abdelfattah Ibrahim Follow

Published on medium.com

I was doing some google dorking to find out if there’s any interesting files or parameters in the bug bounty program scope so i’ve tried alot of dorks and it was the turn of this one “ site:.REDACTED.com inurl:file “ and then i found this endpoint : https://REDACTED.com/files/file.htm and there was some listed…

Abdelfattah Ibrahim, 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

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Find a page with a file parameter using Google dorking.
  2. Notice that the URL fragment changes when navigating to an article.
  3. Observe that the fragment value is reflected in an iframe tag.
  4. Try an external domain in the fragment and see it load in the iframe.
  5. Inject a javascript: payload in the fragment and confirm script execution.

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 web page can read the part of the address after the # symbol (the fragment) and use it to decide what to show inside an embedded frame. If the page does not check that value, an attacker can make the frame load a special link that runs code in the page's context. This is called DOM-based cross-site scripting because the unsafe handling happens in the browser's page script.

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.