sanitize 6.0.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +25 -0
- data/lib/sanitize/config/relaxed.rb +2 -0
- data/lib/sanitize/transformers/clean_css.rb +1 -0
- data/lib/sanitize/version.rb +1 -3
- data/test/test_malicious_css.rb +13 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10cf123f7eaed8a285ff4e7bae8505fb8a9af67dc523c3b5e4bd12a4dced17d6
|
4
|
+
data.tar.gz: bdf948795e0ddd9dd1ab4c725395e91e2862b7fd5a38260c41c698774a6c04c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19865991970865b794d40c357464b40a34bc405a9c5e5426a7ea69d6435b38ece6bdeeca9e3c12c0abdd1869a7a3a814b11bd937d445c3d003a0174d22c80969
|
7
|
+
data.tar.gz: 641dbdbccc41c7e7d6765e8f1abdea8c16ace06e79233cca757a0a7018827340084f6417ec24469b8fab23363e82894526b3d9523e4dfc8cf089fcb5e164ec55
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Sanitize History
|
2
2
|
|
3
|
+
## 6.1.0 (2023-09-14)
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
* Added the `text-decoration-skip-ink` and `text-decoration-thickness` CSS properties to the relaxed config. [@martineriksson - #228][228]
|
8
|
+
|
9
|
+
[228]:https://github.com/rgrove/sanitize/pull/228
|
10
|
+
|
11
|
+
## 6.0.2 (2023-07-06)
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* CVE-2023-36823: Fixed an HTML+CSS sanitization bypass that could allow XSS
|
16
|
+
(cross-site scripting). This issue affects Sanitize versions 3.0.0 through
|
17
|
+
6.0.1.
|
18
|
+
|
19
|
+
When using Sanitize's relaxed config or a custom config that allows `<style>`
|
20
|
+
elements and one or more CSS at-rules, carefully crafted input could be used
|
21
|
+
to sneak arbitrary HTML through Sanitize.
|
22
|
+
|
23
|
+
See the following security advisory for additional details:
|
24
|
+
[GHSA-f5ww-cq3m-q3g7](https://github.com/rgrove/sanitize/security/advisories/GHSA-f5ww-cq3m-q3g7)
|
25
|
+
|
26
|
+
Thanks to @cure53 for finding this issue.
|
27
|
+
|
3
28
|
## 6.0.1 (2023-01-27)
|
4
29
|
|
5
30
|
### Bug Fixes
|
data/lib/sanitize/version.rb
CHANGED
data/test/test_malicious_css.rb
CHANGED
@@ -39,4 +39,17 @@ describe 'Malicious CSS' do
|
|
39
39
|
it 'should not allow behaviors' do
|
40
40
|
_(@s.properties(%[behavior: url(xss.htc);])).must_equal ''
|
41
41
|
end
|
42
|
+
|
43
|
+
describe 'sanitization bypass via CSS at-rule in HTML <style> element' do
|
44
|
+
before do
|
45
|
+
@s = Sanitize.new(Sanitize::Config::RELAXED)
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'is not possible to prematurely end a <style> element' do
|
49
|
+
assert_equal(
|
50
|
+
%[<style>@media<\\/style><iframe srcdoc='<script>alert(document.domain)<\\/script>'>{}</style>],
|
51
|
+
@s.fragment(%[<style>@media</sty/**/le><iframe srcdoc='<script>alert(document.domain)</script>'></style>])
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
42
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanitize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Grove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crass
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 1.2.0
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.4.
|
124
|
+
rubygems_version: 3.4.10
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Allowlist-based HTML and CSS sanitizer.
|