Skip to content
Info disclosure Write-up Intermediate

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

A CSS technique using the unicode-range descriptor of @font-face can cause a browser to fetch font URLs only for characters present in a page's text, letting an attacker infer which characters appear. The author shows this can partially read text nodes, though duplicate characters cannot be distinguished.

Unknown Follow

Published on mksben.l0.cm

The original lives on mksben.l0.cm

We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser fetches a font resource only when the page text contains a character covered by that font's unicode-range, and this fetch behaviour leaks which characters are present.

Impact

An attacker who can inject CSS, or bypass an XSS filter, could read parts of a page's text, but duplicated characters cannot be determined and the technique is not perfect.

What the attacker needed

Ability to inject CSS into the page; victim loads the crafted page; browser supports unicode-range font fetching

The fix

The behaviour was marked WontFix as it appears to be specified, so no fix is described.

How it was found

  1. Define several @font-face rules with the same family, each with a different source URL and a unicode-range for one character.
  2. Apply that font family to an element containing sensitive text.
  3. Load the page and observe which font URLs the browser requests.
  4. Infer the characters present from the requested URLs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Web pages can load fonts from a server, and a CSS rule can say which characters a font is used for. If a page's text contains one of those characters, the browser downloads that font file. By giving each character its own font URL, an attacker can see which characters were downloaded and so learn part of the text.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Unknown

View all

32 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.