Skip to main content

Rails Active Storage CVE-2026-126186

| EUVDEUVD-2026-122941 HIGH
Reliance on File Name or Extension of Externally-Supplied File (CWE-646)
2026-11-10 https://github.com/rails/rails GHSA-v924-7rp8-4mxh
8.8
CVSS 3.1 · Vendor: https://github.com/rails/rails
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload file with attacker-chosen name/content-type
  2. Delivery
    Blob#open writes tempfile keeping malicious extension
  3. Exploit
    External tool selects decoder from extension
  4. Execution
    FFmpeg evaluates .avs AviSynth script
  5. Persist
    Read app-readable files or load uploaded native library
  6. Impact
    Disclose secrets via preview or execute code in FFmpeg

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File extension validation
Exploitation Conditions

The application must (1) accept file uploads from untrusted users and (2) analyze video/audio attachments (Active Storage does this on attach by default), generate video previews, or process images with ImageMagick (:mini_magick). The attacker must control both the uploaded filename extension and the declared content type so the extension steers the external tool's decoder. Full RCE additionally requires the host's FFmpeg to be built with --enable-avisynth and have the AviSynthPlus runtime installed - NOT the case for upstream FFmpeg, standard Linux distro packages, or Homebrew, but true for ffmpeg.org GPL Windows/Linux builds. Limiting factors: the AviSynth RCE path is gated on that non-default FFmpeg build; broader file-read via ImageMagick/FFmpeg extension-selected coders/delegates does not require AviSynth. The supplied vector's PR:L suggests authenticated upload, but the actual gate is 'untrusted uploads,' which may be unauthenticated depending on the app.

Impact

Signals are moderately concerning but conditional. The input CVSS is 8.8 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), implying network-reachable, low-complexity, low-privilege exploitation with full CIA impact. However, the vendor advisory makes clear the worst outcome (RCE via FFmpeg's AviSynth demuxer on a .avs file) requires the host to run an FFmpeg built with --enable-avisynth plus the AviSynthPlus runtime - a non-default build that upstream FFmpeg, common Linux distro packages, and Homebrew do NOT ship, though ffmpeg.org's GPL Windows/Linux builds do. That config dependency is not reflected in the AC:L/I:H/A:H of the supplied vector, so the raw score overstates the realistic RCE footprint for most deployments. The more broadly reachable impact is arbitrary file read / SSRF-style disclosure through extension-selected decoders and delegates in ImageMagick and FFmpeg, which does not need AviSynth. There is no EPSS score, no CISA KEV listing, and no public exploit code provided in the input - only a responsible HackerOne disclosure by researcher pirikara. Exploitation status: no public exploit identified at time of analysis. The vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a patch-promptly posture rather than drop-everything. Conflicting/uncertain signals to note explicitly: the vector's PR:L implies authentication, but the advisory's actual precondition is 'accepts uploads from untrusted users,' which in many real apps is unauthenticated - verify against your app's upload auth; and the vector's AC:L/full-impact does not capture that full RCE is gated on a non-default FFmpeg build.

Exploit ScenarioDerived

An attacker who can upload an attachment to a Rails app that analyzes audio/video or processes images picks the filename and declared content type so the tempfile Active Storage hands to ffprobe/ffmpeg/ImageMagick carries an attacker-chosen extension (e.g. .avs), steering tool decoder selection. On a host whose FFmpeg was built with AviSynth support, a .avs 'script' is evaluated, reading files the app process can read (disclosed via the preview image) or loading an attacker-uploaded native library for code execution in the FFmpeg process; without AviSynth, extension-selected ImageMagick/FFmpeg coders and delegates can still be abused for file read. No public exploit code was provided, though the patch's own test fixtures demonstrate the Import("/etc/passwd") technique; with AV:N/AC:L in the supplied vector the upload step itself is low-effort, but reaching RCE depends on the non-default decoder being present.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 10, 2026

Active Storage in Rails lets an untrusted uploader who controls both the filename extension and declared content type steer ffprobe, ffmpeg or ImageMagick to an attacker-chosen decoder, which can disclose files readable by the application process through previews and, under a non-default AviSynth-enabled FFmpeg build, possibly execute code in the FFmpeg process. Affected applications accept untrusted uploads and analyze audio/video attachments (default on attach), generate video previews, or process images with ImageMagick; the assessed vector is AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L, and the AviSynth RCE path additionally requires an FFmpeg built with --enable-avisynth plus AviSynthPlus on the host. No public exploit identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade activestorage to 8.0.5.2 or 8.1.4.1. For branches that cannot upgrade immediately, the vendor provides patch commits for 8.1 at https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch and for 8.0 at https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch. Applications that cannot upgrade or patch can stop Active Storage from running FFmpeg on uploaded files by removing ActiveStorage::Previewer::VideoPreviewer from config.active_storage.previewers and removing ActiveStorage::Analyzer::VideoAnalyzer and ActiveStorage::Analyzer::AudioAnalyzer from config.active_storage.analyzers; running an FFmpeg built without AviSynth closes the AviSynth attack but not the extension-selected decoders of ImageMagick. Because the flaw can disclose files readable by the application process, an application that meets the AviSynth requirement should treat secret_key_base, the master key and everything config/credentials.yml.enc decrypts, Active Storage service credentials, database credentials, and third-party service tokens as potentially exposed and rotate them; changing secret_key_base expires active sessions and invalidates signed and encrypted cookies, signed global IDs, and Active Storage URLs, and an exposed secret should not be retained as a fallback. Advisory: https://github.com/rails/rails/security/advisories/GHSA-v924-7rp8-4mxh.

Affected VersionsENISA

rails 8.1, < 8.1.4.1
rails < 8.0.5.2

Affected Packages

rubygems activestorage fix: 8.0.5.2, 8.1.4.1
euvd rails fix: 8.0.5.2, 8.1.4.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in rubygems, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CWE-646 (Reliance on File Name or Extension of Externally-Supplied File) describes the root cause: ActiveStorage::Blob#open created a tempfile named from the uploaded filename, including its extension, and passed that path to external tools. VideoAnalyzer and AudioAnalyzer invoke ffprobe, VideoPreviewer invokes ffmpeg, and ImageAnalyzer plus the :mini_magick variant processor invoke ImageMagick. When the content does not identify its own format, these tools select a decoder from the extension, so an uploader who controls the filename and declared content type can influence decoder selection. FFmpeg built with --enable-avisynth treats a .avs file as an AviSynth script; the independent assessment confirms this path requires the AviSynthPlus runtime and is not present in upstream FFmpeg or common Linux distribution and Homebrew packages, but is present in ffmpeg.org GPL Windows/Linux builds. The same extension-selection mechanism can reach other FFmpeg and ImageMagick decoders and delegates without AviSynth, so file-read exposure is broader than the RCE path. The supplied CPE is pkg:rubygems/activestorage. The fixed releases keep the uploaded extension only when Marcel maps that extension to the blob's recorded content type and otherwise name the tempfile with no extension; a form upload whose Rack tempfile fails the same check is copied to a correctly named tempfile before processing.

Know when Ruby On Rails gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/rails/rails) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 6.4 MEDIUM

Network-reachable via upload (AV:N) with low privilege (PR:L), but full RCE depends on a non-default AviSynth-enabled FFmpeg (AC:H); reliable impact is file disclosure (C:H), so I/A set low.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L
4.0 AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N
Red Hat 8.8 HIGH

Primary rating from Vendor (https://github.com/rails/rails).

CVSS VectorVendor: https://github.com/rails/rails

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Impact

ActiveStorage::Blob#open writes a blob to a tempfile whose name carries the extension of the uploaded filename, and hands that path to ffprobe (VideoAnalyzer, AudioAnalyzer), ffmpeg (VideoPreviewer) and ImageMagick (ImageAnalyzer, the :mini_magick variant processor). These tools select a decoder from the file extension when the content does not identify its own format, so an attacker who chooses the filename and declares the content type of an upload chooses which decoder processes it. An FFmpeg built with AviSynth support treats a file with the .avs extension as an AviSynth script and evaluates it, which could disclose files readable by the application process through the preview image, or load a native library the attacker has also uploaded, possibly leading to remote code execution in the FFmpeg process. ImageMagick selects its coders and delegates from the extension in the same way.

Details

The fixed releases keep the uploaded extension on the tempfile only when Marcel maps that extension to the blob's recorded content type, and name the tempfile with no extension otherwise. A form upload whose Rack tempfile fails the same check is copied to a correctly named tempfile before processing. Files whose uploaded extension disagrees with their content type are still processed; the external tool detects their format from the content. The Active Storage CHANGELOG describes the change.

Affected applications

An application is affected if it meets all of these requirements:

  • Accepts uploads from untrusted users.
  • Analyzes video or audio attachments (which Active Storage does on attach by default), generates video previews, or processes images with ImageMagick.

The AviSynth attack additionally requires an FFmpeg built with --enable-avisynth and the AviSynthPlus runtime on the host. Upstream FFmpeg and the common Linux distribution and Homebrew packages do not enable it; the GPL builds distributed for Windows and Linux from ffmpeg.org do. Other decoders that FFmpeg or ImageMagick select from the extension may be reachable without AviSynth.

Mitigation

  • Upgrade to a fixed version of activestorage.

Expire and change secrets

Upgrading closes the vulnerability but does not undo a disclosure that already occurred. An application that meets the AviSynth requirement above should treat every secret readable by the application process as potentially exposed and change it, including secret_key_base, the master key and everything in config/credentials.yml.enc that it decrypts, the Active Storage service credentials, database credentials, and tokens for third-party services. Changing secret_key_base expires active sessions and invalidates signed and encrypted cookies, signed global IDs and Active Storage URLs. Do not retain an exposed secret as a fallback.

Workarounds

Applications that cannot upgrade can stop Active Storage from running FFmpeg on uploaded files by removing ActiveStorage::Previewer::VideoPreviewer from config.active_storage.previewers, and ActiveStorage::Analyzer::VideoAnalyzer and ActiveStorage::Analyzer::AudioAnalyzer from config.active_storage.analyzers. Running an FFmpeg built without AviSynth support closes the AviSynth attack but not the extension-selected decoders of ImageMagick.

Releases

The fixed releases are available at the normal locations.

Patches for those who cannot upgrade at once:

  • 8.1: https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch
  • 8.0: https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch

Versions affected

  • activestorage < 8.0.5.2
  • activestorage >= 8.1, < 8.1.4.1

Credit

This issue was responsibly reported by HackerOne researcher pirikara.

Technical POC Analysis

CWE-646, reliance on file name or extension of an externally supplied file.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

CVE-2026-126186 is a high-severity vulnerability in Active Storage, Rails' built-in file upload and processing component, allowing attackers to manipulate file metadata to coerce media processors into executing attacker-chosen decoders. This could expose sensitive files accessible to the application process; under uncommon FFmpeg configurations, remote code execution is possible. Organizations using Active Storage to handle untrusted uploads (e.g., user avatars, audio/video attachments) must prioritize remediation.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 56% exploitable
Prevalence
High
Active Storage ships with Ruby on Rails, a very widely deployed web framework
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2013-0333 HIGH POC
7.5 Jan 30

lib/active_support/json/backends/yaml.rb in Ruby on Rails 2.3.x before 2.3.16 and 3.0.x before 3.0.20 does not properly

CVE-2013-0156 HIGH POC
7.5 Jan 13

active_support/core_ext/hash/conversions.rb in Ruby on Rails before 2.3.15, 3.0.x before 3.0.19, 3.1.x before 3.1.10, an

CVE-2016-2098 HIGH POC
7.3 Apr 07

Action Pack in Ruby on Rails before 3.2.22.2, 4.x before 4.1.14.2, and 4.2.x before 4.2.5.2 allows remote attackers to e

CVE-2013-6414 MEDIUM POC
5.0 Dec 07

actionpack/lib/action_view/lookup_context.rb in Action View in Ruby on Rails 3.x before 3.2.16 and 4.x before 4.0.2 allo

CVE-2026-122006 CRITICAL POC
9.8 Nov 04

Unauthenticated attackers can write arbitrary files on a Ruby on Rails host and, when Active Storage uses the Disk servi

CVE-2026-109391 CRITICAL POC
9.2 Oct 12

Unauthenticated remote code execution is achievable in Square Squash (all versions through commit e73f280) through a two

CVE-2017-17919 HIGH POC
8.1 Dec 29

SQL injection vulnerability in the 'order' method in Ruby on Rails 5.1.4 and earlier allows remote attackers to execute

CVE-2017-17920 HIGH POC
8.1 Dec 29

SQL injection vulnerability in the 'reorder' method in Ruby on Rails 5.1.4 and earlier allows remote attackers to execut

CVE-2012-6496 HIGH POC
7.5 Jan 04

SQL injection vulnerability in the Active Record component in Ruby on Rails before 3.0.18, 3.1.x before 3.1.9, and 3.2.x

CVE-2012-2695 HIGH POC
7.5 Jun 22

The Active Record component in Ruby on Rails before 3.0.14, 3.1.x before 3.1.6, and 3.2.x before 3.2.6 does not properly

CVE-2013-0277 CRITICAL
10.0 Feb 13

ActiveRecord in Ruby on Rails before 2.3.17 and 3.x before 3.1.0 allows remote attackers to cause a denial of service or

CVE-2026-94462 HIGH POC
7.1 Sep 22

Authenticated store customers can seize other shoppers' guest carts in Spree Commerce by calling PATCH /api/v3/store/car

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy