CVE-2026-126079: Action View: Possible XSS vulnerability in text helpers
Published 2026-11-12 · Updated 2026-11-12 · Also known as GHSA-2p2f-4rq4-gjwc
Summary
A cross-site scripting (XSS) vulnerability exists in Action View's text helpers due to improper serialization of HTML5 attributes. Developers using Ruby on Rails applications with the HTML5 sanitizer must upgrade their dependencies to secure their input processing.
Who is affected
The vulnerability affects applications using the HTML5 sanitizer (default in Rails 7.1+) when passing untrusted input to the 'highlight' or 'simple_format' helpers. An attacker can exploit this by injecting specific character sequences into attribute values, which causes the sanitizer to incorrectly render inert content as live HTML elements.
Exploitability
With a CVSS 3.1 score of 6.1, this vulnerability is classified as medium severity and requires no special privileges or complex access conditions. While the current EPSS score is 0.003, indicating low current prevalence, it remains unlisted in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade to actionview version 8.1.4.1 or 8.0.5.2.
- Update the project dependencies to use rails-html-sanitizer 1.7.2 or later, which requires Loofah 2.25.3 and Nokogiri 1.19.5.
- Alternatively, set 'config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer' to revert to the older, secure sanitization logic.
How to check your project
- Inspect Gemfile.lock to verify if actionview is within the affected version ranges (0 to 8.0.5.1 or 8.1.0.beta1 to 8.1.4.0).
- Check Rails configuration files to see if the HTML5 sanitizer is in use via 'load_defaults 7.1' or higher.
- Verify the installed version of the nokogiri gem to ensure it is 1.19.5 or higher.
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| RubyGems | actionview |
>= 8.1.0.beta1, < 8.1.4.1 | 8.1.4.1 | bundle update actionview |
| RubyGems | actionview |
>= 0, < 8.0.5.2 | 8.0.5.2 | bundle update actionview |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | Required |
| Scope | Changed |
| Confidentiality | Low |
| Integrity | Low |
| Availability | None |
FAQ
Do I need to upgrade my entire Rails framework to fix this?
Not necessarily; you can mitigate the risk by upgrading Nokogiri to version 1.19.5 or later, or by explicitly configuring your application to use the HTML4 sanitizer.
Is this vulnerability actively being exploited?
No, it is not listed in the CISA Known Exploited Vulnerabilities catalog.
Which specific Action View helpers are vulnerable?
The 'highlight' and 'simple_format' helpers are identified as vulnerable when processing untrusted input under the conditions described.
Original advisory description
References
- WEB https://github.com/rails/rails/security/advisories/GHSA-2p2f-4rq4-gjwc
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-126079
- WEB https://github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11
- WEB https://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73
- PACKAGE https://github.com/rails/rails
- WEB https://github.com/rails/rails/releases/tag/v8.0.5.2
- WEB https://github.com/rails/rails/releases/tag/v8.1.4.1
- WEB https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/GHSA-2p2f-4rq4-gjwc.yml
- WEB http://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73
Source records: GHSA-2p2f-4rq4-gjwc (OSV.dev) · EPSS by FIRST, 2026-11-21.