Add Ruby on Rails Active Storage Vips RCE module for CVE-2026-66066 - #21733
Open
jburgess-r7 wants to merge 9 commits into
Open
Add Ruby on Rails Active Storage Vips RCE module for CVE-2026-66066#21733jburgess-r7 wants to merge 9 commits into
jburgess-r7 wants to merge 9 commits into
Conversation
Crypto-Cat
force-pushed
the
rails-activestorage-vips-rce
branch
from
July 31, 2026 19:29
9710288 to
3e5c874
Compare
jburgess-r7
marked this pull request as draft
August 6, 2026 10:04
…MSF conventions + best practices
jburgess-r7
marked this pull request as ready for review
August 6, 2026 15:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
exploit/multi/http/rails_activestorage_vips_rcefor CVE-2026-66066 / GHSA-xr9x-r78c-5hrm.The module exploits the Active Storage / libvips untrusted-loader issue by creating a crafted direct-upload blob, recovering readable file content through an Active Storage representation response, deriving the Active Storage verifier key from recovered Rails signing material, and forging a signed ImageProcessing variation for command execution.
The module implements the concrete representation-based chain documented by the Rails forensic repository. It accepts a genuine signed Active Storage variation key directly through
VARIATION_KEY, can reuse a full representation URL throughREPRESENTATIONURI, or can fall back to extracting or creating a representation through the application workflow when required.The module supports:
/proc/self/environ,/proc/1/environ, local Rails secret files, encrypted credentials, and legacysecrets.ymlpathsexternal/source/exploits/CVE-2026-66066/This change is needed because the public issue affects Active Storage releases before 7.2.3.2 plus the vulnerable Rails 8.0 and 8.1 ranges when the Vips variant processor is in use, and there is currently no Metasploit module covering the full file-read-to-RCE workflow.
Breaking Changes
None
Reviewer Notes
The best starting points are:
modules/exploits/multi/http/rails_activestorage_vips_rce.rbdocumentation/modules/exploit/multi/http/rails_activestorage_vips_rce.mdspec/modules/exploits/multi/http/rails_activestorage_vips_rce_spec.rbThe key implementation detail is that the module does not require a pre-existing full representation URL when the operator already has a genuine signed variation key.
VARIATION_KEYlets the module construct the standard Active Storage representation route itself and avoids application-specific form submission.The module intentionally does not ship the research-only
/proc/self/memverifier-key recovery path or optional MiniMagick / MiniSSL gadget branches. The released exploit path uses the native ImageProcessingsend/spawnandsend/evalprimitives because they are simpler and more reliable.The reporting researchers' final write-up also documents a
MATLAB_emptydimension-encoding read path and aninstance_evalRCE variation. This module intentionally does not implementMATLAB_empty: that path is a narrow metadata/log channel, while the representation-based PNG transport used here returns larger directly verifiable reads and is more suitable for reliable automated secret recovery. The module also keepssend/spawnandsend/evalinstead ofinstance_evalbecause they map directly onto Metasploit command and Ruby targets and do not require an output-file round trip.The target-local payload defaults are intentional. The default Unix target uses
cmd/unix/reverse_bash, the Linux fetch target usescmd/linux/http/x64/meterpreter/reverse_tcp, and the Ruby target usesruby/shell_reverse_tcp, all of which were validated against the lab.Verification Steps
config.active_storage.variant_processor = :vips, for example Rails 8.0.5 withimage_processing1.14.0 and libvips with MAT/HDF5 support.msfconsole.use exploit/multi/http/rails_activestorage_vips_rce.RHOSTS,RPORT,TARGETURI, andLHOST.VARIATION_KEYto a genuine signed Active Storage variation key from any rendered representation, or configureREPRESENTATIONURI.check.The target is vulnerable. Recovered /proc/version ....exploit.sessions -i <session_id> -c id.Test Evidence
Static and unit checks:
Live validation against Rails 8.0.5 with only
VARIATION_KEYsupplied andSUBMITURIset to an invalid path:Live validation against Rails 6.0.6.1 with only
VARIATION_KEYsupplied andSUBMITURIset to an invalid path:Additional live validation completed:
VARIATION_KEY, the legacyREPRESENTATIONURIroute, and the default Unix command payloadVARIATION_KEY, redirect and legacyREPRESENTATIONURIroutes, and the default Unix command payloadVARIATION_KEYREPRESENTATIONURISECRET_KEY_BASEreturning only HTTP 500s from crafted readsSECRET_KEY_BASEreturningDetectedwithout exercising arbitrary file readEnvironment
-Dmatio=enabledtarget/docker/AI Usage Disclosure
AI-assisted tools were used during implementation and review, including OpenAI Codex and Anthropic Claude. They were used for code generation, documentation drafting, review, and test iteration. All exploit behavior and verification claims above were manually validated against controlled lab targets.