Friday, October 23, 2015

CSS based Attack: Abusing unicode-range of @font-face

In this post, I would like to share about new CSS based attack with unicode-range descriptor of @font-face rule.

Using this technique, an attacker can read page's text partially by CSS only.
An attacker might use this technique in the following cases:

- Browser's XSS filter bypass (e.g. XSS Auditor does not block <style> injection)
- Only CSS injection is allowed in the target page

As far as I know, known CSS based attack can read attribute (See Attribute Reader: but can't read characters of text node. This vector can do it, not perfect though :)

So far, this vector can be used in Chrome and Firefox Nightly 44.

Let's go:

src: url(; /* fetched */
src: url(; /* fetched too */
src: url(; /* not fetched */
<p id="sensitive-information">AB</p>

When you access this page, Chrome and Firefox fetch "?A" and "?B" because text node of sensitive-information contains "A" and "B" characters. But Chrome and Firefox do not fetch "?C" because it does not contain "C". This means that we have been able to read "A" and "B".

Let's see another example:

You can see external requests including page text (M,a,s,t,o,K,i,n,u,g,w) from DevTools. Like the following:

As you can see, we can't know duplicated characters. But in some cases like this PoC, I think that it can give an attacker enough information.

I reported this trick to Chrome Team but it has been marked WontFix on Issue 543078.

It seems that this behavior is spec'd. See EXAMPLE 13 of  Due to this behavior, users can save bandwidth. But as the side effect, an attacker got new attack vector.


  1. This is a really interesting way to exploit that the browser will go through all specified fonts, even if it's a houndred and none exists, it's still a request made.

  2. You can easily use that for input fields, except the password type...

  3. any work-around to make duplicated characters work?

  4. It could be possible to figure out character combinations using ligatures. I'm not sure if it's possible to make the requests to remote server for ligatures other than those defined as separate characters in UNICODE (in practice, only ff, ffi, fi).

    Custom font could be used to make all character combinations different width or height and somehow try to leak the width or height of the element to remote server.

  5. I don’t know whether it’s just me or if perhaps everyone else experiencing problems with your blog.

  6. It looks like some of the text within your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well?
    This may be a issue with my browser because I’ve had
    this happen previously. Cheers!

  7. Great writing to see, glad that google brought me here, Keep Up cool job!
    If you are going for best contents like I do, simply go to see this website all the time as it provides feature contents, thanks

  8. 토토

    Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!..

  9. 스포츠중계

    I would love to visit this website every day. As this promotes eternal knowledge.

  10. 토토

    Your article has proven very informative and very useful to me. It was very obvious that you are much knowledgeable in this area.

  11. It's good to see you, need buy custom essays online ?! We have the best pricing policy on the market. We understand many students forgo many things to live within their budget. We do not intend to constrain it further, which is why our services are affordable. We want all our clients to buy essay papers cheap and achieve their academic goals.

  12. This insightful blog post delves into a fascinating technique, revealing potential vulnerabilities in Chrome and Firefox Nightly 44. The clarity in your explanations and real-world examples makes it accessible even for those less familiar with cybersecurity intricacies. Reckless Driving Lawyer Monmouth County Your proactive approach in reporting to the Chrome Team reflects a commendable commitment to enhancing web security. Kudos on shedding light on these potential risks and contributing to the collective effort in making the online space safer for everyone! Driving Without A License In New Jersey