4 ms·
The '21 Vector' XSS Challenge
- nick__m 5y agoi spent a few minutes and came with https://21-vector.0e.vc/?s=%3E%3Cscript%20%3Ealert()%3C/script%3E%3Ca%20onload=alert()%20onmouseover=alert()%20autofocus%20onfocus=alert()%3Ea%3C/%3E https://21-vector.0e.vc/?s=%3E%3Cscript%20%3Ealert()%3C/scri... it goes to 7
- vntok 5y agoGoes to infinity on Chrome, as long as you click on the OK button with your mouse or press Enter :) If you hit Echap the alert() stops popping up eventually.
- cjcampbell 5y agoI've managed fourteen so far, though on a couple, their counter made it challenging to determine which event is firing. Much of the fun is creative use of comments, quotes, and new lines to ensure that you don't break other contexts or count duplicates for a single context. I'll hold my solution for now, but happy to share it after folks have a chance to attempt on their own.
- nneonneo 5y agoAs far as I could tell, 14 is the maximum, since that's the number of times your code gets injected. I didn't quite figure out why they called it the 21 vector challenge, other than a reference to the current year? If you're allowed to execute code more than once per injection site, I think the scoring would rapidly become ill-defined...
- cjcampbell 5y agoIt depends a bit on how they count contexts and injections. I did take it a little bit further after my post. I aimed to avoid double-dipping on contexts, but there's at least one element that could probably be counted for more than one injection context (and requires different strategies to target these different contexts). If nothing else, there are a couple of opportunities beyond the initial fourteen to further sharpen your XSS skills if that's of interest.
- zerof1l 5y agoI managed to get 14 vectors with 125 characters. I think 21 is a reference to the year 2021 and not the actual number of unique XSS vectors.