First published: Tue Mar 08 2022(Updated: )
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.
Credit: support@hackerone.com support@hackerone.com
Affected Software | Affected Version | How to fix |
---|---|---|
rubygems/activestorage | >=7.0.0<=7.0.2.2 | 7.0.2.3 |
rubygems/activestorage | >=6.1.0<=6.1.4.6 | 6.1.4.7 |
rubygems/activestorage | >=6.0.0<=6.0.4.6 | 6.0.4.7 |
rubygems/activestorage | >=5.2.0<=5.2.6.2 | 5.2.6.3 |
>=5.2.0<5.2.6.3 | ||
>=6.0.0<6.0.4.7 | ||
>=6.1.0<6.1.4.7 | ||
>=7.0.0<7.0.2.3 | ||
=10.0 | ||
Rubyonrails Active Storage | >=5.2.0<5.2.6.3 | |
Rubyonrails Active Storage | >=6.0.0<6.0.4.7 | |
Rubyonrails Active Storage | >=6.1.0<6.1.4.7 | |
Rubyonrails Active Storage | >=7.0.0<7.0.2.3 | |
Debian Debian Linux | =10.0 | |
debian/rails | <=2:5.2.2.1+dfsg-1<=2:6.1.4.6+dfsg-2<=2:6.0.3.7+dfsg-2<=2:5.2.2.1+dfsg-1+deb10u3 | |
debian/rails | <=2:5.2.2.1+dfsg-1+deb10u3 | 2:5.2.2.1+dfsg-1+deb10u5 2:6.0.3.7+dfsg-2+deb11u2 2:6.1.7.3+dfsg-1 2:6.1.7.3+dfsg-2 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
The severity of CVE-2022-21831 is critical with a CVSS score of 9.8.
Versions 5.2.0 to 5.2.6.2, 6.0.0 to 6.0.4.6, 6.1.0 to 6.1.4.6, and 7.0.0 to 7.0.2.2 of Rails are affected by CVE-2022-21831.
To mitigate the code injection vulnerability in Active Storage, update to versions 5.2.6.3, 6.0.4.7, 6.1.4.7, or 7.0.2.3 of Rails.
Implementing a strict allow-list on accepted transformation methods or arguments can serve as a workaround for CVE-2022-21831.
More information about CVE-2022-21831 can be found at the following references: [NVD](https://nvd.nist.gov/vuln/detail/CVE-2022-21831), [Github Commit](https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e), [Google Groups](https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI).