r/netsec • u/theomkamble • 2d ago
Smashing the token limit with overlapping fragments (CSS injection token exfiltration, PortSwigger Research)
https://portswigger.net/research/smashing-the-token-limit
3
Upvotes
r/netsec • u/theomkamble • 2d ago
1
u/theomkamble 2d ago
I'm a student and I read this a few times, so correct me if I got something wrong.
With a CSS injection, the stylesheet can make the browser send a request when a short chunk (like 3 characters) appears in a token. That tells you which chunks exist, but not where they are.
Alex's idea was to treat overlapping chunks like a path: c2e, then 2e1, then e16, and so on, and join them to rebuild the token. Checks for the start and end show where the path begins and ends.
In his tests, a 12-character hex token went from about 257 MB of CSS (Gareth's original generator) to 223 KB when up to five candidates are allowed. 96,398 of 100,000 randomised test URLs left five or fewer candidates. That comes from his own test harness, not from real attacks. It also needs an existing CSS injection and a token that CSS can see, like one in an attribute.
The article says recursive imports aren't needed for this. Does that change how seriously a CSS injection should be treated if it was written off before because imports were blocked?