HackMyIP
← Back to News
2026-07-29 The Hacker News

Critical Rails Vulnerability CVE-2026-66066 Exposes Server Secrets via Image Uploads

VulnerabilityCloud SecurityAuthentication

Ruby on Rails has shipped emergency patches for a critical Active Storage vulnerability, tracked as CVE-2026-66066 with a CVSS score of 9.5, that enables unauthenticated attackers to read arbitrary files from application servers. The flaw is triggered through crafted image uploads processed by libvips, allowing adversaries to extract the Rails process environment and highly sensitive secrets such as secret_key_base, the Rails master key, database passwords, cloud storage credentials, and API tokens. Researchers warn that any exposed credentials can be leveraged for remote code execution or lateral movement into connected infrastructure, making the flaw as dangerous as a full server compromise. Affected applications are those that use libvips for Active Storage image processing and accept uploads from untrusted users, with Rails selecting Vips under load_defaults 7.0 and later by default.

The vulnerability affects Rails 7.0.0 through 7.2.3.1, Rails 8.0.0 through 8.0.5, and Rails 8.1.0 through 8.1.3, according to research teams Ethiack and GMO Flatt Security. Rails 6.0.0 through 6.1.7.10 releases are vulnerable only when Active Storage is explicitly configured to use Vips, as it was not the default processor in Rails 6. Applications relying on MiniMagick are not exposed through this specific attack path. Operators should upgrade immediately to Rails 7.2.3.2, 8.0.5.1, or 8.1.3.1, and patched installations require libvips 8.13 or later alongside ruby-vips 2.2.1 or later. Because Rails 7.0 and 7.1 are end of life with no fixes available, applications on those branches must migrate to Rails 7.2.3.2 or later to remediate the issue.

The flaw sits at the trust boundary between Active Storage and libvips, where libvips supports loaders, savers, and other operations backed by third-party libraries that are marked "unfuzzed" or "untrusted" because they are unsafe for hostile input. Active Storage did not block these unsafe operations, allowing a crafted upload to invoke one and disclose any file readable by the Rails worker. Crucially, a vulnerable application does not need to expose a dedicated resize or thumbnail endpoint, and the public patch confirms that both the Vips analyzer and transformer passed untrusted attachments to the unsafe operations. Neither research team had published a proof-of-concept exploit as of 17:30 UTC on July 29, 2026, and exact-term searches across GitHub, GitLab, Exploit-DB, and Packet Storm returned no indexed exploit repositories.

Rails emphasized that applying the patch does not invalidate credentials that may already have been stolen, so operators must rotate every secret accessible to the application process, including secret_key_base, the master key, decrypted credentials, and database or cloud access keys. A successful exploit grants an attacker an arbitrary file-read primitive, meaning the blast radius depends entirely on what sensitive material the Rails process can access. Defenders should audit their environments immediately, verify SSL/TLS configurations with an SSL/TLS checker, and run exposed secrets through a password checker to identify any credentials that need urgent rotation. A comprehensive privacy checkup is also recommended to surface any additional exposure that may have been overlooked during incident response.

Source: The Hacker News →

Related Tools

Check whether this kind of story affects you — free, no signup:

Password Checker →Email Breach Check →

Related Guides

Learn the background behind this story:

Password security basics →Two-factor authentication explained →How to create a strong password →