CVE-2022-23518
Ruby vulnerability analysis and mitigation

Overview

Rails HTML Sanitizer (rails-html-sanitizer), a library responsible for sanitizing HTML fragments in Rails applications, was found to be vulnerable to cross-site scripting (XSS) attacks. Versions >= 1.0.3 and < 1.4.4, when used in combination with Loofah >= 2.1.0, are affected by this vulnerability. The issue was discovered and reported independently by Maciej Piechota and Mrinmoy Das, and was patched in version 1.4.4 (GitHub Advisory).

Technical details

The vulnerability stems from improper neutralization of data URIs in the scrub_attribute method. There was a divergence between the code present in Loofah and how it was handled in the PermitScrubber class. The missing safe data URI validation allowed injection of base64 encoded XSS scripts. The vulnerability has been assigned a CVSS v3.1 base score of 6.1 (Medium) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N (NVD).

Impact

The vulnerability could allow attackers to execute cross-site scripting (XSS) attacks through data URIs. This could potentially lead to unauthorized access to sensitive information and manipulation of web content. The impact is categorized as having low confidentiality and integrity impact, with no impact on availability (GitHub Advisory).

Mitigation and workarounds

The recommended mitigation is to upgrade to rails-html-sanitizer version 1.4.4 or later, which contains the security fix. For Debian 10 users, the fix has been backported to version 1.0.4-1+deb10u2 (Debian Advisory).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4249-gjr8-jpq3HIGH8.7
  • RubyRuby
  • prosemirror_to_html
NoYesNov 13, 2025
CVE-2025-64501HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 10, 2025
GHSA-vfpf-xmwh-8m65HIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 07, 2025
GHSA-52c5-vh7f-26fxHIGH7.6
  • RubyRuby
  • prosemirror_to_html
NoYesNov 06, 2025
CVE-2025-12790HIGH7.4
  • RubyRuby
  • mqtt
NoYesNov 06, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management