CVE-2022-22577 — Cross-site Scripting Vulnerability in actionpack
Cross-site Scripting Vulnerability in Action Pack
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.42%). Schedule for your next planned update.
Does your project use an affected actionpack version?
Paste your Gemfile.lock to check it for CVE-2022-22577 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
There is a possible XSS vulnerability in Rails / Action Pack. This vulnerability has been assigned the CVE identifier CVE-2022-22577.
Versions Affected: >= 5.2.0 Not affected: < 5.2.0 Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1
Impact
CSP headers were only sent along with responses that Rails considered as "HTML" responses. This left API requests without CSP headers, which could possibly expose users to XSS attacks.
Releases
The FIXED releases are available at the normal locations.
Workarounds
Set a CSP for your API responses manually.
Advisory Timeline
- First published April 27, 2022 (1674 days ago).
- Last revised February 18, 2024 — 661 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install actionpack -v 5.2.7.1
gem install actionpack -v 6.0.4.8
gem install actionpack -v 7.0.2.4
gem install actionpack -v 6.1.5.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (4)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| actionpack RubyGems · Affected: 5.2.0, 5.2.1, 5.2.1.1, 5.2.1.rc1 (+19 more) | 5.2.7.1 |
| actionpack RubyGems · Affected: 6.0.0, 6.0.1, 6.0.1.rc1, 6.0.2 (+21 more) | 6.0.4.8 |
| actionpack RubyGems · Affected: 7.0.0, 7.0.1, 7.0.2, 7.0.2.1 (+2 more) | 7.0.2.4 |
| actionpack RubyGems · Affected: 6.1.0, 6.1.1, 6.1.2, 6.1.2.1 (+12 more) | 6.1.5.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-22577ADVISORY
- https://github.com/rails/rails/pull/44635WEB
- https://github.com/rails/rails/commit/2b820a2a69fa50cffa74b4aedc57bf92ed6910ecWEB
- https://github.com/rails/rails/commit/5299b57d596ea274f77f5ffee2b79c6ee0255508WEB
- https://github.com/rails/rails/commit/8198d7c4accad0b6ba956b9d59528534a289866bWEB
- https://github.com/rails/rails/commit/d2253115ac2b30f5f7210670af906cebf79cf809WEB
- https://discuss.rubyonrails.org/t/cve-2022-22577-possible-xss-vulnerability-in-action-pack/80533WEB
- https://github.com/rails/railsPACKAGE
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2022-22577.ymlWEB
- https://groups.google.com/g/ruby-security-ann/c/NuFRKaN5swIWEB
- https://lists.debian.org/debian-lts-announce/2022/09/msg00002.htmlWEB
- 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-releasedWEB
- https://security.netapp.com/advisory/ntap-20221118-0002WEB
- https://www.debian.org/security/2023/dsa-5372WEB
Frequently Asked Questions
- What is CVE-2022-22577?
- Cross-site Scripting Vulnerability in Action Pack. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2022-22577?
- CVE-2022-22577 affects actionpack. It has a 1.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-22577 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is an above-median EPSS score — 73% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2021-22885HIGH
Action Pack contains Information Disclosure / Unintended Method Execution vulnerability
- CVE-2011-1497MEDIUM
Cross site scripting in actionpack Rubygem
- CVE-2021-44528MEDIUM
actionpack Open Redirect in Host Authorization Middleware
- CVE-2026-126073MEDIUM
Action Pack: Possible cache poisoning in Action Pack content negotiation
- CVE-2026-126072MEDIUM
Action Pack: Possible DoS vulnerability in Action Controller Live streaming
- CVE-2024-47887MEDIUM
Possible ReDoS vulnerability in HTTP Token authentication in Action Controller
- CVE-2026-33167LOW
Rails has a possible XSS vulnerability in its Action Pack debug exceptions
- CVE-2024-54133LOW
Possible Content Security Policy bypass in Action Dispatch