HexBrain

Internet Bug Bounty · Report #1804128

ReDoS (Rails::Html::PermitScrubber.scrub_attribute)

Validstatus
highseverity
$4,000bounty
15upvotes
14 Dec 2022disclosed

Summary

Summary

Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption.

Mitigation

Upgrade to rails-html-sanitizer >= 1.4.4.

Severity

The maintainers have evaluated this as High Severity 7.5 (CVSS 3.1).

References

How it was found

I reported at https://hackerone.com/reports/1684163

https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-5x79-w82f-gw8w

Certain configurations of rails-html-sanitizer < 1.4.4 use an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption.

It seems that the same problem existed on the Loofah side, so it was fixed as well. That has been fixed as CVE-2022-23514(https://github.com/flavorjones/loofah/security/advisories/GHSA-486f-hjj9-9vhh)

Impact

ReDoS may occur if scrub is executed in Rails::Html::PermitScrubber.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original