Every CVE Search/ Get API key

CVE-2022-21831

Possible code injection vulnerability in Rails / Active Storage

9.8 CriticalPublic exploitFix available

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

3.10%Up 0.5 points since May 27, 2022
90%50%10%1%

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 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
6.8 MediumAV: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
activestorage
RubyGems
5.2.0 to 5.2.6.2
5.2.6.3
activestorage
RubyGems
6.0.0 to 6.0.4.6
6.0.4.7
activestorage
RubyGems
6.1.0 to 6.1.4.6
6.1.4.7
activestorage
RubyGems
7.0.0 to 7.0.2.2
7.0.2.3
rails
Debian:12
before 2:6.1.4.7+dfsg-1
2:6.1.4.7+dfsg-1
rails
Debian:13
before 2:6.1.4.7+dfsg-1
2:6.1.4.7+dfsg-1
rails
Debian:14
before 2:6.1.4.7+dfsg-1
2:6.1.4.7+dfsg-1
rails
Debian: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
rails
Debian: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
activestorage
RubyGems
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 less
5.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
Affected packages
PackageAffectedFixed
activestorage
RubyGems
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 less
6.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
activestorage
RubyGems
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 less
6.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
activestorage
RubyGems
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
rails
Ubuntu: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
rails
Ubuntu: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
rails
Ubuntu: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
rails
Ubuntu: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
rails
Ubuntu:24.04:LTS
All versions, plus listed versions
2:6.1.7.3+dfsg-2build12:6.1.7.3+dfsg-3
None known
rails
Ubuntu:25.10
All versions, plus listed versions
2:6.1.7.3+dfsg-72:7.2.2.1+dfsg-7
None known
rails
Ubuntu:26.10
All versions, plus listed versions
2:7.2.3+dfsg-22:7.2.3.2+dfsg-2
None known
rails
Ubuntu: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.0
openSUSE:Tumbleweed
before 7.0.2.3-1.1
7.0.2.3-1.1
ruby3.2-rubygem-activestorage-7.0
openSUSE:Tumbleweed
before 7.0.4.3-1.1
7.0.4.3-1.1
rubygem-activestorage-7.0
openSUSE:Tumbleweed
before 7.0.8.4-1.1
7.0.8.4-1.1
rubygem-activestorage-7.0
openSUSE:Tumbleweed
before 7.0.8.6-1.3
7.0.8.6-1.3

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubusutani/study-turbolinks-link2020-04-05

History

History
RecordedChangedSources
affected, factsOSV
aliases, productsEUVD
first indexedCVE 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

Show 9 moreShow less
MoveEnter Open