Overlapping CSS fragments enable extraction of tokens up to 640 characters with much smaller stylesheets
Overlapping CSS fragment techniques can reliably reconstruct authentication tokens hundreds of characters long using CSS payloads far smaller than prior methods.
Security & privacy PortSwigger Research 5 Oct 2026 Attack Prototype evidence
Published as “Smashing the token limit with overlapping fragments”
Why it matters
The work shows that CSS injection can exfiltrate far longer secrets than previously thought, expanding the threat surface of web applications.
Summary
The author builds on a prior CSS-only token exfiltration technique by stitching together overlapping short chunks reported by the stylesheet. By selecting groups of two-, three-, four- and five-character chunks and checking selective longer joins, they reduce the required CSS size dramatically. In synthetic tests of 100 k random URLs they achieve 99 % success extracting a 12-character token with a 1.33 MB stylesheet, and with the same budget as the original work (≈257 MB) they recover tokens up to 210 characters (single-guess) and 640 characters (five-guess). The evidence is based on large-scale random URL simulations rather than real-world deployments.
What they found 4
- A 1.33 MB stylesheet can recover a 12-character token with 99 % success using a single-guess target.
“The small sheets came out at 1.33 MB and 223 KB. With Gareth's full byte budget, the answers reached 210 characters with one guess and 640 characters with up to five.”
- A 223 KB stylesheet meets the 90 % five-guess target for a 12-character token.
“Fourteen worked in 96,398. That was the first tested setup to clear my 90% target, and it generated 223,365 bytes of CSS with 4,128 selectors.”
- Using the same CSS budget as the original (≈257 MB), the technique recovers a 210-character token with 99 % one-guess success.
“The longest length I got to pass the 99% one-guess target was 210 hex characters: 29,753 of 30,000 URLs left exactly one candidate.”
- Within the same budget, a 640-character token achieves 90 % success with up to five candidates.
“For the 90% five-guess target, I reached 640 characters: 27,158 of 30,000 URLs left five or fewer candidates.”
Caveats 2
- These are the smallest setups I found that met the two targets, not proof that no better choice of checks exists.
- The evaluation uses randomly generated URLs rather than real-world applications.
What’s new here 4
- Demonstrates that overlapping chunk reconstruction can shrink CSS payloads by up to 193× compared to prior work.
- Shows successful extraction of tokens up to 210 characters (99 % one-guess) and 640 characters (90 % five-guess) within the same byte budget as the original technique.
- Provides a Burp Suite skill that automates stylesheet generation and reconstruction, lowering the barrier to exploitation.
- Introduces a systematic method for grouping chunk checks to balance stylesheet size and confidence.