Injection
CSS Injection
CSS injection occurs when untrusted input becomes stylesheet syntax, a declaration, selector or style attribute. Impact depends on the sink, browser, CSP and accessible DOM data; stylesheet control does not automatically execute JavaScript.
- 26 payloads
- 1 file
- README on GitHub
Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.
These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.
Payload files
Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.
css-injection-payloads.txt
26 payloads · 3.2 KBLoading payloads for CSS Injection…
Common Attack Vectors#
- Inline style attributes and declaration values
- Stylesheet rule and selector construction
- External imports and URL-bearing properties
- Attribute-selector conditional resource loads
- Custom properties used in security-sensitive styling
- CSS sanitization and HTML style-element boundaries
Testing Approach#
Identify the exact sink first. Use a visible outline/color marker and inspect the computed style. For conditional loads, build a local page with a synthetic data-css-lab attribute and a controlled same-lab collector. Test only one known marker, not real passwords, tokens or hidden account data. A selector can only match attributes actually present in the DOM; it does not generally read live input properties or arbitrary application memory.
Use browser network logs to verify requests. CSP style-src and img-src, rendering conditions, blocked mixed content and unsupported CSS affect whether examples work. Imports must appear in a valid stylesheet position. An HTML breakout belongs to XSS only when the actual HTML sink permits it and execution is demonstrated.
References#
Responsible Use
All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.
- Systems and applications you own
- Authorized penetration testing engagements
- Bug bounty programs with defined scope
- Educational lab environments (DVWA, WebGoat, HackTheBox)