|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2025-24293 (activestorage): Active Storage allowed transformation methods |
| 4 | + that were potentially unsafe' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- activestorage |
| 8 | +advisory: |
| 9 | + gem: activestorage |
| 10 | + cve: 2025-24293 |
| 11 | + ghsa: r4mg-4433-c7g3 |
| 12 | + url: https://github.com/rails/rails/security/advisories/GHSA-r4mg-4433-c7g3 |
| 13 | + title: Active Storage allowed transformation methods that were potentially unsafe |
| 14 | + date: 2025-08-14 |
| 15 | + description: | |
| 16 | + Active Storage attempts to prevent the use of potentially unsafe |
| 17 | + image transformation methods and parameters by default. |
| 18 | + The default allowed list contains three methods allowing for the |
| 19 | + circumvention of the safe defaults which enables potential command |
| 20 | + injection vulnerabilities in cases where arbitrary user supplied |
| 21 | + input is accepted as valid transformation methods or parameters. |
| 22 | +
|
| 23 | + This has been assigned the CVE identifier CVE-2025-24293. |
| 24 | +
|
| 25 | + Versions Affected: >= 5.2.0 |
| 26 | + Not affected: < 5.2.0 |
| 27 | + Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1 |
| 28 | +
|
| 29 | + ## Impact |
| 30 | +
|
| 31 | + This vulnerability impacts applications that use Active Storage |
| 32 | + with the image_processing processing gem in addition to |
| 33 | + mini_magick as the image processor. |
| 34 | +
|
| 35 | + Vulnerable code will look something similar to this: |
| 36 | +
|
| 37 | + ``` |
| 38 | + <= image_tag blob.variant(params[:t] => params[:v]) > |
| 39 | + ``` |
| 40 | +
|
| 41 | + Where the transformation method or its arguments are untrusted |
| 42 | + arbitrary input. |
| 43 | +
|
| 44 | + All users running an affected release should either upgrade or |
| 45 | + use one of the workarounds immediately. |
| 46 | +
|
| 47 | + ## Releases |
| 48 | +
|
| 49 | + The fixed releases are available at the normal locations. |
| 50 | +
|
| 51 | + ## Workarounds |
| 52 | +
|
| 53 | + Consuming user supplied input for image transformation methods |
| 54 | + or their parameters is unsupported behavior and should be |
| 55 | + considered dangerous. |
| 56 | +
|
| 57 | + Strict validation of user supplied methods and parameters should |
| 58 | + be performed as well as having a strong |
| 59 | + [ImageMagick security policy](https://imagemagick.org/script/security-policy.php) deployed. |
| 60 | +
|
| 61 | + ## Credits |
| 62 | +
|
| 63 | + Thank you [lio346](https://hackerone.com/lio346) for reporting this! |
| 64 | + unaffected_versions: |
| 65 | + - "< 5.20" |
| 66 | + patched_versions: |
| 67 | + - "~> 7.1.5.2" |
| 68 | + - "~> 7.2.2.2" |
| 69 | + - ">= 8.0.2.1" |
| 70 | + related: |
| 71 | + url: |
| 72 | + - https://github.com/rails/rails/security/advisories/GHSA-r4mg-4433-c7g3 |
| 73 | + - https://github.com/rails/rails/commit/1b1adf6ee6ca0f3104fcfce79360b2ec1e06a354 |
| 74 | + - https://github.com/rails/rails/commit/2d612735ac0d9712fdfffaf80afa627e7295f6ce |
| 75 | + - https://github.com/rails/rails/commit/fb8f3a18c3d97524c0efc29150d1e5f3162fbb13 |
| 76 | + - https://github.com/advisories/GHSA-r4mg-4433-c7g3 |
| 77 | +--- |
0 commit comments