Ruby on Rails Active Storage: Arbitrary file read and remote code execution (CVE-2026-126186)
Ruby on Rails Active Storage is vulnerable to arbitrary file read and potential remote code execution because it uses user-supplied file extensions to determine how external processing tools like FFmpeg and ImageMagick handle uploaded attachments.
CVE search metadata
CVE search record: CVE-2026-126186. Severity: high. CVSS: 8.8. KEV: no. Product: Active Storage (< 8.0.5.2, >= 8.1.0.beta1 < 8.1.4.1). Brief: Ruby on Rails Active Storage: Arbitrary file read and remote code execution (CVE-2026-126186). Brief link: https://feed.craftedsignal.io/briefs/2026-11-active-storage-rce/
Triage facts
Revision 1- Applicability
- Active Storage (< 8.0.5.2, >= 8.1.0.beta1 < 8.1.4.1)
- Evidence
- Unknown
- Severity
- High
- Action
- Immediate escalation
- Sources
- 1 public source
- Freshness
- Revision 1Nov 11, 07:27 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A1Likely
Active Storage is vulnerable to arbitrary file read and potential remote code execution due to the insecure handling of temporary files. When processing video or audio attachments, Active Storage creates temporary files that retain the extension provided by the user. External processing tools (FFmpeg, ImageMagick) use these extensions to determine the decoder or delegate if the content itself is ambiguous. An attacker can craft a file with a specific extension (e.g., .avs for AviSynth) to force processing engines to treat the file as a script or library, leading to local file disclosure or RCE within the context of the processing tool.
Attack Chain
- An attacker identifies an application using Active Storage that accepts file uploads and performs automatic attachment analysis or preview generation.
- The attacker crafts a malicious file (e.g., an AviSynth script) and assigns it an extension corresponding to a target processing delegate (e.g., .avs).
- The attacker uploads the file to the application.
- Active Storage writes the file to a temporary location while preserving the attacker-provided extension.
- The application triggers background processing (FFmpeg or ImageMagick) on the file.
- The processing tool detects the file extension and interprets the content according to the associated decoder or library (e.g., executing the AviSynth script).
- The process either discloses local sensitive files (if the script reads them) or executes arbitrary native code if a malicious library is loaded.
Impact
Successful exploitation may result in the unauthorized disclosure of sensitive files readable by the application process (e.g., database credentials, master keys) or remote code execution within the FFmpeg or ImageMagick processing context.
Recommendation
- Upgrade
activestorageto version 8.0.5.2 or 8.1.4.1 immediately. - If an upgrade is not immediately possible, remove
ActiveStorage::Previewer::VideoPreviewerand theVideoAnalyzer/AudioAnalyzerfrom theconfig.active_storageconfiguration to disable affected processing. - If the application environment included FFmpeg built with
--enable-avisynth, consider all application secrets (includingsecret_key_base, database credentials, and service tokens) as potentially compromised; rotate these secrets immediately after patching.
Immediate actions
Upgrade activestorage to 8.0.5.2 or 8.1.4.1
Rotate all application secrets including secret_key_base
Threat Hunt
Search application logs for unexpected file extensions being passed to external processing binaries like ffmpeg, ffprobe, or convert
Data: Application audit logs, Process execution logs
Mitigations
Patch Active Storage to 8.1.4.1 or later
CVE-2026-126186