Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ protected function pageHandler(
]);

$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
Expand All @@ -273,7 +273,10 @@ protected function pageHandler(
$csp->addAllowedScriptDomain("'wasm-unsafe-eval'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
foreach ($this->talkConfig->getAllServerUrlsForCSP() as $server) {
$csp->addAllowedConnectDomain($server);
}

$response->setContentSecurityPolicy($csp);
if ($throttle) {
// Logged-in user tried to access a chat they can not access
Expand Down Expand Up @@ -325,7 +328,7 @@ public function recording(string $token): Response {

$response->setFooterVisible(false);
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
Expand All @@ -336,7 +339,9 @@ public function recording(string $token): Response {
$csp->addAllowedScriptDomain("'wasm-unsafe-eval'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
foreach ($this->talkConfig->getAllServerUrlsForCSP() as $server) {
$csp->addAllowedConnectDomain($server);
}
$response->setContentSecurityPolicy($csp);

return $response;
Expand Down Expand Up @@ -412,7 +417,7 @@ protected function guestEnterRoom(

$response->setFooterVisible(false);
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
Expand All @@ -423,7 +428,9 @@ protected function guestEnterRoom(
$csp->addAllowedScriptDomain("'wasm-unsafe-eval'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
foreach ($this->talkConfig->getAllServerUrlsForCSP() as $server) {
$csp->addAllowedConnectDomain($server);
}
$response->setContentSecurityPolicy($csp);
return $response;
}
Expand Down Expand Up @@ -470,7 +477,7 @@ protected function invitedEmail(

$response->setFooterVisible(false);
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
$csp->addAllowedMediaDomain('blob:');
$csp->addAllowedWorkerSrcDomain('blob:');
$csp->addAllowedWorkerSrcDomain("'self'");
Expand All @@ -481,7 +488,9 @@ protected function invitedEmail(
$csp->addAllowedScriptDomain("'wasm-unsafe-eval'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
$csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
foreach ($this->talkConfig->getAllServerUrlsForCSP() as $server) {
$csp->addAllowedConnectDomain($server);
}
$response->setContentSecurityPolicy($csp);
return $response;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Listener/CSPListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function handle(Event $event): void {
$csp->addAllowedChildSrcDomain("'self'");
$csp->addAllowedScriptDomain('blob:');
$csp->addAllowedScriptDomain("'self'");
$csp->addAllowedScriptDomain("'wasm-unsafe-eval'");
$csp->addAllowedConnectDomain('blob:');
$csp->addAllowedConnectDomain("'self'");
foreach ($this->config->getAllServerUrlsForCSP() as $server) {
Expand Down
Loading