Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSP allow specific: data:font/woff;base64,"someBase64encoded font", WITHOUT using csp: font-src 'self' data:

Have a few embed base64 fonts in some css files, but CSP blocks these: something like url("data:font/woff;base64,d09GRk9UVE...);

Current CSP = "base-uri 'self'; connect-src 'self'; default-src 'none'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src 'self'; img-src 'self'; script-src 'self'; style-src 'self';"

W3 and MDN say I could add a hash, but this doesn't seem to work either

tried sha256,sha384,sha512

like image 437
Rune Jørgensen Avatar asked Sep 14 '18 08:09

Rune Jørgensen


1 Answers

Add data:to font-source, e.g.

font-src 'self' data:;
like image 96
solitud Avatar answered Nov 03 '22 10:11

solitud