MediumGHSA-rq8q-p985-fjq7CVE-2026-126070

Action View: Possible XSS vulnerability in strip_tags

Published 12 Nov 2026 · Updated 12 Nov 2026

Is your project on an affected actionview?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

actionviewRubyGems
Affected
>=8.1.0.beta1 <8.1.4.1
Fixed in
8.1.4.1
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 8.1.4.1'
actionviewRubyGems
Affected
<8.0.5.2
Fixed in
8.0.5.2
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 8.0.5.2'

Details

Impact

strip_tags in Action View returns its sanitized output marked html_safe, but the underlying sanitizer encodes only &, < and >, leaving " and ' unencoded. Because ERB does not escape a string marked html_safe, untrusted input passed through strip_tags and rendered inside a quoted HTML attribute value could close the attribute and add new attributes, possibly leading to XSS. Applications that render strip_tags output from untrusted input inside an HTML attribute, for example in a title attribute or a <meta content> tag, are affected. Output rendered as element content is not affected.

Details

strip_tags now encodes " and ' in its output, as well as &, < and >, without double-encoding existing entities. Applications that use strip_tags output outside HTML, such as in a text template or JSON, now see &quot; and &#39; where they saw " and '; CGI.unescapeHTML decodes them. See the Action View CHANGELOG.

Workarounds

Pass strip_tags output to an attribute through a tag helper, which escapes attribute values, for example tag.a(title: strip_tags(user_input)).

Releases

The fixed releases are available at the normal locations.

Patches for those who cannot upgrade at once:

  • 8.1: https://github.com/rails/rails/commit/568b19cb860322885593e308a7f27aceb779e9d7.patch
  • 8.0: https://github.com/rails/rails/commit/c3772a10f405f9644125cbb484adfd2aa7a25a59.patch

Credit

This issue was responsibly reported by HackerOne researcher lucasluitjes.

Is GHSA-rq8q-p985-fjq7 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected actionview, and gives you the command that fixes it.

More advisories for actionview

  • MediumCVE-2026-126078Action View: Possible XSS vulnerability in highlight helper · 12 Nov 2026
  • MediumCVE-2026-126079Action View: Possible XSS vulnerability in text helpers · 12 Nov 2026
  • MediumCVE-2026-126069Action View: Possible XSS vulnerability in tag helpers · 12 Nov 2026
  • LowCVE-2026-33168Rails has a possible XSS vulnerability in its Action View tag helpers · 23 Mar 2026
  • MediumCVE-2023-23913rails-ujs vulnerable to DOM Based Cross-site Scripting contenteditable HTML Elements · 9 Jun 2023
  • MediumCVE-2022-27777XSS Vulnerability in Action View tag helpers · 27 Apr 2022
All 17 advisories for actionview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.