{"id":"MSF-multi--http--rails_activestorage_vips_rce","name":"Ruby on Rails Active Storage Vips Arbitrary File Read and Remote Code Execution","description":"This module exploits CVE-2026-66066 in Ruby on Rails Active Storage when the application uses the Vips variant processor and accepts untrusted image uploads. A crafted MATLAB v7.3/HDF5 image uses external storage to read text files accessible to the Rails worker through a PNG representation response. The module recovers secret_key_base from the process environment, Rails local secrets, encrypted credentials, or the legacy secrets.yml(.enc) files. It then forges a serializer-compatible variation whose ImageProcessing apply step reaches Kernel#spawn with a command payload, or Kernel#eval with a native Ruby payload when the Ruby target is selected. Neither path requires a Marshal object gadget. The Ruby target's initial code execution does not require a Unix shell or a fetch utility on the target. The file-read stage needs a genuine signed Active Storage variation key. It can use VARIATION_KEY directly, reuse a representation URL from the application, or create one through an application upload form. Supplying SECRET_KEY_BASE skips the arbitrary file-read stage and lets the module construct the standard representation route itself. The file-read stage affects Rails 6.0 and 6.1, Rails 7.0 through 7.2.3.1, Rails 8.0.0 through 8.0.5, and Rails 8.1.0 through 8.1.3. It is fixed in Rails 7.2.3.2, 8.0.5.1, and 8.1.3.1. The RCE stage combines an incomplete Vips-side fix for CVE-2025-24293 with ImageProcessing 1.x method dispatch; ImageProcessing 2.x blocks this chain.","cves":["CVE-2026-66066","CVE-2025-24293"],"author":"0xacb, s3np41k1r1t0, castilho, RyotaK, Crypto-Cat","published":"2026-07-29","platform":"Linux,Ruby,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/rails_activestorage_vips_rce.rb","path":"modules/exploits/multi/http/rails_activestorage_vips_rce.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"rails_activestorage_vips_rce.rb","vulnerabilities":[{"id":"CVE-2026-66066","state":"PUBLISHED","title":"Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing","titleSource":"CVE Program","description":"Action Pack is a framework for handling and responding to web requests. In versions prior to 7.2.3.2, 8.0.5.1 and 8.1.3.1, Active Storage does not disable libvips operations marked unsafe for untrusted content, allowing a crafted upload to invoke such an operation. Consuming applications are affected when configured to use libvips and accept image uploads from untrusted users. An unauthenticated attacker may exploit this behavior to read arbitrary files accessible to the Rails process, including environment variables and application secrets. Exposure of credentials such as secret_key_base or external-service tokens may enable remote code execution or lateral movement. This issue has been fixed in versions 7.2.3.2, 8.0.5.1 and 8.1.3.1.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-66066","cvss":{"version":"4.0","baseScore":9.5,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-66066"},"updatedAt":"2026-08-05T13:46:21.375Z","retrievedAt":"2026-11-25T16:13:47.304Z","stale":false,"error":null},{"id":"CVE-2025-24293","state":"PUBLISHED","title":null,"titleSource":null,"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!","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2025-24293","cvss":{"version":"4.0","baseScore":9.2,"severity":"critical","vectorString":"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","source":"hackerone","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-24293"},"updatedAt":"2026-07-15T01:26:46.864Z","retrievedAt":"2026-11-25T16:13:47.298Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--rails_activestorage_vips_rce.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--rails_activestorage_vips_rce","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--rails_activestorage_vips_rce/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--rails_activestorage_vips_rce/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}