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 --- app/Controllers/statsController.php | 3 +-- app/FreshRSS.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 67b1f80e9..5a7e9b79a 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -30,8 +30,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { $this->_csp([ 'default-src' => "'self'", 'frame-ancestors' => "'none'", - 'img-src' => '* data:', - 'style-src' => "'self' 'unsafe-inline'", + 'img-src' => '* data: blob:', ]); $catDAO = FreshRSS_Factory::createCategoryDao(); diff --git a/app/FreshRSS.php b/app/FreshRSS.php index bff9f1b18..62e91ff95 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -149,7 +149,7 @@ class FreshRSS extends Minz_FrontController { } public static function preLayout(): void { - header("X-Content-Type-Options: nosniff"); + header('X-Content-Type-Options: nosniff'); FreshRSS_Share::load(join_path(APP_PATH, 'shares.php')); self::loadStylesAndScripts(); -- cgit v1.2.3