GitHub Advisoryadvisory · RubyGems
GHSA-ch3h-j2vf-95pv XSS Vulnerability in Action View tag helpers
MEDIUM
Official page ↗
- Aliases
- CVE-2022-27777
- Ecosystem
- RubyGems
- Packages
- actionview
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2022-04-27
Affected packages
• RubyGems actionview: < 5.2.7.1 → fixed in 5.2.7.1
• RubyGems actionview: >= 6.0.0, < 6.0.4.8 → fixed in 6.0.4.8
• RubyGems actionview: >= 6.1.0, < 6.1.5.1 → fixed in 6.1.5.1
• RubyGems actionview: >= 7.0.0, < 7.0.2.4 → fixed in 7.0.2.4
Description
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.
Related
Alias · CVE (1)
- CVE-2022-27777 A XSS Vulnerability in Action View tag helpers >= 5.2.0 and < 5.2.0 which would allow an attacker to inject content if able to control… vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-27777 advisory
- https://github.com/rails/rails/commit/649516ce0feb699ae06a8c5e81df75d460cc9a85 web
- https://discuss.rubyonrails.org/t/cve-2022-27777-possible-xss-vulnerability-in-action-view-tag-helpers/80534 web
- https://github.com/rails/rails package
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2022-27777.yml web
- https://groups.google.com/g/ruby-security-ann/c/9wJPEDv-iRw web
- https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html web
- https://rubyonrails.org/2022/4/26/Rails-7-0-2-4-6-1-5-1-6-0-4-8-and-5-2-7-1-have-been-released web
- https://www.debian.org/security/2023/dsa-5372 web