Possible code injection vulnerability in Rails / Active Storage
Published 8 Mar 2022 · Updated 13 Mar 2026
Is your project on an affected activestorage?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=5.2.0 <5.2.6.3
- Fixed in
- 5.2.6.3
bundle update --conservative activestorage # Gemfile: '>= 5.2.6.3'- Affected
- >=6.0.0 <6.0.4.7
- Fixed in
- 6.0.4.7
bundle update --conservative activestorage # Gemfile: '>= 6.0.4.7'- Affected
- >=6.1.0 <6.1.4.7
- Fixed in
- 6.1.4.7
bundle update --conservative activestorage # Gemfile: '>= 6.1.4.7'- Affected
- >=7.0.0 <7.0.2.3
- Fixed in
- 7.0.2.3
bundle update --conservative activestorage # Gemfile: '>= 7.0.2.3'Details
The Active Storage module of Rails starting with version 5.2.0 is possibly vulnerable to code injection. This issue was patched in versions 5.2.6.3, 6.0.4.7, 6.1.4.7, and 7.0.2.3. To work around this issue, applications should implement a strict allow-list on accepted transformation methods or arguments. Additionally, a strict ImageMagick security policy will help mitigate this issue.
Is GHSA-w749-p3v6-hccq 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 activestorage, and gives you the command that fixes it.
More advisories for activestorage
- CriticalCVE-2026-122006Active Storage: Possible arbitrary file write and read in image analysis · 12 Nov 2026
- MediumCVE-2026-126084Active Storage: Unsigned Content-Type in GCS direct uploads with cache_control · 12 Nov 2026
- LowCVE-2026-126188Active Storage: Possible local file disclosure in video previews and analysis · 12 Nov 2026
- HighCVE-2026-126186Active Storage: Possible arbitrary file read and remote code execution in video previews, analysis and image processing · 10 Nov 2026
- MediumCVE-2026-126085Active Storage: Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage · 10 Nov 2026
- MediumCVE-2026-126074Active Storage: Possible DoS vulnerability in Active Storage filename handling · 10 Nov 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-21831
- Linkgithub.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e
- Advisorygithub.com/advisories/GHSA-w749-p3v6-hccq
- Packagegithub.com/rails/rails
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2022-21831.yml
- Linkgroups.google.com/g/rubyonrails-security/c/n-p-W1yxatI
- Linklists.debian.org/debian-lts-announce/2022/09/msg00002.html
- Linkrubysec.com/advisories/CVE-2022-21831
- Linksecurity.netapp.com/advisory/ntap-20221118-0001
- Linkwww.debian.org/security/2023/dsa-5372
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.