sanitize 6.0.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +17 -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: 93adca1e155370d138ccb7c500b618e2ed218297d21593ec8937638f4d99731b
|
|
4
|
+
data.tar.gz: 740b6d84113a0945928601b6cad03e36b4ee76f7c3098c72ddb1a1b01ec5d0ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d3e9852ec92ac961c2e35d4a04e7d967dd2eac364e656837b93daf95c1b653da53d4ef7f104af83887e46d08237ddca1efa945facde3efbfcfce0164c0fe334
|
|
7
|
+
data.tar.gz: 05a56334e5cdbbee7b165b19245b90a8acdd82bcd72bbc9f84e2780d914f8b040d19d9ff71934b0c1bd71df4b55f407f460c76dffdbd275b183ecaffb2fa6c38
|
data/HISTORY.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Sanitize History
|
|
2
2
|
|
|
3
|
+
## 6.0.2 (2023-07-06)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* CVE-2023-36823: Fixed an HTML+CSS sanitization bypass that could allow XSS
|
|
8
|
+
(cross-site scripting). This issue affects Sanitize versions 3.0.0 through
|
|
9
|
+
6.0.1.
|
|
10
|
+
|
|
11
|
+
When using Sanitize's relaxed config or a custom config that allows `<style>`
|
|
12
|
+
elements and one or more CSS at-rules, carefully crafted input could be used
|
|
13
|
+
to sneak arbitrary HTML through Sanitize.
|
|
14
|
+
|
|
15
|
+
See the following security advisory for additional details:
|
|
16
|
+
[GHSA-f5ww-cq3m-q3g7](https://github.com/rgrove/sanitize/security/advisories/GHSA-f5ww-cq3m-q3g7)
|
|
17
|
+
|
|
18
|
+
Thanks to @cure53 for finding this issue.
|
|
19
|
+
|
|
3
20
|
## 6.0.1 (2023-01-27)
|
|
4
21
|
|
|
5
22
|
### 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.0.2
|
|
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-07-06 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.
|