GHSA-v924-7rp8-4mxh: Active Storage: Possible arbitrary file read and remote code execution in video previews, analysis and image processing

Published Nov 10, 2026
·
Updated

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 :minimagick 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 secretkeybase, 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 secretkeybase 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.activestorage.previewers, and ActiveStorage::Analyzer::VideoAnalyzer and ActiveStorage::Analyzer::AudioAnalyzer from config.activestorage.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.

Affected Software

2 affected componentsFixes available
rubygems/activestorage<8.0.5.2
8.0.5.2
rubygems/activestorage>=8.1.0.beta1<8.1.4.1
8.1.4.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/activestorage to a version that resolves this vulnerability.

    Fixed in 8.0.5.2
  2. Upgrade

    Upgrade rubygems/activestorage to a version that resolves this vulnerability.

    Fixed in 8.1.4.1
  3. Upgrade

    Upgrade activestorage to a version that resolves this vulnerability.

    Fixed in 8.0.5.2
  4. Upgrade

    Upgrade activestorage to a version that resolves this vulnerability.

    Fixed in 8.1.4.1
  5. Configuration

    For applications that cannot upgrade, remove the video previewer and video/audio analyzers from the corresponding Active Storage configuration lists to prevent FFmpeg from processing uploaded files.

    Active Storage config.active_storage.previewers and config.active_storage.analyzers = Exclude ActiveStorage::Previewer::VideoPreviewer, ActiveStorage::Analyzer::VideoAnalyzer, and ActiveStorage::Analyzer::AudioAnalyzer
  6. Compensating control

    Run FFmpeg built without AviSynth support; this closes the AviSynth attack but does not address extension-selected ImageMagick decoders.

  7. Operational

    Change every secret readable by the application process if the AviSynth condition applies, including secret_key_base, the master key, secrets decrypted from config/credentials.yml.enc, Active Storage service credentials, database credentials, and third-party service tokens. Do not retain an exposed secret as a fallback.

Event History

Nov 10, 2026
Advisory Published
via GitHub·09:38 PM
Data Sourced
via GitHub·09:38 PM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203