Skip to content

Possible code injection vulnerability in Rails / Active Storage

Critical severity GitHub Reviewed Published Mar 8, 2022 to the GitHub Advisory Database • Updated Mar 22, 2023

Package

bundler activestorage (RubyGems)

Affected versions

>= 5.2.0, <= 5.2.6.2
>= 6.0.0, <= 6.0.4.6
>= 6.1.0, <= 6.1.4.6
>= 7.0.0, <= 7.0.2.2

Patched versions

5.2.6.3
6.0.4.7
6.1.4.7
7.0.2.3

Description

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.

References

Published to the GitHub Advisory Database Mar 8, 2022
Reviewed Mar 8, 2022
Published by the National Vulnerability Database May 26, 2022
Last updated Mar 22, 2023

Severity

Critical
9.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2022-21831

GHSA ID

GHSA-w749-p3v6-hccq

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.