criticalZero-Day

Ruby on Rails Active Storage Unauthenticated Arbitrary File Read via Image Uploads

First seen Jul 30, 2026 · Updated Jul 30, 2026 · CVSS 9.5

railsruby-on-railsactive-storagefile-disclosuresecrets-exposureweb-applicationagent-relevant

A critical vulnerability in Ruby on Rails' Active Storage component (CVE-2026-66066, CVSS 9.5) allows unauthenticated attackers to read arbitrary files from application servers by uploading crafted images. Exposed data can include environment variables and secrets such as secret_key_base, the Rails master key, database passwords, and cloud storage credentials, potentially enabling full application compromise.

Technical Analysis

CVE-2026-66066 stems from improper handling of image processing/upload logic in Rails Active Storage, allowing path traversal or file inclusion that lets an unauthenticated attacker retrieve arbitrary server-side files without authentication. Successful exploitation can leak the Rails process environment, secret_key_base, Rails master key, database credentials, and cloud storage keys, which attackers could use to forge session cookies, decrypt encrypted cookies/credentials, or pivot into connected cloud storage backends (e.g., S3). The attack vector is a crafted image upload processed via Active Storage's variant/transformation pipeline, making any public-facing upload endpoint using this feature exploitable. Given the severity and unauthenticated nature, this flaw is highly likely to be weaponized quickly once technical details or a PoC circulate. Organizations running AI agent frameworks or RAG pipelines built on Rails backends (e.g., for document ingestion, file uploads, or orchestration APIs) are at risk of credential and API key theft through this flaw, which could then be leveraged to compromise connected LLM provider keys, vector database credentials, or downstream agent tool integrations.

Affected Systems

Ruby on Rails applications using Active Storage for image uploads and processing (specific vulnerable version ranges as specified in the official Rails security advisory); applications exposing public image upload endpoints without additional access controls

Indicators of Compromise

  • No specific IOCs (hashes, IPs, domains) published at this time; monitor for anomalous image upload requests with path traversal patterns (e.g., '../', encoded slashes) targeting Active Storage endpoints

Remediation Steps

  1. 1

    Patch Rails Immediately

    Upgrade to the patched Ruby on Rails version referenced in the official security advisory for CVE-2026-66066 without delay.

  2. 2

    Rotate Secrets

    Rotate secret_key_base, Rails master key, database credentials, and any cloud storage access keys potentially exposed prior to patching.

  3. 3

    Restrict Upload Endpoints

    Add authentication, rate limiting, and WAF rules on public-facing file/image upload endpoints as a defense-in-depth measure.

  4. 4

    Audit Logs

    Review server and application logs for unusual file access patterns or unauthorized read attempts on sensitive files (e.g., config/master.key, .env).

  5. 5

    Review Agent Integrations

    For AI agent or RAG systems built on Rails, audit any exposed API keys or credentials used by agent tools and rotate them if the Rails backend was exposed.

CVE / Advisory IDs

CVE-2026-66066

Industries Most Exposed

TechnologySaaSE-commerceFinancial ServicesHealthcareAny industry using Ruby on Rails web applications

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.