CVE-2026-126079 — rails
One of 9 rails vulnerabilities published together by NVD: our article covers all of them.
RubyWebVulnerabilitiesAnalysis
Rails Action View XSS flaw (CVE-2026-126079) affects highlight and simple_format with HTML5 sanitizer
CVE-2026-126079 is a medium-severity (CVSS 6.1) cross-site scripting issue in Rails Action View. It affects applications using the HTML5 sanitizer that pass untrusted text to the highlight or simple_format helpers, and it is fixed in Rails 8.1.4.1 and 8.0.5.2.
Key points
- Rails Action View XSS flaw rated MEDIUM (CVSS 6.1)
- Affects apps using the HTML5 sanitizer, which is the default for load_defaults 7.1 or later on CRuby
- Triggered through highlight or simple_format when untrusted text is involved
- Fixed in Rails 8.1.4.1 and 8.0.5.2; Nokogiri 1.19.5 is also required
- Exploitation status and workarounds have not been published in the sources
CVE-2026-126079 is a cross-site scripting (XSS) vulnerability in Action View, the Rails component that handles view templates and HTML helpers. It is rated MEDIUM with a CVSS score of 6.1.
What's affected
The flaw affects Rails versions before 8.1.4.1 and 8.0.5.2. The problem only arises when the HTML5 sanitizer is in use. The NVD entry says this sanitizer is the default on CRuby for applications using load_defaults 7.1 or later. The underlying cause is in Nokogiri before 1.19.5, which serializes unescaped content inside attribute values.
The risk applies to applications that pass untrusted text to the highlight helper, or to simple_format with html_options. The highlight helper splits sanitized HTML on tag boundaries to insert matches, and simple_format splits it into paragraphs on blank lines. A stray > or blank line inside an attribute value can cause markup that the sanitizer had rendered inert to be emitted as live elements in the html_safe output.
How serious is it
The NVD describes the impact as possible XSS. Because the output is marked html_safe, Rails will not escape it again, so the injected elements reach the browser. The sources do not describe the attack conditions in more detail, and they do not say whether the flaw is being exploited in the wild or whether public proof-of-concept code exists. Those details have not been published in the material available here.
What to do
Upgrade Rails to 8.1.4.1 or 8.0.5.2, depending on your release line. Also update Nokogiri to 1.19.5 or later, since the affected serialization sits in that dependency. The sources do not list other versions or workarounds, so do not assume that older branches are safe. Review every call to highlight and simple_format that receives user-supplied input, and check any use of html_options. Until you have patched, consider escaping or validating untrusted text before it reaches these helpers, and watch for unexpected markup in rendered pages.
Recommended actions
- Upgrade Rails to 8.1.4.1 or 8.0.5.2 according to your release branch.
- Update Nokogiri to 1.19.5 or later.
- Find all uses of highlight and simple_format that receive user-supplied text, and check html_options usage.
- Until patched, validate or escape untrusted input before passing it to these helpers.
- Monitor vendor advisories for exploitation details and any additional fixed versions.
Summary
Action View is a framework for handling view template lookup and rendering and provides view helpers for building HTML. Prior to 8.1.4.1 and 8.0.5.2, with the HTML5 sanitizer (Rails::HTML5::Sanitizer, the default vendor on CRuby for applications using load_defaults 7.1 or later), Nokogiri before 1.19.5 serializes unescaped inside attribute values. The Action View text helpers highlight and simple_format sanitize their input and then process the resulting HTML as a string: highlight splits it on tag boundaries to insert matches, and simple_format splits it into paragraphs on blank lines. An unescaped > or a blank line inside an attribute value could cause markup in that value, which the sanitizer left inert, to be emitted as live elements in the helper's html_safe output, possibly leading to XSS. Applications that use the HTML5 sanitizer and pass untrusted text to highlight, or to simple_format with html_options, are affected. This issue is fixed in versions 8.1.4.1 and 8.0.5.2.
Severity breakdown
Medium · 6.1
An attacker without an account can exploit this over the network if a user is tricked into an action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Login needed
- no
- User action needed
- yes, someone must click, open or visit something
- Scope
- reaches beyond the vulnerable component (e.g. from a sandbox or VM to the host)
- Impact
- low on confidentiality and integrity, none on availability
Weakness
- CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| actionview (RubyGems) | ≥ 8.1.0.beta1, < 8.1.4.1 | 8.1.4.1 |
| < 8.0.5.2 | 8.0.5.2 | |
| rails | < 8.0.5.2, >= 8.1, < 8.1.4.1 | — |
References by type
Vendor advisories
Patches and fixed releases
- github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73
- github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11
- github.com/rails/rails/releases/tag/v8.0.5.2
- github.com/rails/rails/releases/tag/v8.1.4.1
Other references
Affected
- rails
What to do
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-126079?
CVE-2026-126079 is a medium-severity (CVSS 6.1) cross-site scripting issue in Rails Action View. It affects applications using the HTML5 sanitizer that pass untrusted text to the highlight or simpleformat helpers, and it is fixed in Rails 8.1.4.1 and 8.0.5.2. Weakness type: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79).
How severe is CVE-2026-126079?
CVE-2026-126079 has a CVSS 3.1 base score of 6.1 (medium), from the CNA (github.com). An attacker without an account can exploit this over the network if a user is tricked into an action.
Is CVE-2026-126079 being exploited?
Not as far as is known: CVE-2026-126079 is not in CISA's Known Exploited Vulnerabilities catalog as of November 28, 2026. EPSS estimates a 0.3% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-126079?
actionview (RubyGems) ≥ 8.1.0.beta1, < 8.1.4.1 (fixed in 8.1.4.1); actionview (RubyGems) < 8.0.5.2 (fixed in 8.0.5.2); rails < 8.0.5.2, >= 8.1, < 8.1.4.1.
How do I fix CVE-2026-126079?
Upgrade Rails to 8.1.4.1 or 8.0.5.2 according to your release branch. Update Nokogiri to 1.19.5 or later. Find all uses of highlight and simpleformat that receive user-supplied text, and check htmloptions usage.
Timeline & sources
References
Related vulnerabilities & news
- Ruby Security Flaws Enable Remote Code Execution
- CVE-2026-130001: Mustache for Ruby RCE Vulnerability
- CVE-2026-122006: Active Storage Vulnerability in Ruby on Rails
- msgpack-ruby JRuby decoder: header-declared sizes drive uncapped allocation and memory exhaustion (CVE-2026-126366)
- CVE-2026-126186: Rails Active Storage flaw can expose files or allow code execution via media processing