MediumGHSA-ch3h-j2vf-95pvCVE-2022-27777

XSS Vulnerability in Action View tag helpers

Published 27 Apr 2022 · Updated 16 Feb 2024

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
<5.2.7.1
Fixed in
5.2.7.1
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 5.2.7.1'
actionviewRubyGems
Affected
>=6.0.0 <6.0.4.8
Fixed in
6.0.4.8
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 6.0.4.8'
actionviewRubyGems
Affected
>=6.1.0 <6.1.5.1
Fixed in
6.1.5.1
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 6.1.5.1'
actionviewRubyGems
Affected
>=7.0.0 <7.0.2.4
Fixed in
7.0.2.4
Update to the fixed version for your release line, for example:bundle update --conservative actionview # Gemfile: '>= 7.0.2.4'

Details

There is a possible XSS vulnerability in Action View tag helpers. Passing untrusted input as hash keys can lead to a possible XSS vulnerability. This vulnerability has been assigned the CVE identifier CVE-2022-27777.

Versions Affected: ALL Not affected: NONE Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1

Impact

If untrusted data is passed as the hash key for tag attributes, there is a possibility that the untrusted data may not be properly escaped which can lead to an XSS vulnerability.

Impacted code will look something like this:

check_box_tag('thename', 'thevalue', false, aria: { malicious_input => 'thevalueofaria' })

Where the "malicious_input" variable contains untrusted data.

All users running an affected release should either upgrade or use one of the workarounds immediately.

Releases

The FIXED releases are available at the normal locations.

Workarounds

Escape the untrusted data before using it as a key for tag helper methods.

Is GHSA-ch3h-j2vf-95pv 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-126070Action View: Possible XSS vulnerability in strip_tags · 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
All 17 advisories for actionview

References

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