Command injection in Rails activestorage
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-77.
Summary
# Active Storage allowed transformation methods potentially unsafe Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default. The default allowed list contains three methods allow for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters. Impact ------ This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor. Vulnerable code will look something similar to this: ``` <%= image_tag blob.variant(params[:t] => params[:v]) %> ``` Where the transformation method or its arguments are untrusted arbitrary input. All users running an affected release should either upgrade or use one of the workarounds immediately. Workarounds ----------- Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous. Strict validation of user supplied methods and parameters should be performed as well as having a strong [ImageMagick security policy](https://imagemagick.org/script/security-policy.php) deployed. Credits ------- Thank you [lio346](https://hackerone.com/lio346) for reporting this!
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Rails | activestorage | 5.2 and later; 7.0 to before 7.1.5.2; 8.0 to before 7.0.2.1 | 7.1.5.2, 7.0.2.1 | Patch available | CNA |
| — | activestorage (RubyGems) | 8.0 to before 8.0.2.1 | 8.0.2.1 | Patch available | GHSA-r4mg-4433-c7g3 |
| — | activestorage (RubyGems) | 7.2 to before 7.2.2.2 | 7.2.2.2 | Patch available | GHSA-r4mg-4433-c7g3 |
| — | activestorage (RubyGems) | 5.2.0 to before 7.1.5.2 | 7.1.5.2 | Patch available | GHSA-r4mg-4433-c7g3 |
- activestorage VendorRails Affected 5.2 and later; 7.0 to before 7.1.5.2; 8.0 to before 7.0.2.1 Fixed in 7.1.5.2, 7.0.2.1 Patch available CNA
- activestorage (RubyGems) Vendor— Affected 8.0 to before 8.0.2.1 Fixed in 8.0.2.1 Patch available GHSA-r4mg-4433-c7g3
- activestorage (RubyGems) Vendor— Affected 7.2 to before 7.2.2.2 Fixed in 7.2.2.2 Patch available GHSA-r4mg-4433-c7g3
- activestorage (RubyGems) Vendor— Affected 5.2.0 to before 7.1.5.2 Fixed in 7.1.5.2 Patch available GHSA-r4mg-4433-c7g3
Remediation
- Fix · CNA activestorage (Rails) Fixed in 7.1.5.2, 7.0.2.1
- Fix · GHSA-r4mg-4433-c7g3 activestorage (RubyGems) Fixed in 8.0.2.1 Advisory →
- Fix · GHSA-r4mg-4433-c7g3 activestorage (RubyGems) Fixed in 7.2.2.2 Advisory →
- Fix · GHSA-r4mg-4433-c7g3 activestorage (RubyGems) Fixed in 7.1.5.2 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
Not affected: 2 products
- Red Hat 3scale API Management Platform 2
- Red Hat Satellite 6
Timeline
- 2026-10-02 Threatist record created from CVE-2025-24293
- 2026-10-03 Alias added: GHSA-r4mg-4433-c7g3
References
Advisory 2
Other 6
- https://github.com/rails/rails/security/advisories/GHSA-r4mg-4433-c7g3
- https://github.com/rails/rails/commit/1b1adf6ee6ca0f3104fcfce79360b2ec1e06a354
- https://github.com/rails/rails/commit/2d612735ac0d9712fdfffaf80afa627e7295f6ce
- https://github.com/rails/rails/commit/fb8f3a18c3d97524c0efc29150d1e5f3162fbb13
- https://github.com/rails/rails
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activestorage/CVE-2025-24293.yml
More Rails vulnerabilities
- TI-2014-00124 Directory traversal vulnerability in actionpack/lib/abstract_controller/base.rb in the… KEVCVSS 3.1HIGH 7.5
- TI-2019-03828 Path traversal in Rails https://github.com/rails/rails KEVCVSS 3.1HIGH 7.5
- TI-2016-00672 Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.1, 4.0.x… KEVCVSS 3.1HIGH 7.5
- TI-2019-03830 Command injection in Rails https://github.com/rails/rails CVSS 3.1CRITICAL 9.8
- TI-2026-47043 Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing CVSS 4.0CRITICAL 9.5
- TI-2020-06581 Code injection in https://github.com/rails/rails CVSS 3.1HIGH 8.8
Sources
- CVE-2025-24293 · CVE Program
- CVE-2025-24293 · NVD
- FIRST EPSS
- GHSA-r4mg-4433-c7g3 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-24293 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences