diff --git a/config/initializers/html_sanitizer.rb b/config/initializers/html_sanitizer.rb
index 8183f9a85..80ae25b52 100644
--- a/config/initializers/html_sanitizer.rb
+++ b/config/initializers/html_sanitizer.rb
@@ -5,11 +5,11 @@ Rails.application.config.html_sanitizer_tags_remove_content = %w[
style
comment
meta
+ script
]
# content of this tags will will be inserted html quoted
Rails.application.config.html_sanitizer_tags_quote_content = %w[
- script
]
# only this tags are allowed
diff --git a/spec/models/channel/email_parser_spec.rb b/spec/models/channel/email_parser_spec.rb
index b553db6f3..9a30a3102 100644
--- a/spec/models/channel/email_parser_spec.rb
+++ b/spec/models/channel/email_parser_spec.rb
@@ -1258,7 +1258,7 @@ RSpec.describe Channel::EmailParser, type: :model do
let(:content_type) { 'text/html' }
it 'removes injected some text') }
- it 'strips out
+ some other text
RAW
it 'removes '), '<b>123</b>')
- assert_equal(HtmlSanitizer.strict(''), '<style><b>123</b></style>')
+ assert_equal(HtmlSanitizer.strict(''), '')
+ assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('123123'), '123123')
assert_equal(HtmlSanitizer.strict('123123abc'), '123123abc')
assert_equal(HtmlSanitizer.strict('123'), '123')
- assert_equal(HtmlSanitizer.strict(''), 'alert("XSS!");')
+ assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
- assert_equal(HtmlSanitizer.strict('">'), 'alert("XSS")">')
+ assert_equal(HtmlSanitizer.strict('">'), '">')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
@@ -27,13 +27,13 @@ class HtmlSanitizerTest < ActiveSupport::TestCase
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('
'), '')
assert_equal(HtmlSanitizer.strict(''), '')
- assert_equal(HtmlSanitizer.strict('<'), '<alert("XSS");//<')
+ assert_equal(HtmlSanitizer.strict('<'), '<')
assert_equal(HtmlSanitizer.strict(''), 'alert(\'XSS\');')
+ assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('- XSS'), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
@@ -73,7 +73,7 @@ tt p://6 6.000146.0x7.147/">XSS', true), ''), '')
assert_equal(HtmlSanitizer.strict('XXX'), 'XXX')
assert_equal(HtmlSanitizer.strict('XXX', true), 'XXX')
- assert_equal(HtmlSanitizer.strict(''), 'alert(1)')
+ assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('', true), '')
assert_equal(HtmlSanitizer.strict('