From 7df6c201f2e6a6521d20718dfd8d9794c7437d1f Mon Sep 17 00:00:00 2001 From: Inverle Date: Mon, 11 Aug 2025 19:35:54 +0200 Subject: Put CSP everywhere (#7810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Puts CSP everywhere in `p/api` * including the HTML query page ❗ * Also in `p/ext.php` * Puts `X-Content-Type-Options: nosniff` everywhere * Fixes custom icon configuration not showing `blob:` icon in statsController (idle feeds) * Also removes `style-src 'unsafe-inline'` since it doesn't seem to be needed * Improves CSP of `p/f.php` * Add `sandbox` directive --- p/ext.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'p/ext.php') diff --git a/p/ext.php b/p/ext.php index f470b7210..5fdd3df6c 100644 --- a/p/ext.php +++ b/p/ext.php @@ -94,6 +94,8 @@ if (!is_valid_path($absolute_filename)) { $content_type = FreshRSS_extension_Controller::MIME_TYPES[$file_type]; header("Content-Type: {$content_type}"); header("Content-Disposition: inline; filename='{$file_name}'"); +header("Content-Security-Policy: default-src 'self'; frame-ancestors 'none'"); +header('X-Content-Type-Options: nosniff'); header('Referrer-Policy: same-origin'); $mtime = @filemtime($absolute_filename); -- cgit v1.2.3