CVE-2026-126186
Description
A flaw was found in Active Storage. When handling uploaded media attachments, Active Storage retains user-supplied file extensions on temporary files passed to external processing tools such as FFmpeg and ImageMagick. A remote attacker can exploit this issue by uploading a crafted file with a specific extension and content type, forcing the external utilities to select unintended decoders. Under certain system configurations, this flaw can result in arbitrary file disclosure or remote code execution.
Statement
This vulnerability is rated as having an Important severity because it allows remote authenticated users to potentially achieve arbitrary file disclosure or code execution within the application context without requiring privileged access. Applications are exposed when they accept uploads from untrusted sources and utilize Active Storage to analyze or preview media files using external binaries such as FFmpeg or ImageMagick. While full remote code execution via AviSynth scripts is constrained on standard enterprise Linux distributions that omit AviSynth build options, alternative decoder delegation paths may still expose sensitive local application data.
Mitigation
Disable automated media analysis and preview generation for untrusted uploaded attachments in the application configuration.
In the Rails application configuration (for example, in `config/application.rb` or the relevant environment file under `config/environments/`), remove the FFmpeg previewer and analyzers:
ruby
config.active_storage.previewers.delete(ActiveStorage::Previewer::VideoPreviewer)
config.active_storage.analyzers.delete(ActiveStorage::Analyzer::VideoAnalyzer)
config.active_storage.analyzers.delete(ActiveStorage::Analyzer::AudioAnalyzer)
Additionally, ensure that image processing does not delegate to unsafe ImageMagick decoders, or switch the variant processor to `:vips`.
Caveats: Disabling these analyzers and previewers stops automatic metadata extraction (such as audio and video duration) and prevents preview thumbnail generation for uploaded multimedia files. Application services must be restarted for these configuration changes to take effect.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 8.8 | N/A | 8.8 |
| Attack Vector | Network | N/A | Network |
| Attack Complexity | Low | N/A | Low |
| Privileges Required | Low | N/A | Low |
| User Interaction | None | N/A | None |
| Scope | Unchanged | N/A | Unchanged |
| Confidentiality | High | N/A | High |
| Integrity Impact | High | N/A | High |
| Availability Impact | High | N/A | High |
Vector
Red Hat: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Understanding the Weakness (CWE)
Integrity,Confidentiality,Availability
Technical Impact: Execute Unauthorized Code or Commands
Execution of arbitrary code in the context of usage of the resources with dangerous names.
Confidentiality,Availability
Technical Impact: Read Application Data; DoS: Crash, Exit, or Restart
Crash of the consumer code of these resources resulting in information leakage or denial of service.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.