Rails Html Sanitizer
Monthly
Cross-site scripting in the rails-html-sanitizer gem before 1.7.2 lets a concurrent request be sanitized with another call's more permissive allowlist, so a stricter call can emit script elements or event-handler attributes that the application expects to have been stripped. The flaw only manifests in multi-threaded Ruby processes (for example Puma with more than one thread) where sanitize is called with differing tags: or attributes: options, and where an attacker can trigger the permissive path while a stricter, rendered output is being produced; single-threaded apps, apps with one uniform allowlist, and apps passing their own scrubber: are not affected. Exploitation requires winning a race window and rendering the poisoned output to a victim (CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, 4.7), and no public exploit code was identified at time of analysis; the vendor-released fix is 1.7.2.
Quadratic CPU consumption in rails-html-sanitizer 1.0.3 through 1.7.1 lets remote, unauthenticated attackers make a sanitizing application burn disproportionate CPU by submitting an SVG reference element such as <use> whose href or xlink:href is a long all-whitespace run. Only applications that override the default allowed tags to include an SVG reference element and permit href/xlink:href are exposed, and the host must run CRuby 3.1 or earlier (or JRuby) - CRuby 3.2 and later use linear-time regexp matching and are not affected; the default configuration ships no SVG elements and is safe. Impact is bounded to availability (CVSS 3.1 base 5.3, A:L), and no public exploit code was identified at time of analysis, with the vendor-reported issue credited to scyoon via the Rails HackerOne program.
Cross-site scripting in the rails-html-sanitizer gem before 1.7.2 lets a concurrent request be sanitized with another call's more permissive allowlist, so a stricter call can emit script elements or event-handler attributes that the application expects to have been stripped. The flaw only manifests in multi-threaded Ruby processes (for example Puma with more than one thread) where sanitize is called with differing tags: or attributes: options, and where an attacker can trigger the permissive path while a stricter, rendered output is being produced; single-threaded apps, apps with one uniform allowlist, and apps passing their own scrubber: are not affected. Exploitation requires winning a race window and rendering the poisoned output to a victim (CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, 4.7), and no public exploit code was identified at time of analysis; the vendor-released fix is 1.7.2.
Quadratic CPU consumption in rails-html-sanitizer 1.0.3 through 1.7.1 lets remote, unauthenticated attackers make a sanitizing application burn disproportionate CPU by submitting an SVG reference element such as <use> whose href or xlink:href is a long all-whitespace run. Only applications that override the default allowed tags to include an SVG reference element and permit href/xlink:href are exposed, and the host must run CRuby 3.1 or earlier (or JRuby) - CRuby 3.2 and later use linear-time regexp matching and are not affected; the default configuration ships no SVG elements and is safe. Impact is bounded to availability (CVSS 3.1 base 5.3, A:L), and no public exploit code was identified at time of analysis, with the vendor-reported issue credited to scyoon via the Rails HackerOne program.