Merge pull request #12070 from paul43210/fix/csp-font-src

fix(proxy): add data: to font-src CSP to allow bundled KaTeX fonts
This commit is contained in:
Martin
2026-03-11 08:47:29 +01:00
committed by GitHub
11 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
Bugfix: Fix CSP blocking bundled KaTeX font
The default Content Security Policy blocked the bundled KaTeX math font (used by the md-editor) because it is inlined as a `data:` URI in the Web UI CSS. Added `data:` to the `font-src` directive to resolve the console error on every page load. Users with custom CSP files (`PROXY_CSP_CONFIG_FILE_LOCATION`) will need to add `data:` to their `font-src` directive manually.
https://github.com/owncloud/ocis/pull/12070

View File

@@ -13,6 +13,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -11,6 +11,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''none'''
frame-src:

View File

@@ -10,6 +10,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -11,6 +11,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''none'''
frame-src:

View File

@@ -9,6 +9,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -9,6 +9,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -9,6 +9,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -9,6 +9,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''self'''
frame-src:

View File

@@ -219,7 +219,7 @@ Feature: download file
And the following headers should be set
| header | value |
| Content-Disposition | attachment; filename*=UTF-8''<encoded-file-name>; filename="<file-name>" |
| Content-Security-Policy | child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self'; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' |
| Content-Security-Policy | child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self' data:; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' |
| X-Content-Type-Options | nosniff |
| X-Frame-Options | SAMEORIGIN |
| X-Permitted-Cross-Domain-Policies | none |
@@ -246,7 +246,7 @@ Feature: download file
And the following headers should be set
| header | value |
| Content-Disposition | attachment; filename*=UTF-8''%22quote%22double%22.txt; filename=""quote"double".txt" |
| Content-Security-Policy | child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self'; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' |
| Content-Security-Policy | child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self' data:; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' |
| X-Content-Type-Options | nosniff |
| X-Frame-Options | SAMEORIGIN |
| X-Permitted-Cross-Domain-Policies | none |

View File

@@ -11,6 +11,7 @@ directives:
- '''none'''
font-src:
- '''self'''
- 'data:'
frame-ancestors:
- '''none'''
frame-src: