CSS Injection: PortSwigger Unveils Overlapping Fragment Method to Evade Token Limits and Exfiltrate Data
PortSwigger researchers demonstrate how overlapping CSS fragments bypass token limits to exfiltrate data via CSS injection attacks, a significant risk for web applications.

Key points
- PortSwigger Research detailed a method to bypass strict token limits in CSS injection attacks.
- The technique utilizes overlapping CSS fragments to smuggle data out of constrained contexts.
- No specific CVE ID or affected software versions are currently listed in the report summary.
PortSwigger Research published findings on a CSS injection technique that allows attackers to exfiltrate data by bypassing token limits, according to a report on r/netsec. The research highlights how overlapping CSS fragments can be manipulated to smuggle sensitive information from web applications that enforce strict size constraints on injected code.
Root cause
The vulnerability stems from how web browsers process Cascading Style Sheets when multiple CSS fragments overlap, as identified by PortSwigger researchers. Attackers exploit this processing behavior to construct complex injection payloads that exceed standard token limits, effectively circumventing security controls designed to restrict the size of injected CSS code.
Attack path
According to the PortSwigger report, the attack path involves injecting CSS code that creates overlapping fragments within the application’s style processing logic. By carefully crafting these overlapping elements, an attacker can exfiltrate data that would normally be blocked by token limits, allowing sensitive information to be extracted despite strict application security measures.
Affected versions
The r/netsec submission of the PortSwigger report does not specify particular software versions, vendors, or products currently affected by this CSS injection technique. The findings describe a general method applicable to web applications that parse CSS and enforce token limits, rather than a bug in a specific software release.
Mitigation
- Review CSS parsing logic to ensure strict validation of all input fields.
- Implement Content Security Policy headers to restrict inline styles and scripts.
- Monitor for unusual CSS injection attempts in web application firewalls.
- Validate that token limits cannot be bypassed through fragment overlap techniques.
What to do and how to stay safe: PortSwigger
- Audit web applications for unsanitized user input that is reflected in CSS contexts.
- Enforce strict Content Security Policy directives to block inline style injection.
- Test existing token limit controls using overlapping fragment scenarios to verify robustness.
- Monitor server logs for anomalous CSS requests that may indicate data exfiltration attempts.
Step-by-step guide: Unpatched Software Myths: Why Common Beliefs Fail to Protect You
General security guidance from the BlueTeam Insider newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
What is the CSS injection technique described by PortSwigger?
PortSwigger researchers demonstrated a method using overlapping CSS fragments to bypass token limits and exfiltrate data from web applications.
Which software versions are affected by this vulnerability?
The source material does not specify affected software versions or particular products, describing the technique as a general web application risk.
Is there a CVE ID for this CSS injection bypass?
No CVE ID is mentioned in the r/netsec submission of the PortSwigger Research report summary.


