pwncollege
DojosLeaderboardCommunity
Back to web-security~f98637a0

Cross-site Scripting

web-security~f98637a0
0/26 challenges completed

A web page is just HTML that some server generated, and generating it means gluing your data into a string and handing it to a browser. You can probably guess how this goes. When an app drops your input into that HTML without escaping it, the browser can't tell your markup from the page's own, and it runs whatever you sent. Data becomes code.

That's Cross-Site Scripting, and the twist that makes it nasty is who ends up paying for it. The victim isn't the server this time, it's another person using the site. Code you slip onto a page runs in their browser, on their session, with everything they can see and do.

It comes in three shapes. Reflected, where your input bounces straight back in the response. Stored, where the app files it away and serves it to whoever loads the page later. And DOM-based, where the server never even sees it and the page's own JavaScript does the damage. We'll work through all three, and then through the filters people throw up to stop them, which have a way of not quite holding.

Reflected XSS

Additional Resources
1
First Reflection
2
Cookie Thief
3
Escaping the Quotes
4
Trusted Sources
5
Out of the String
6
Backtick Breakout
7
Caught in the Log
8
Leaking on the Clock

Stored XSS

9
The Poisoned Post
10
Every Keystroke
11
Script in the Picture

DOM XSS

12
Hash to HTML
13
Query to HTML

Mutation XSS

Additional Resources
14
Parser Disagreement
15
Namespace Confusion

Filters

Additional Resources
16
Past the Blocklist
17
Style Stripped
18
Frozen Frames
19
No Stylesheets
20
Shadows Blocked
21
DOM Locked Down
22
Nowhere to Call
23
Unicode Escapes
24
No Tags at All
25
The Final Filter
26
The Final Side Channel