From 63c023f45bfa532dcc54b292906c150c10331e9e Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 17 May 2020 00:17:23 +0200 Subject: [PATCH] page: disallow frame ancestors to prevent clickjacking Security policy recommended by Dareboost, to stop potential malicious page embedding. Support should be decent (enough), so do not bother with an equivalent X-Frame-Options directive for compatibility. --- page.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/page.php b/page.php index 12e0690..3dd8cba 100644 --- a/page.php +++ b/page.php @@ -159,6 +159,8 @@ if ($PageAccess = $Article->restricted) { # prepare page contents +header("Content-Security-Policy: frame-ancestors 'none'"); + ob_start(); # page body $Place = [ 'user' => $User ? $User->login : '', -- 2.30.0