CVE-2022-21831
Possible code injection vulnerability in Rails / Active Storage
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
CVE-2022-21831- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:M/Au:N/C:P/I:P/A:P - Weakness
- CWE-94
- Updated
- 2026-11-02
CVE List No score
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
CVE-2022-21831- Weakness
- CWE-94
- Updated
- 2026-11-02
EUVDEUVD-2022-1564 No score
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
EUVD-2022-1564- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-w749-p3v6-hccq
9.8
Possible code injection vulnerability in Rails / Active Storage
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.
- Record
GHSA-w749-p3v6-hccq- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSV
9.8
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
CVE-2022-21831- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2022-21831
9.8
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
DEBIAN-CVE-2022-21831- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
Show 6 moreShow less
OSVGHSA-w749-p3v6-hccq
9.8
Possible code injection vulnerability in Rails / Active Storage
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.
- Record
GHSA-w749-p3v6-hccq- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-94
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2022-21831
9.8
A code injection vulnerability exists in the Active Storage >= v5.2.0 that could allow an attacker to execute code via image_processing arguments.
- Record
UBUNTU-CVE-2022-21831- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11903-1 No score
ruby3.1-rubygem-activestorage-7.0-7.0.2.3-1.1 on GA media
These are all security issues fixed in the ruby3.1-rubygem-activestorage-7.0-7.0.2.3-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11903-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:12880-1 No score
ruby3.2-rubygem-activestorage-7.0-7.0.4.3-1.1 on GA media
These are all security issues fixed in the ruby3.2-rubygem-activestorage-7.0-7.0.4.3-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:12880-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:14070-1 No score
ruby3.3-rubygem-activestorage-7.0-7.0.8.4-1.1 on GA media
These are all security issues fixed in the ruby3.3-rubygem-activestorage-7.0-7.0.8.4-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14070-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15113-1 No score
ruby3.4-rubygem-activestorage-7.0-7.0.8.6-1.3 on GA media
These are all security issues fixed in the ruby3.4-rubygem-activestorage-7.0-7.0.8.6-1.3 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15113-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
activestorageRubyGems |
5.2.0 to 5.2.6.2 | 5.2.6.3 |
activestorageRubyGems |
6.0.0 to 6.0.4.6 | 6.0.4.7 |
activestorageRubyGems |
6.1.0 to 6.1.4.6 | 6.1.4.7 |
activestorageRubyGems |
7.0.0 to 7.0.2.2 | 7.0.2.3 |
railsDebian:12 |
before 2:6.1.4.7+dfsg-1 | 2:6.1.4.7+dfsg-1 |
railsDebian:13 |
before 2:6.1.4.7+dfsg-1 | 2:6.1.4.7+dfsg-1 |
railsDebian:14 |
before 2:6.1.4.7+dfsg-1 | 2:6.1.4.7+dfsg-1 |
railsDebian:10 From an advisory covering 4 CVEs |
before 2:5.2.2.1+dfsg-1+deb10u4, plus listed versions 2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1+deb10u12:5.2.2.1+dfsg-1+deb10u22:5.2.2.1+dfsg-1+deb10u3 |
2:5.2.2.1+dfsg-1+deb10u4 |
railsDebian:11 From an advisory covering 10 CVEs |
before 2:6.0.3.7+dfsg-2+deb11u1, plus listed versions 2:6.0.3.7+dfsg-2 |
2:6.0.3.7+dfsg-2+deb11u1 |
activestorageRubyGems |
5.2.0 up to 5.2.6.3, plus listed versions 5.2.15.2.1.15.2.1.rc15.2.25.2.2.1 Show 15 moreShow less5.2.2.rc15.2.35.2.3.rc15.2.45.2.4.15.2.4.25.2.4.35.2.4.45.2.4.55.2.4.65.2.4.rc15.2.55.2.65.2.6.15.2.6.2 |
5.2.6.3 |
Show 15 moreShow less
| Package | Affected | Fixed |
|---|---|---|
activestorageRubyGems |
6.0.0 up to 6.0.4.7, plus listed versions 6.0.16.0.1.rc16.0.26.0.2.16.0.2.2 Show 18 moreShow less6.0.2.rc16.0.2.rc26.0.36.0.3.16.0.3.26.0.3.36.0.3.46.0.3.56.0.3.66.0.3.76.0.3.rc16.0.46.0.4.16.0.4.26.0.4.36.0.4.46.0.4.56.0.4.6 |
6.0.4.7 |
activestorageRubyGems |
6.1.0 up to 6.1.4.7, plus listed versions 6.1.16.1.26.1.2.16.1.36.1.3.1 Show 8 moreShow less6.1.3.26.1.46.1.4.16.1.4.26.1.4.36.1.4.46.1.4.56.1.4.6 |
6.1.4.7 |
activestorageRubyGems |
7.0.0 up to 7.0.2.3, plus listed versions 7.0.17.0.27.0.2.17.0.2.2 |
7.0.2.3 |
railsUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 2:4.1.10-12:4.2.5-12:4.2.5.1-12:4.2.5.2-22:4.2.6-12:4.2.6-1ubuntu0.1~esm12:4.2.6-1ubuntu0.1~esm2 |
None known |
railsUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 2:4.2.9-22:4.2.9-42:4.2.10-0ubuntu42:4.2.10-0ubuntu4+esm12:4.2.10-0ubuntu4+esm2 |
None known |
railsUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 2:5.2.2.1+dfsg-1ubuntu12:5.2.3+dfsg-32:5.2.3+dfsg-3ubuntu0.1~esm1 |
None known |
railsUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 2:6.0.3.7+dfsg-22:6.1.4.1+dfsg-8ubuntu22:6.1.4.1+dfsg-8ubuntu2+esm1 |
None known |
railsUbuntu:24.04:LTS |
All versions, plus listed versions 2:6.1.7.3+dfsg-2build12:6.1.7.3+dfsg-3 |
None known |
railsUbuntu:25.10 |
All versions, plus listed versions 2:6.1.7.3+dfsg-72:7.2.2.1+dfsg-7 |
None known |
railsUbuntu:26.10 |
All versions, plus listed versions 2:7.2.3+dfsg-22:7.2.3.2+dfsg-2 |
None known |
railsUbuntu:26.04:LTS |
All versions, plus listed versions 2:7.2.2.1+dfsg-72:7.2.2.2+dfsg-22:7.2.3+dfsg-2 |
None known |
rubygem-activestorage-7.0openSUSE:Tumbleweed |
before 7.0.2.3-1.1 | 7.0.2.3-1.1 |
ruby3.2-rubygem-activestorage-7.0openSUSE:Tumbleweed |
before 7.0.4.3-1.1 | 7.0.4.3-1.1 |
rubygem-activestorage-7.0openSUSE:Tumbleweed |
before 7.0.8.4-1.1 | 7.0.8.4-1.1 |
rubygem-activestorage-7.0openSUSE:Tumbleweed |
before 7.0.8.6-1.3 | 7.0.8.6-1.3 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | usutani/study-turbolinks-link | 2020-04-05 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| aliases, products | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-21831 is a critical vulnerability (CVSS 9.8) in Rubyonrails Active Storage, published March 8, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 3.10%, the 87th percentile. Fixed in activestorage 5.2.6.3.
References
github.com/advisories/GHSA-w749-p3v6-hccq
lists.debian.org/debian-lts-announce/2022/09/msg00002.html
security.netapp.com/advisory/ntap-20221118-0001
debian.org/security/2023/dsa-5372
nvd.nist.gov/vuln/detail/CVE-2022-21831
github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e
Show 9 moreShow less
groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI
rubysec.com/advisories/CVE-2022-21831
github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2022-21831.yml
security-tracker.debian.org/tracker/CVE-2022-21831
github.com/rails/rails
ubuntu.com/security/CVE-2022-21831
cve.org/CVERecord?id=CVE-2022-21831
suse.com/security/cve/CVE-2022-21831
lists.opensuse.org/archives/list/[email protected]/thread/46EQRIAH3FLDMDVYDHYXRLAPYFUK6NA6