From 2eac8e7fc2c9a7b30afeef7c833ae55071d9689b Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 7 Jun 2023 11:08:38 +0200 Subject: [PATCH] Add `sandbox` attribute to preview card iframes Signed-off-by: Claire --- lib/sanitize_ext/sanitize_config.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sanitize_ext/sanitize_config.rb b/lib/sanitize_ext/sanitize_config.rb index d894ab4fa..8479458cf 100644 --- a/lib/sanitize_ext/sanitize_config.rb +++ b/lib/sanitize_ext/sanitize_config.rb @@ -130,6 +130,10 @@ class Sanitize 'embed' => { 'src' => HTTP_PROTOCOLS }, 'iframe' => { 'src' => HTTP_PROTOCOLS }, 'source' => { 'src' => HTTP_PROTOCOLS }, + }, + + add_attributes: { + 'iframe' => { 'sandbox' => 'allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms' }, } ) -- 2.47.3