Skip to content

GHSA-r4mg-4433-c7g3 CVE-2025-24293

Active Storage allowed transformation methods that were potentially unsafe

High RubyGems
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
5.58%
Chance of exploitation in the next 30 days. Higher than 92.88% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')
Fix
8.0.2.1
Upgrade activestorage to this version or later

Description

Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.

The default allowed list contains three methods allowing 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.

This has been assigned the CVE identifier CVE-2025-24293.

Versions Affected: >= 5.2.0 Not affected: < 5.2.0 Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1

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.

Releases

The fixed releases are available at the normal locations.

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 deployed.

Credits

Thank you lio346 from Unit 515 of OPSWAT for reporting this!

Affected versions

RubyGems

PackageVulnerableFixed in
activestorage
>= 8.0, < 8.0.2.1
8.0.2.1
activestorage
>= 7.2, < 7.2.2.2
7.2.2.2
activestorage
>= 5.2.0, < 7.1.5.2
7.1.5.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

activestorage RubyGems → 8.0.2.1

bundler
bundle update activestorage # Gemfile: gem "activestorage", ">= 8.0.2.1"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
High
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 8.1

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Weakness

CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.

How to prevent it
  • Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
  • Implementation: If possible, ensure that all external commands called from the program are statically created.
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
  • System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-xr9x-r78c-5hrm
Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing
Critical Also affects activestorage
GHSA-p9fm-f462-ggrg
Rails Active Storage has a possible DoS vulnerability in proxy mode via multi-range requests
Medium Also affects activestorage
GHSA-73f9-jhhh-hr5m
Rails Active Storage has possible glob injection in its DiskService
Critical Also affects activestorage
GHSA-9xrj-h377-fr87
Rails Active Storage has possible Path Traversal in DiskService
Critical Also affects activestorage
GHSA-r46p-8f7g-vvvg
Rails Active Storage has a possible DoS vulnerability when in proxy mode via Range requests
High Also affects activestorage
GHSA-qcfx-2mfw-w4cg
Rails Active Storage has possible content type bypass via metadata in direct uploads
Medium Also affects activestorage
GHSA-8h22-8cf7-hq6g
Rails has possible Sensitive Session Information Leak in Active Storage
Medium Also affects activestorage
GHSA-w749-p3v6-hccq
Possible code injection vulnerability in Rails / Active Storage
Critical Also affects activestorage
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor