CVE-2022-21831
Possible code injection vulnerability in Rails / Active Storage
Summary
Remediation
Upgrade to the fixed version using your package manager.
gem install activestorage -v 5.2.6.3
gem install activestorage -v 6.0.4.7
gem install activestorage -v 7.0.2.3
gem install activestorage -v 6.1.4.7
After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.
Affected Packages (4)
| Package | Ecosystem | Affected | Fixed In |
|---|---|---|---|
| activestorage | rubygems | 5.2.0, 5.2.1, 5.2.1.1, 5.2.1.rc1 (+17 more) | 5.2.6.3 |
| activestorage | rubygems | 6.0.0, 6.0.1, 6.0.1.rc1, 6.0.2 (+20 more) | 6.0.4.7 |
| activestorage | rubygems | 7.0.0, 7.0.1, 7.0.2, 7.0.2.1 (+1 more) | 7.0.2.3 |
| activestorage | rubygems | 6.1.0, 6.1.1, 6.1.2, 6.1.2.1 (+10 more) | 6.1.4.7 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-94Code InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-21831ADVISORY
- https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546eWEB
- https://github.com/advisories/GHSA-w749-p3v6-hccqADVISORY
- https://github.com/rails/railsPACKAGE
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2022-21831.ymlWEB
- https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatIWEB
- https://lists.debian.org/debian-lts-announce/2022/09/msg00002.htmlWEB
- https://rubysec.com/advisories/CVE-2022-21831WEB
- https://security.netapp.com/advisory/ntap-20221118-0001WEB
- https://www.debian.org/security/2023/dsa-5372WEB
Frequently Asked Questions
- What is CVE-2022-21831?
- Possible code injection vulnerability in Rails / Active Storage This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2022-21831?
- CVE-2022-21831 affects activestorage. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-21831 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation is straightforward and causes maximum impact. Patch immediately.
Also Known As
Related CVEs
- CVE-2026-33195HIGH
Rails Active Storage has possible Path Traversal in DiskService
- CVE-2020-8162HIGH
Circumvention of file size limits in ActiveStorage
- CVE-2026-33202MEDIUM
Rails Active Storage has possible glob injection in its DiskService
- CVE-2018-16477MEDIUM
Exposure of Sensitive Information to an Unauthorized Actor in activestorage
- CVE-2024-26144MEDIUM
Rails has possible Sensitive Session Information Leak in Active Storage
- CVE-2026-33173MEDIUM
Rails Active Storage has possible content type bypass via metadata in direct uploads
- CVE-2026-33174MEDIUM
Rails Active Storage has a possible DoS vulnerability when in proxy mode via Range requests
- CVE-2026-33658LOW
Rails Active Storage has a possible DoS vulnerability in proxy mode via multi-range requests
Check if you're affected
Scan your dependencies to see if this vulnerability affects your projects.
Scan Your Dependencies