The original XSS advisory (2000)
web.archive.org
web.archive.org
Oh what could have been.
> Web Users Should Not Engage in Promiscuous Browsing
For 4 years I managed to get straight As until a leaky mouth discovered and disclosed it to the IT dept. Me and my friends were never doubted for since we were the top A students with foul mouths. The guy who reported it felt a sense of pride but whatever..
This was late 90s, early 2000s. Was fun times.
Nice to see that allow-list input validation was proscribed as a solution to XSS (and really any injection attack) from the beginning. It even explicitly warns against trying to do deny-list.
Trying to sanitize or defang user supplied input is always very difficult and a handy bad-code-smell indicator during code review. It has a ton of corner cases and edge cases and by its very nature it fails deadly: can an attacker discover an injection using characters that aren’t in the denial list? They win. Oh you’re sanitizing function simply removes the malicious characters? Attacker constructs an injection string that contains an valid injection that is constructor by your sanitizer function removing characters.
Nice also see reference to output e coding as well. Defense in depth is always a good idea. It also protects you from injection through other means that may be are not properly validated.
https://lcamtuf.coredump.cx/postxss/
It turned out Michal was a little optimistic with the timeline, though. :)