v1.7.2 / 2026-11-02
-
Deciding whether an SVG
hreforxlink:hrefis a local reference no longer takes quadratic time.PermitScrubbermatched the attribute value against a pattern that rescanned the value's
whitespace run from every line start, so an all-whitespace value took seconds to scrub. Only
Ruby 3.1 and earlier are affected, because Ruby 3.2 introduced linear-time regexp matching.
ThroughPermitScrubber, applications are only affected if the allowed tags are overridden to
include an SVG reference element such asuse; the default configuration is not affected.This change addresses GHSA-cpgf-5mjf-73p7.
PermitScrubbernow applies the html5lib attribute
value rules by callingLoofah::HTML5::Scrub.scrub_attribute_valuerather than carrying its own
copy. The minimum Loofah dependency is now~> 2.25, >= 2.25.3.Mike Dalessio
-
rails-html-sanitizer now requires Ruby >= 3.2, because Loofah 2.25.3 requires it.
The
1.6.xand1.5.xrelease branches no longer receive security updates. Every Rails release
in security support accepts rails-html-sanitizer 1.7 and requires Ruby >= 3.2.Mike Dalessio
-
SafeListSanitizerno longer shares aPermitScrubberacross calls.Previously one sanitizer instance reused a single
PermitScrubber, assigning itstagsand
attributeson every call. Action View memoizes one sanitizer per helper module, so two
concurrentsanitizecalls with differenttags:orattributes:options could interleave and
one call could be scrubbed with the other call's allowlist. Each call now builds its own
PermitScrubber.This change addresses GHSA-h7wh-q2qr-458c.
Mike Dalessio