Technical impact
A Cross‑Site Scripting flaw exists in the Action View text helpers highlight and simple_format. They sanitize their input but then treat the sanitized string as raw HTML. If an attacker can supply a value for a tag attribute that contains an unescaped ’>’ or a blank line, the sanitizer does not escape those characters but the helper still inserts the resulting string into the rendered page. The escaped characters are therefore rendered as live markup, allowing an attacker to inject executable script. This weakness can compromise confidentiality and integrity of client data by enabling arbitrary JavaScript to run in the context of a target user’s browser.
Affected Systems
The issue affects Ruby on Rails applications that use the default HTML5 sanitizer (Rails::HTML5::Sanitizer) in Rails versions earlier than 8.1.4.1 and 8.0.5.2. Applications built with Rails 8.0.x before 8.0.5.2 or Rails 8.1.x before 8.1.4.1, which call highlight or simple_format with untrusted text or html_options, are vulnerable.
Risk and Exploitability
The CVSS score of 6.1 indicates moderate severity. EPSS is below 1%, suggesting exploitation is unlikely to be common. The vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that an attacker would need to supply crafted input that is processed by highlight or simple_format in an application using the default HTML5 sanitizer. Once the input reaches these helpers, the flaw can be triggered without additional actions, making it relatively easy to exploit in affected deployments.
Github GHSA