Published 18 years 6 months ago • Last updated March 22, 2025 • ⏱️ 2 min read
I thought I'd continue the theme of experimenting with XSS and trying different things, I haven't seen this written about anywhere so here goes. The idea is using CSS as a XSS payload, this can be useful when filters allow some things but make it difficult to construct an attack.
I've decided to call it XCSS (Cross site Cascading Style Sheets) and there are many ways you can inject them into a document, I'll show how to do it in Firefox but it will be possible with other browsers as well.
We first need a moz binding document to demonstrate this method, a sample one can be found here:- Moz Binding sample I'm not going to explain the details of what one can do, so if you want to find out more than just Google it. This example simply injects a Javascript alert.
There are many ways of embedding a stylesheet into a document, here I'll show you three.
<link href="//businessinfo.co.uk/ labs/xbl/xbl.xml#xss" rel="stylesheet" type="text/css" /> </pre>
2.<pre lang="html"><style type="text/css">@import url("//businessinfo.co.uk/labs/xcss/xcss.css");</style></pre>