{"id":"GHSA-v924-7rp8-4mxh","kind":"vulnerability","aliases":["GHSA-v924-7rp8-4mxh"],"related":[],"title":"Possible arbitrary file read and remote code execution in Active Storage video previews, analysis and image processing","description":"### Impact\r\n`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.\r\n\r\n### Details\r\nThe 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.\r\n\r\n### Affected applications\r\nAn application is affected if it meets all of these requirements:\r\n- Accepts uploads from untrusted users.\r\n- Analyzes video or audio attachments (which Active Storage does on attach by default), generates video previews, or processes images with ImageMagick.\r\n\r\nThe 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.\r\n\r\n### Mitigation\r\n- Upgrade to a fixed version of `activestorage`.\r\n\r\n### Expire and change secrets\r\nUpgrading 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.\r\n\r\n### Workarounds\r\nApplications 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.\r\n\r\n### Releases\r\nThe fixed releases are available at the normal locations.\r\n\r\nPatches for those who cannot upgrade at once:\r\n- 8.1: https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch\r\n- 8.0: https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch\r\n\r\n### Versions affected\r\n- activestorage < 8.0.5.2\r\n- activestorage >= 8.1, < 8.1.4.1\r\n\r\n### Credit\r\nThis issue was responsibly reported by HackerOne researcher [pirikara](https://hackerone.com/pirikara).","summary":"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.","severity":"high","cvss":8.8,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"activestorage","fixed":["8.1.4.1"],"affected":">= 8.1, < 8.1.4.1","ecosystem":"rubygems"},{"name":"activestorage","fixed":["8.0.5.2"],"affected":"< 8.0.5.2","ecosystem":"rubygems"}],"ecosystems":["rubygems"],"tags":["activestorage","cwe-646","package","rails","ruby","self-hosted"],"not_affected_if":["default-ffmpeg-without-avisynth","no-untrusted-uploads","no-video-or-image-processing"],"how_to_check":"- Run `bundle exec rails -v` or check `Gemfile.lock` for the `activestorage` version.\n- Check whether `config.active_storage.analyzers` or `config.active_storage.previewers` still include `VideoAnalyzer`, `AudioAnalyzer` or `VideoPreviewer`.\n- Check whether the host runs an FFmpeg built with `--enable-avisynth` (`ffmpeg -buildconf`) with AviSynthPlus installed.","fix":"- `activestorage` 8.1.x: move to `8.1.4.1`\n- `activestorage` 8.0.x: move to `8.0.5.2`","status":"open","published_at":"2026-11-04T03:02:13+00:00","first_seen_at":"2026-11-09T22:53:28+00:00","triaged_at":"2026-11-09T22:54:10+00:00","updated_at":"2026-11-09T22:54:10+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-11-09T22:54:10Z","model":"claude-haiku-5-5","output":{"fix":"- `activestorage` 8.1.x: move to `8.1.4.1`\n- `activestorage` 8.0.x: move to `8.0.5.2`","reach":"internet","title":"Rails Active Storage: uploaded filenames pick decoders, enabling file read and code execution","impact":"high","summary":"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.","audience":"businesses","category":"package","nicknames":[],"who_cares":["rails","activestorage","self-hosted","ruby"],"confidence":0.85,"fix_status":"available","needs_auth":"no","worst_case":"Application files are read, or code runs in the FFmpeg process.","analyst_note":"","how_to_check":"- Run `bundle exec rails -v` or check `Gemfile.lock` for the `activestorage` version.\n- Check whether `config.active_storage.analyzers` or `config.active_storage.previewers` still include `VideoAnalyzer`, `AudioAnalyzer` or `VideoPreviewer`.\n- Check whether the host runs an FFmpeg built with `--enable-avisynth` (`ffmpeg -buildconf`) with AviSynthPlus installed.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-untrusted-uploads","no-video-or-image-processing","default-ffmpeg-without-avisynth"],"who_is_affected":"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.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000994,"input_tokens":5971,"output_tokens":794,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-646':32B '/pirikara).':610C '/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch':586C '/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch':590C '4mxh':22A,27A '7rp8':21A,26A '8.0':587C '8.0.5.2':594C '8.1':583C,596C '8.1.4.1':597C 'accept':323C 'activ':10A,39B,304C,334C,471C,489C,501C,520C 'activestorag':30B,91C,415C,530C,536C,540C,593C,595C 'activestorage':28A,29A 'addit':352C 'affect':310C,315C,592C 'alreadi':431C 'also':206C 'analysi':14A 'analyz':328C,537C,541C 'applic':81B,192C,311C,313C,434C,448C,514C 'arbitrari':2A 'attach':332C,338C 'attack':62B,147C,204C,351C,555C 'audio':331C 'audioanalyz':116C,542C 'av':176C 'avail':570C 'avisynth':75B,169C,180C,350C,360C,407C,438C,550C,554C 'avisynth-en':74B 'avisynthplus':363C 'base':459C,487C 'blob':92C,96C,250C 'build':384C 'built':167C,356C,548C 'cannot':516C,579C 'carri':102C 'chang':309C,418C,454C,484C 'changelog':306C 'check':272C 'choos':55B,149C,160C 'close':421C,552C 'code':7A,85B,212C 'coder':221C 'common':372C 'config.active_storage.analyzers':544C 'config.active_storage.previewers':534C 'config/credentials.yml.enc':466C 'content':138C,155C,253C,289C,302C 'control':64B 'cooki':496C 'copi':274C 'correct':277C 'could':186C 'credenti':474C,476C 'credit':598C 'cwe':31B 'databas':475C 'declar':153C 'decod':57B,70B,131C,162C,394C,562C 'decrypt':469C 'default':340C 'deleg':223C 'describ':307C 'detail':231C 'detect':297C 'disagre':286C 'disclos':187C 'disclosur':429C 'distribut':374C,385C 'enabl':76B,359C,380C 'enable-avisynth':358C 'encrypt':495C 'evalu':183C 'everi':443C 'everyth':464C 'execut':8A,213C 'expir':416C,488C 'expos':452C,508C 'extens':49B,60B,104C,135C,177C,226C,238C,247C,261C,285C,402C,560C 'extension-select':559C 'extern':295C 'fail':269C 'fallback':512C 'ffmpeg':52B,77B,88B,117C,166C,216C,355C,369C,396C,524C,547C 'ffmpeg.org':391C 'ffprobe':51B,114C 'file':3A,82B,134C,173C,188C,282C,527C 'filenam':66B,108C,151C 'fix':233C,412C,567C 'form':264C 'format':144C,299C 'generat':341C 'ghsa':19A,24A 'ghsa-v924-7rp8-4mxh':18A,23A 'github.com':585C,589C 'github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch':584C 'github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch':588C 'global':498C 'gpl':383C 'hackeron':605C 'hackerone.com':609C 'hackerone.com/pirikara).':608C 'hand':110C 'homebrew':376C 'host':38B,367C 'id':499C 'identifi':141C 'imag':16A,197C,346C 'imageanalyz':121C 'imagemagick':54B,120C,218C,348C,398C,564C 'impact':90C 'includ':456C 'invalid':492C 'issu':600C 'keep':235C 'key':458C,462C,486C 'lead':209C 'librari':202C 'linux':373C,389C 'load':199C 'locat':574C 'magick':124C 'map':245C 'marcel':244C 'master':461C 'may':403C 'meet':318C,436C 'mini':123C 'mitig':408C 'name':45B,101C,256C,278C 'nativ':201C 'normal':573C 'occur':432C 'open':93C 'otherwis':262C 'packag':33B,377C 'parti':482C 'patch':575C 'path':112C 'pick':68B 'pirikara':607C 'possibl':1A,208C 'potenti':451C 'preview':13A,196C,343C,531C 'process':17A,89B,163C,193C,217C,281C,293C,345C,449C 'processor':126C 'rack':267C 'rail':34B 'reachabl':405C 'read':4A,80B 'readabl':189C,445C 'record':252C 'releas':234C,565C,568C 'remot':6A,211C 'remov':529C 'report':603C 'requir':322C,353C,439C 'research':606C 'respons':602C 'retain':506C 'rubi':35B 'run':84B,523C,545C 'runtim':364C 'script':181C 'secret':419C,444C,457C,485C,509C 'select':129C,219C,399C,561C 'self':37B 'self-host':36B 'servic':473C,483C 'session':490C 'sign':493C,497C 'still':292C 'stop':519C 'storag':11A,40B,305C,335C,472C,502C,521C 'support':170C,551C 'tempfil':44B,99C,241C,258C,268C,279C 'third':481C 'third-parti':480C 'token':478C 'tool':128C,296C 'treat':171C,442C 'type':156C,254C,290C 'undo':427C 'untrust':326C 'upgrad':409C,420C,517C,580C 'upload':42B,48B,107C,159C,207C,237C,265C,284C,324C,526C 'upstream':368C 'url':503C 'user':327C 'v924':20A,25A 'variant':125C 'version':413C,591C 'video':12A,329C,342C 'videoanalyz':115C,538C 'videopreview':118C,532C 'vulner':423C 'way':230C 'whose':100C,266C,283C 'window':387C 'without':406C,549C 'workaround':513C 'write':41B,94C","nicknames":[],"mitigations":[],"who_affected":"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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["activestorage"],"ptokens":["activestorage"],"labels":["activestorage","cwe646","high","package","rails","ruby","rubygems","selfhosted"],"campaign_type":null,"search_a":"'4mxh':22A,27A '7rp8':21A,26A 'activ':10A 'activestorage':28A,29A 'analysi':14A 'arbitrari':2A 'code':7A 'execut':8A 'file':3A 'ghsa':19A,24A 'ghsa-v924-7rp8-4mxh':18A,23A 'imag':16A 'possibl':1A 'preview':13A 'process':17A 'read':4A 'remot':6A 'storag':11A 'v924':20A,25A 'video':12A","search_b":"'-646':32B 'activ':39B 'activestorag':30B 'applic':81B 'attack':62B 'avisynth':75B 'avisynth-en':74B 'choos':55B 'code':85B 'control':64B 'cwe':31B 'decod':57B,70B 'enabl':76B 'extens':49B,60B 'ffmpeg':52B,77B,88B 'ffprobe':51B 'file':82B 'filenam':66B 'host':38B 'imagemagick':54B 'name':45B 'packag':33B 'pick':68B 'process':89B 'rail':34B 'read':80B 'rubi':35B 'run':84B 'self':37B 'self-host':36B 'storag':40B 'tempfil':44B 'upload':42B,48B 'write':41B","search_c":"'/pirikara).':610C '/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch':586C '/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch':590C '8.0':587C '8.0.5.2':594C '8.1':583C,596C '8.1.4.1':597C 'accept':323C 'activ':304C,334C,471C,489C,501C,520C 'activestorag':91C,415C,530C,536C,540C,593C,595C 'addit':352C 'affect':310C,315C,592C 'alreadi':431C 'also':206C 'analyz':328C,537C,541C 'applic':192C,311C,313C,434C,448C,514C 'attach':332C,338C 'attack':147C,204C,351C,555C 'audio':331C 'audioanalyz':116C,542C 'av':176C 'avail':570C 'avisynth':169C,180C,350C,360C,407C,438C,550C,554C 'avisynthplus':363C 'base':459C,487C 'blob':92C,96C,250C 'build':384C 'built':167C,356C,548C 'cannot':516C,579C 'carri':102C 'chang':309C,418C,454C,484C 'changelog':306C 'check':272C 'choos':149C,160C 'close':421C,552C 'code':212C 'coder':221C 'common':372C 'config.active_storage.analyzers':544C 'config.active_storage.previewers':534C 'config/credentials.yml.enc':466C 'content':138C,155C,253C,289C,302C 'cooki':496C 'copi':274C 'correct':277C 'could':186C 'credenti':474C,476C 'credit':598C 'databas':475C 'declar':153C 'decod':131C,162C,394C,562C 'decrypt':469C 'default':340C 'deleg':223C 'describ':307C 'detail':231C 'detect':297C 'disagre':286C 'disclos':187C 'disclosur':429C 'distribut':374C,385C 'enabl':359C,380C 'enable-avisynth':358C 'encrypt':495C 'evalu':183C 'everi':443C 'everyth':464C 'execut':213C 'expir':416C,488C 'expos':452C,508C 'extens':104C,135C,177C,226C,238C,247C,261C,285C,402C,560C 'extension-select':559C 'extern':295C 'fail':269C 'fallback':512C 'ffmpeg':117C,166C,216C,355C,369C,396C,524C,547C 'ffmpeg.org':391C 'ffprobe':114C 'file':134C,173C,188C,282C,527C 'filenam':108C,151C 'fix':233C,412C,567C 'form':264C 'format':144C,299C 'generat':341C 'github.com':585C,589C 'github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch':584C 'github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch':588C 'global':498C 'gpl':383C 'hackeron':605C 'hackerone.com':609C 'hackerone.com/pirikara).':608C 'hand':110C 'homebrew':376C 'host':367C 'id':499C 'identifi':141C 'imag':197C,346C 'imageanalyz':121C 'imagemagick':120C,218C,348C,398C,564C 'impact':90C 'includ':456C 'invalid':492C 'issu':600C 'keep':235C 'key':458C,462C,486C 'lead':209C 'librari':202C 'linux':373C,389C 'load':199C 'locat':574C 'magick':124C 'map':245C 'marcel':244C 'master':461C 'may':403C 'meet':318C,436C 'mini':123C 'mitig':408C 'name':101C,256C,278C 'nativ':201C 'normal':573C 'occur':432C 'open':93C 'otherwis':262C 'packag':377C 'parti':482C 'patch':575C 'path':112C 'pirikara':607C 'possibl':208C 'potenti':451C 'preview':196C,343C,531C 'process':163C,193C,217C,281C,293C,345C,449C 'processor':126C 'rack':267C 'reachabl':405C 'readabl':189C,445C 'record':252C 'releas':234C,565C,568C 'remot':211C 'remov':529C 'report':603C 'requir':322C,353C,439C 'research':606C 'respons':602C 'retain':506C 'run':523C,545C 'runtim':364C 'script':181C 'secret':419C,444C,457C,485C,509C 'select':129C,219C,399C,561C 'servic':473C,483C 'session':490C 'sign':493C,497C 'still':292C 'stop':519C 'storag':305C,335C,472C,502C,521C 'support':170C,551C 'tempfil':99C,241C,258C,268C,279C 'third':481C 'third-parti':480C 'token':478C 'tool':128C,296C 'treat':171C,442C 'type':156C,254C,290C 'undo':427C 'untrust':326C 'upgrad':409C,420C,517C,580C 'upload':107C,159C,207C,237C,265C,284C,324C,526C 'upstream':368C 'url':503C 'user':327C 'variant':125C 'version':413C,591C 'video':329C,342C 'videoanalyz':115C,538C 'videopreview':118C,532C 'vulner':423C 'way':230C 'whose':100C,266C,283C 'window':387C 'without':406C,549C 'workaround':513C 'write':94C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-04T00:00:00+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa-repo","external_id":"GHSA-v924-7rp8-4mxh","url":"https://github.com/rails/rails/security/advisories/GHSA-v924-7rp8-4mxh","severity":"high","published_at":"2026-11-04T03:02:13+00:00","modified_at":"2026-11-04T04:45:18+00:00","first_seen_at":"2026-11-09T22:53:28+00:00","fetched_at":"2026-11-09T22:53:28+00:00","note":null}],"documents":[{"id":67032,"url":"https://thehackernews.com/2026/11/critical-rails-flaw-lets-attackers.html","title":"Critical Rails Flaw Lets Attackers Write Server Files via Crafted ImageMagick Uploads","kind":"blog","source":"analyst","publisher":null,"text":"Rails Active Storage GHSA-f3w6-w445-fwh9 (CVSS 9.8, no CVE): unauthenticated arbitrary file write via ImageMagick analyzer on attach (SVG reaching MSL coder); arbitrary file read with Disk service (secret_key_base, credentials). Affected: Active Storage < 8.0.5.2 and 8.1 < 8.1.4.1 using :mini_magick (default for load_defaults <= 6.1), without an ImageMagick policy blocking the coders (Debian/Ubuntu policies do not), accepting untrusted uploads. Fixed 8.1.4.1 / 8.0.5.2 (needs mini_magick >= 5.1); <8.0 unsupported. Also GHSA-v924-7rp8-4mxh (8.8) FFmpeg/ImageMagick decoder chosen by filename extension. Reported by RyotaK (GMO Flatt Security). Exploitation not stated.","published_at":"2026-11-04T00:00:00+00:00","relation":"mentions","confidence":null,"note":null},{"id":110663,"url":"https://github.com/rails/rails/security/advisories/GHSA-v924-7rp8-4mxh","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa-repo","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}