Skip to content

font-src

font-src specifies valid sources for fonts loaded by @font-face.

Font violations rarely arrive alone. A hosted font service needs its stylesheet host in style-src and its font host in font-src, and the two are usually different origins - which is why the first attempt at a strict policy tends to break the typography and nothing else.

Content-Security-Policy: font-src 'none';
Content-Security-Policy: font-src <source-expression-list>;
  • Fonts requested by an @font-face rule’s src.

If font-src is absent, the browser consults default-src. The full chain is font-srcdefault-src.

Content-Security-Policy: font-src 'self'
  • Self-hosting fonts removes the directive problem and a third-party dependency at once.
  • If you use a font service, list its font origin here and its stylesheet origin in style-src - for Google Fonts those are https://fonts.gstatic.com and https://fonts.googleapis.com respectively.

A self-hosted font, under font-src 'self':

@font-face {
font-family: "Inter";
src: url("/assets/inter.woff2") format("woff2");
}

Under font-src 'self':

@font-face {
font-family: "Inter";
src: url("https://fonts.gstatic.com/s/inter/v13/…woff2") format("woff2");
}
  • Widely available across browsers since August 2016.
Field Value
violatedDirective font-src
effectiveDirective font-src
blockedUri https://fonts.gstatic.com/s/inter/v13/font.woff2, data
Issue title font-src blocking fonts.gstatic.com
  • The report names the font file, not the stylesheet that asked for it. sourceFile on the report detail is the stylesheet - that is the field to read when you cannot work out who wants the font.
  • data: fonts are a real pattern in icon libraries and produce a single font-src data: URI issue.

Point your policy’s report-uri at your site’s HeaderHawk endpoint and the violations above arrive in the dashboard, grouped as described. The Quick Start sets that up in five minutes, and the integration guides cover the header syntax for each platform.