Added the text-decoration-skip-ink and text-decoration-thickness CSS properties to the relaxed config. [@martineriksson - #228]228
v6.0.2
Bug Fixes
CVE-2023-36823: Fixed an HTML+CSS sanitization bypass that could allow XSS (cross-site scripting). This issue affects Sanitize versions 3.0.0 through 6.0.1.
When using Sanitize's relaxed config or a custom config that allows <style> elements and one or more CSS at-rules, carefully crafted input could be used to sneak arbitrary HTML through Sanitize.
See the following security advisory for additional details: GHSA-f5ww-cq3m-q3g7
Sanitize now always removes <noscript> elements and their contents, even when noscript is in the allowlist.
This fixes a sanitization bypass that could occur when noscript was allowed by a custom allowlist. In this scenario, carefully crafted input could sneak arbitrary HTML through Sanitize, potentially enabling an XSS (cross-site scripting) attack.
Sanitize's default configs don't allow <noscript> elements and are not vulnerable. This issue only affects users who are using a custom config that adds noscript to the element allowlist.
The root cause of this issue is that HTML parsing rules treat the contents of a <noscript> element differently depending on whether scripting is enabled in the user agent. Nokogiri doesn't support scripting so it follows the "scripting disabled" rules, but a web browser with scripting enabled will follow the "scripting enabled" rules. This means that Sanitize can't reliably make the contents of a <noscript> element safe for scripting enabled browsers, so the safest thing to do is to remove the element and its contents entirely.
See the following security advisory for additional details: GHSA-fw3g-2h3j-qmm7
Fixed an edge case in which the contents of an "unescaped text" element (such as <noembed> or <xmp>) were not properly escaped if that element was allowlisted and was also inside an allowlisted <math> or <svg> element.
The only way to encounter this situation was to ignore multiple warnings in the readme and create a custom config that allowlisted all the elements involved, including <math> or <svg>. If you're using a default config or if you heeded the warnings about MathML and SVG not being supported, you're not affected by this issue.
Please let this be a reminder that Sanitize cannot safely sanitize MathML or SVG content and does not support this use case. The default configs don't allow MathML or SVG elements, and allowlisting MathML or SVG elements in a custom config may create a security vulnerability in your application.
Documentation has been updated to add more warnings and to make the existing warnings about this more prominent.
Added the text-decoration-skip-ink and text-decoration-thickness CSS properties to the relaxed config. [@martineriksson - #228]228
6.0.2 (2023-07-06)
Bug Fixes
CVE-2023-36823: Fixed an HTML+CSS sanitization bypass that could allow XSS
(cross-site scripting). This issue affects Sanitize versions 3.0.0 through
6.0.1.
When using Sanitize's relaxed config or a custom config that allows <style>
elements and one or more CSS at-rules, carefully crafted input could be used
to sneak arbitrary HTML through Sanitize.
See the following security advisory for additional details:
GHSA-f5ww-cq3m-q3g7
Sanitize now always removes <noscript> elements and their contents, even
when noscript is in the allowlist.
This fixes a sanitization bypass that could occur when noscript was allowed
by a custom allowlist. In this scenario, carefully crafted input could sneak
arbitrary HTML through Sanitize, potentially enabling an XSS (cross-site
scripting) attack.
Sanitize's default configs don't allow <noscript> elements and are not
vulnerable. This issue only affects users who are using a custom config that
adds noscript to the element allowlist.
The root cause of this issue is that HTML parsing rules treat the contents of
a <noscript> element differently depending on whether scripting is enabled
in the user agent. Nokogiri doesn't support scripting so it follows the
"scripting disabled" rules, but a web browser with scripting enabled will
follow the "scripting enabled" rules. This means that Sanitize can't reliably
make the contents of a <noscript> element safe for scripting enabled
browsers, so the safest thing to do is to remove the element and its contents
entirely.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps sanitize from 5.2.3 to 6.1.0.
Release notes
Sourced from sanitize's releases.
... (truncated)
Changelog
Sourced from sanitize's changelog.
... (truncated)
Commits
7194dca
Release 6.1.01bba64e
Add a couple of CSS properties to relaxed configd76c8aa
Merge pull request #225 from igor-drozdov/igor-drozdov-patch-1cf84bfe
Add 3.2 to the list of Ruby CI versions76ed46e
Merge pull request from GHSA-f5ww-cq3m-q3g73481ac3
Release 6.0.2773d927
Update history041c068
Escape</
to prevent a style element from being closed prematurelya92f21c
Release 6.0.17ac1dfb
Update linksDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show