chore(deps-dev): bump loofah from 2.25.2 to 2.25.3
DE
18h ago+7+7+0123456789-7-7-0123456789
Bumps loofah from 2.25.2 to 2.25.3.
Release notes
Sourced from loofah's releases.
2.25.3 / 2026-11-01
Security
- Ensure
Loofah::HTML5::Scrub.allowed_uri?rejects schemes split by a numeric character reference without a semicolon that ends at a characterallowed_uri?strips (e.g.javascript: alert(1)) or at another character reference (e.g.javascript:alert(1)). Character references are now decoded before anything is stripped, as browsers do. See GHSA-p9wj-w8xq-vjx6.@flavorjones- Ensure
Loofah::HTML5::Scrub.allowed_uri?recognizes the named character reference/, whichCGI.unescapeHTMLdoes not decode and browsers read as/, and rejectsdata:URIs that disguise a disallowed mediatype with it (e.g.data:text/html,<script>alert(1)</script>). Previously that mediatype was treated as malformed and fell back to the allowedtext/plain. Only v2.25.2 is affected. See GHSA-jcff-cj73-4w4f.@flavorjones- Ensure
Loofah::HTML5::Scrub.scrub_cssdoes not decode CSS escapes in identifiers. Previously, escaped parentheses (e.g.url\28 http://example.com/\29) came out as a liveurl(), which could make the viewer's browser fetch an attacker-chosen URL. See GHSA-m3x9-938q-5767.@flavorjones- Ensure that
hrefandxlink:hrefon SVGtextPathandmpathelements are restricted to local (same-document) references. PreviouslySVG_ALLOW_LOCAL_HREFspelledtextPathin lowercase, which never matched the name the HTML5 parser assigns inside<svg>, and omittedmpathentirely. See GHSA-345x-3rq2-jfrm.@flavorjones- Fix quadratic-time scrubbing of the
hrefandxlink:hrefattributes of SVG elements. Only Ruby 3.1 and earlier are affected, because Ruby 3.2 introduced linear-time regexp matching. See GHSA-mf2j-8f84-cc9q.@flavorjones- Ensure HTML5 scrubber output does not turn into new markup when a browser parses it again. The fix is in Nokogiri v1.19.5, which escapes
<and>in attribute values as the HTML standard requires, so Loofah now requires Nokogiri >= 1.19.5. See GHSA-h6v6-rg66-fqj4.@flavorjones@hackvertorDependencies
- Loofah now requires Ruby >= 3.2, the minimum that Nokogiri v1.19.x supports. We don't like dropping Ruby versions in a patch release, and we're sorry for the inconvenience, but it's the only way to make sure everyone gets the security fix in GHSA-h6v6-rg66-fqj4.
Added
Loofah::HTML5::Scrub.prefixed_attribute_nameandLoofah::HTML5::Scrub.scrub_attribute_valueexpose the html5lib attribute name and value rules, so downstream consumers can apply them instead of carrying their own copy.@flavorjonesFixed
- Fix
:double_breakpoint, which left document fragments unchanged despite its documented example. The scrubber now changes only paragraphs inside the scrubbed node, and its run time on a document grows linearly, not quadratically, with the paragraph count. #309@OskarEichler- Fix
:whitewash, which passed CDATA sections through unchanged. Markup inside a CDATA section inLoofah.xml_fragmentorLoofah.xml_documentsurvived scrubbing and became live elements if the output was later parsed as HTML. The scrubber now escapes CDATA content, as:strip,:pruneand:escapealready do. On JRuby, every sanitizer now emits escaped CDATA content as a CDATA section, as on CRuby, instead of a text node that double-escaped it. #313@flavorjones(reported by@MegaManSec)- Fix
:double_breakpoint, which raisedNoMethodErroron a paragraph that ends with a<br>after a double break. #314@flavorjones(reported by@MegaManSec)- Fix
Loofah::HTML5::Scrub.allowed_uri?, which raisedEncoding::CompatibilityErroron a string in an encoding other than UTF-8 andArgumentErroron invalid UTF-8. It now transcodes the input to UTF-8 and returnsfalsewhen the input has an invalid byte sequence or no UTF-8 representation. #315@flavorjonesNew Contributors
@OskarEichlermade their first contribution in flavorjones/loofah#309Full Changelog: https://github.com/flavorjones/loofah/compare/v2.25.2...v2.25.3
Changelog
Sourced from loofah's changelog.
2.25.3 / 2026-11-01
Security
- Ensure
Loofah::HTML5::Scrub.allowed_uri?rejects schemes split by a numeric character reference without a semicolon that ends at a characterallowed_uri?strips (e.g.javascript: alert(1)) or at another character reference (e.g.javascript:alert(1)). Character references are now decoded before anything is stripped, as browsers do. See GHSA-p9wj-w8xq-vjx6.@flavorjones- Ensure
Loofah::HTML5::Scrub.allowed_uri?recognizes the named character reference/, whichCGI.unescapeHTMLdoes not decode and browsers read as/, and rejectsdata:URIs that disguise a disallowed mediatype with it (e.g.data:text/html,<script>alert(1)</script>). Previously that mediatype was treated as malformed and fell back to the allowedtext/plain. Only v2.25.2 is affected. See GHSA-jcff-cj73-4w4f.@flavorjones- Ensure
Loofah::HTML5::Scrub.scrub_cssdoes not decode CSS escapes in identifiers. Previously, escaped parentheses (e.g.url\28 http://example.com/\29) came out as a liveurl(), which could make the viewer's browser fetch an attacker-chosen URL. See GHSA-m3x9-938q-5767.@flavorjones- Ensure that
hrefandxlink:hrefon SVGtextPathandmpathelements are restricted to local (same-document) references. PreviouslySVG_ALLOW_LOCAL_HREFspelledtextPathin lowercase, which never matched the name the HTML5 parser assigns inside<svg>, and omittedmpathentirely. See GHSA-345x-3rq2-jfrm.@flavorjones- Fix quadratic-time scrubbing of the
hrefandxlink:hrefattributes of SVG elements. Only Ruby 3.1 and earlier are affected, because Ruby 3.2 introduced linear-time regexp matching. See GHSA-mf2j-8f84-cc9q.@flavorjones- Ensure HTML5 scrubber output does not turn into new markup when a browser parses it again. The fix is in Nokogiri v1.19.5, which escapes
<and>in attribute values as the HTML standard requires, so Loofah now requires Nokogiri >= 1.19.5. See GHSA-h6v6-rg66-fqj4.@flavorjones@hackvertorDependencies
- Loofah now requires Ruby >= 3.2, the minimum that Nokogiri v1.19.x supports. We don't like dropping Ruby versions in a patch release, and we're sorry for the inconvenience, but it's the only way to make sure everyone gets the security fix in GHSA-h6v6-rg66-fqj4.
Added
Loofah::HTML5::Scrub.prefixed_attribute_nameandLoofah::HTML5::Scrub.scrub_attribute_valueexpose the html5lib attribute name and value rules, so downstream consumers can apply them instead of carrying their own copy.@flavorjonesFixed
- Fix
:double_breakpoint, which left document fragments unchanged despite its documented example. The scrubber now changes only paragraphs inside the scrubbed node, and its run time on a document grows linearly, not quadratically, with the paragraph count. #309@OskarEichler- Fix
:whitewash, which passed CDATA sections through unchanged. Markup inside a CDATA section inLoofah.xml_fragmentorLoofah.xml_documentsurvived scrubbing and became live elements if the output was later parsed as HTML. The scrubber now escapes CDATA content, as:strip,:pruneand:escapealready do. On JRuby, every sanitizer now emits escaped CDATA content as a CDATA section, as on CRuby, instead of a text node that double-escaped it. #313@flavorjones(reported by@MegaManSec)- Fix
:double_breakpoint, which raisedNoMethodErroron a paragraph that ends with a<br>after a double break. #314@flavorjones(reported by@MegaManSec)- Fix
Loofah::HTML5::Scrub.allowed_uri?, which raisedEncoding::CompatibilityErroron a string in an encoding other than UTF-8 andArgumentErroron invalid UTF-8. It now transcodes the input to UTF-8 and returnsfalsewhen the input has an invalid byte sequence or no UTF-8 representation. #315@flavorjones
Commits
bbe007eversion bump to v2.25.3a390863Merge pull request #324 from flavorjones/card-933-release-v2-25-37f20abadoc: fix up CHANGELOG30924babuild: require Ruby >= 3.27ba1e7bfix: require Nokogiri >= 1.19.5 to prevent mXSS in HTML5 scrubbers41c681bdoc: fix up CHANGELOG5431ea9doc: update CHANGELOG62c0484fix:allowed_uri?bypass via a stripped reference terminatorad92002Updateallowed_uri?to handle the named solidus character referenced3ae9ebdoc: update CHANGELOG- Additional commits viewable in compare view
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 rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill 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 versionwill 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 dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the Security Alerts page.
Summary by cubic
Updates loofah from 2.25.2 to 2.25.3 to address HTML and CSS sanitization security issues.
The update also requires Ruby 3.2 or later and upgrades nokogiri to 1.19.7 and crass to 1.0.8.