ACTIVESTORAGE · GHSA-v924-7rp8-4mxh · Package
FIX → 8.1.4.1 +1
Active Storage writes uploads to tempfiles named with the uploaded extension, and ffprobe, ffmpeg and ImageMagick choose a decoder from that extension. An attacker who controls the filename can pick a decoder, and with an AviSynth-enabled FFmpeg this can read application files or run code in the FFmpeg process.
first public Nov 4, 2026 · 1 source
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Applications that accept uploads from untrusted users and either analyze video or audio attachments, generate video previews, or process images with ImageMagick's mini_magick variant are exposed. The AviSynth file-read and code-execution path additionally needs an FFmpeg built with AviSynth support and the AviSynthPlus runtime on the host, which upstream FFmpeg and common Linux and Homebrew packages do not enable, while the GPL Windows and Linux builds from ffmpeg.org do. Apps that do not accept untrusted uploads can skip it.
Not affected if default-ffmpeg-without-avisynth, no-untrusted-uploads, no-video-or-image-processing
Who cares activestorage, rails, ruby, self-hosted
bundle exec rails -v or check Gemfile.lock for the activestorage version.config.active_storage.analyzers or config.active_storage.previewers still include , or .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.
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.
Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
VideoAnalyzerAudioAnalyzerVideoPreviewer--enable-avisynth (ffmpeg -buildconf) with AviSynthPlus installed.Upgrade to 8.1.4.1 +1
activestorage 8.1.x: move to 8.1.4.1activestorage 8.0.x: move to 8.0.5.2An application is affected if it meets all of these requirements:
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.
activestorage.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.
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.
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
This issue was responsibly reported by HackerOne researcher pirikara.