`ActiveStorage::Blob#open` writes a blob to a tempfile using the extension of the uploaded filename. This path is then passed to `ffprobe` (used by `VideoAnalyzer` and `AudioAnalyzer`), `ffmpeg` (used by `VideoPreviewer`), and ImageMagick (used by `ImageAnalyzer` via the `:mini magick` variant processor). Because these tools may select a decoder based on the file extension when the content format is not self-identifying, an attacker can control which decoder processes the upload by manipulating the filename and declared content type.
For instance, if FFmpeg is built with AviSynth support, a file with a `.avs` extension is treated as an AviSynth script. This can lead to the disclosure of files readable by the application process or the loading of a malicious native library, potentially resulting in remote code execution within the FFmpeg process. ImageMagick similarly selects coders and delegates based on the extension.