# CVE-2025-24293: Active Storage allowed transformation methods that were potentially unsafe

> Attackers can execute arbitrary commands via unsafe image transformation parameters in Rails Active Storage when using mini_magick.

- **Severity:** Critical 9.2 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Jan 2026
- **Updated:** 15 Jul 2026
- **Also known as:** DEBIAN-CVE-2025-24293, GHSA-r4mg-4433-c7g3, UBUNTU-CVE-2025-24293

## What is CVE-2025-24293?

CVE-2025-24293 is a critical command injection vulnerability in Rails activestorage, published on 30 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

# 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!

Weakness: CWE-88 (Improper Neutralization of Argument Delimiters in a Command), CWE-94 (Improper Control of Generation of Code), CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2025-24293?

6 open source packages ship an affected version, including activestorage.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `activestorage` | RubyGems | From 5.2.0 | 7.1.5.2 |
| `activestorage` | RubyGems | From 5.2.0 | 7.1.5.2 |
| `activestorage` | RubyGems | From 7.2 | 7.2.2.2 |
| `activestorage` | RubyGems | From 7.2 | 7.2.2.2 |
| `activestorage` | RubyGems | From 8.0 | 8.0.2.1 |
| `activestorage` | RubyGems | From 8.0 | 8.0.2.1 |

## How do I fix CVE-2025-24293?

Upgrade activestorage to a fixed version for your release line: 7.1.5.2, 7.2.2.2 or 8.0.2.1.

## Is CVE-2025-24293 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24293 exists.

Public exploit code:

- Known security vulnerabilities detected. CVE-2022-21831 Critical severity CVE-2025-24293 Critical severity CVE-2020-8162 High severity CVE-2024-26144 Moderate severity (github_poc): https://github.com/usutani/study-turbolinks-link
- Ruby on Rails Active Storage Vips Arbitrary File Read and Remote Code Execution (metasploit)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-24293 and fix it if it is affected.

What it is: CVE-2025-24293 is a critical command injection vulnerability in Rails activestorage, published on 30 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24293 exists.

Affected packages and fixed versions:
- activestorage (RubyGems): affected from 5.2.0; fixed in 7.1.5.2
- activestorage (RubyGems): affected from 5.2.0; fixed in 7.1.5.2
- activestorage (RubyGems): affected from 7.2; fixed in 7.2.2.2
- activestorage (RubyGems): affected from 7.2; fixed in 7.2.2.2
- activestorage (RubyGems): affected from 8.0; fixed in 8.0.2.1
- activestorage (RubyGems): affected from 8.0; fixed in 8.0.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-24293/ (Markdown: https://insights.sbomify.com/CVE-2025-24293/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-24293
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-24293
- OSV: https://osv.dev/vulnerability/CVE-2025-24293

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-24293/
Summaries are generated and may contain mistakes; the official description above is the record.
