{
  "schemaVersion": "guard-threat-campaign/v1",
  "id": "HGTC-2026-0372EC42",
  "slug": "rails-active-storage-upload-file-read-write-ghsa-f3w6-w445-fwh9",
  "title": "Rails Active Storage: a crafted upload can write and read files on the server through ImageMagick and FFmpeg (GHSA-f3w6-w445-fwh9, GHSA-v924-7rp8-4mxh)",
  "aliases": [
    "GHSA-f3w6-w445-fwh9",
    "GHSA-v924-7rp8-4mxh",
    "Rails Active Storage ImageMagick file write",
    "Rails 8.1.4.1 security release",
    "Rails 8.0.5.2 security release",
    "activestorage arbitrary file read"
  ],
  "summary": "On 2026-11-04 (UTC) Rails released 8.0.5.2 and 8.1.4.1, fixing 21 security issues. GHSA-f3w6-w445-fwh9 (Critical, CVSS 9.8): Active Storage ran ImageMagick analysis on attach with no coder restrictions, so an unauthenticated attacker who can upload a crafted file may write arbitrary files on the server and, with the Disk service, read files readable by the app process such as secret_key_base. It affects apps using variant_processor :mini_magick (default on load_defaults 6.1 or earlier) under an ImageMagick policy that does not deny the coders involved (Debian and Ubuntu policies do not). GHSA-v924-7rp8-4mxh (High, CVSS 8.8): Active Storage kept the uploaded extension on tempfiles passed to ffprobe, ffmpeg and ImageMagick, letting the uploader pick the decoder; an FFmpeg built with AviSynth evaluates .avs files as scripts, which could disclose files through a preview image or load an uploaded native library. Both affect activestorage < 8.0.5.2 and >= 8.1, < 8.1.4.1. No CVE IDs, not on CISA KEV, and no known exploitation at publication.",
  "status": "published",
  "severity": "critical",
  "confidence": "high",
  "uncertainty": "Rails says one ImageMagick attack chain was reported and does not assume it is the only one. No CVE IDs had been assigned at publication. Exposure depends on per-app configuration (variant processor, analyzers, storage service, host ImageMagick policy and FFmpeg build), which HOL cannot see.",
  "firstObservedAt": "2026-11-04T03:02:13.000Z",
  "lastObservedAt": "2026-11-04T03:25:23.000Z",
  "publishedAt": "2026-11-04T03:34:28.163Z",
  "reviewedAt": "2026-11-04T03:34:21.017Z",
  "expiresAt": "2026-11-04T03:25:23.000Z",
  "reviewer": "HOL Guard Security Publishing",
  "sources": [
    {
      "id": "ghsa-imagemagick",
      "label": "GHSA-f3w6-w445-fwh9: Possible arbitrary file write and read in Active Storage image analysis",
      "url": "https://github.com/rails/rails/security/advisories/GHSA-f3w6-w445-fwh9",
      "sourceType": "vendor_advisory",
      "observedAt": "2026-11-04T03:09:06Z"
    },
    {
      "id": "ghsa-video",
      "label": "GHSA-v924-7rp8-4mxh: Possible arbitrary file read and remote code execution in Active Storage video previews, analysis and image processing",
      "url": "https://github.com/rails/rails/security/advisories/GHSA-v924-7rp8-4mxh",
      "sourceType": "vendor_advisory",
      "observedAt": "2026-11-04T03:02:13Z"
    },
    {
      "id": "rails-release",
      "label": "Rails Versions 8.0.5.2 and 8.1.4.1 have been released",
      "url": "https://rubyonrails.org/2026/11/4/Rails-8.0.5.2-and-8.1.4.1-have-been-released",
      "sourceType": "vendor_advisory",
      "observedAt": "2026-11-04T02:30:00Z"
    },
    {
      "id": "imagemagick-policy",
      "label": "ImageMagick security policy",
      "url": "https://imagemagick.org/security-policy/",
      "sourceType": "other_primary",
      "observedAt": "2026-11-04T03:25:23.000Z"
    },
    {
      "id": "hol-blog",
      "label": "HOL: A crafted photo upload can read and write files on Rails servers",
      "url": "https://hol.org/blog/rails-active-storage-upload-file-read-write-ghsa-f3w6-w445-fwh9",
      "sourceType": "other_primary",
      "observedAt": "2026-11-04T03:25:23Z"
    }
  ],
  "artifacts": [
    {
      "id": "activestorage-gem",
      "artifactClass": "package",
      "ecosystem": "rubygems",
      "name": "activestorage",
      "version": "< 8.0.5.2, >= 8.1.0 < 8.1.4.1",
      "defanged": false
    },
    {
      "id": "mini-magick-gem",
      "artifactClass": "package",
      "ecosystem": "rubygems",
      "name": "mini_magick",
      "version": "< 5.1 (incompatible with the fix when variant_processor is :mini_magick)",
      "defanged": false
    }
  ],
  "indicators": [],
  "timeline": [
    {
      "id": "rails-8-0-5-2-released",
      "occurredAt": "2026-11-04T02:31:54.000Z",
      "eventType": "vendor_action",
      "summary": "Rails 8.0.5.2 released with Active Storage security fixes.",
      "sourceIds": [
        "rails-release"
      ]
    },
    {
      "id": "rails-8-1-4-1-released",
      "occurredAt": "2026-11-04T02:46:00.000Z",
      "eventType": "vendor_action",
      "summary": "Rails 8.1.4.1 released with Active Storage security fixes.",
      "sourceIds": [
        "rails-release"
      ]
    },
    {
      "id": "vendor-advisory-video-published",
      "occurredAt": "2026-11-04T03:02:13.000Z",
      "eventType": "disclosure",
      "summary": "Rails publishes GHSA-v924-7rp8-4mxh (High, CVSS 8.8), arbitrary file read and possible code execution in Active Storage video previews, analysis and image processing.",
      "sourceIds": [
        "ghsa-video"
      ]
    },
    {
      "id": "vendor-advisory-imagemagick-published",
      "occurredAt": "2026-11-04T03:09:06.000Z",
      "eventType": "disclosure",
      "summary": "Rails publishes GHSA-f3w6-w445-fwh9 (Critical, CVSS 9.8), arbitrary file write and read in Active Storage image analysis.",
      "sourceIds": [
        "ghsa-imagemagick"
      ]
    },
    {
      "id": "hol-blog-published",
      "occurredAt": "2026-11-04T03:25:23.000Z",
      "eventType": "other",
      "summary": "HOL Guard publishes an operator write-up with config checks, the mini_magick 5.1 boot trap, secret rotation guidance and Rails 7.2 workarounds.",
      "sourceIds": [
        "hol-blog"
      ]
    }
  ],
  "coverage": [
    {
      "assertionId": "guard-not-app-runtime",
      "relationship": "not_covered",
      "limitation": "HOL Guard reviews AI coding agent actions before they run. It does not patch Rails apps or filter uploads; the fix is upgrading activestorage and rotating exposed secrets."
    }
  ],
  "policies": [],
  "limitations": [
    "Apps that never accept uploads from untrusted users are not affected by either advisory.",
    "The critical ImageMagick issue does not apply to apps using :vips (the default for load_defaults 7.0 and later) unless they process images with ImageMagick.",
    "The file read half of GHSA-f3w6-w445-fwh9 requires attachments stored with the Disk service; cloud storage narrows it to file write.",
    "The AviSynth code execution path in GHSA-v924-7rp8-4mxh needs an FFmpeg built with --enable-avisynth plus the AviSynthPlus runtime; upstream, common distribution and Homebrew FFmpeg builds do not enable it.",
    "Hosts whose ImageMagick policy already denies MSL, the Ghostscript coders and the gs delegate are not exposed to the reported coder chain."
  ],
  "correctionHref": "/guard/security/campaigns/rails-active-storage-upload-file-read-write-ghsa-f3w6-w445-fwh9/corrections"
}
