π¨ [security] Update rails 7.0.10 β 8.1.4.1 (major)
π¨ Your current dependencies have known security vulnerabilities π¨
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.
What changed?
β³οΈ rails (7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Rails has possible XSS Vulnerability in Action Controller
Possible XSS Vulnerability in Action Controller
There is a possible XSS vulnerability when using the translation helpers
(translate,t, etc) in Action Controller. This vulnerability has been
assigned the CVE identifier CVE-2024-26143.Versions Affected: >= 7.0.0.
Not affected: < 7.0.0
Fixed Versions: 7.1.3.1, 7.0.8.1Impact
Applications using translation methods like
translate, orton a
controller, with a key ending in "_html", a:defaultkey which contains
untrusted user input, and the resulting string is used in a view, may be
susceptible to an XSS vulnerability.For example, impacted code will look something like this:
class ArticlesController < ApplicationController def show @message = t("message_html", default: untrusted_input) # The `show` template displays the contents of `@message` end endTo reiterate the pre-conditions, applications must:
- Use a translation function from a controller (i.e. not I18n.t, or
tfrom
a view)- Use a key that ends in
_html- Use a default value where the default value is untrusted and unescaped input
- Send the text to the victim (whether that's part of a template, or a
rendercall)All users running an affected release should either upgrade or use one of the
workarounds immediately.Releases
The fixed releases are available at the normal locations.
Workarounds
There are no feasible workarounds for this issue.
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the two supported release series. They are in git-am format and consist of a
single changeset.
- 7-0-translate-xss.patch - Patch for 7.0 series
- 7-1-translate-xss.patch - Patch for 7.1 series
Credits
Thanks to ooooooo_q for the patch and fix!
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
β³οΈ minitest-rails (7.0.1 β 8.1.0) Β· Repo Β· Changelog
βοΈ actioncable (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ actionmailbox (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Action Mailbox: Possible signature replay in Action Mailbox Mailgun ingress
Impact
The Action Mailbox Mailgun ingress authenticates a request with an HMAC of the
timestampandtokenparameters concatenated without a separator, andActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator#recent?rejects only timestamps more than 2 minutes in the past. Because the signature does not fix the boundary between the two values, a captured signed request can be presented with a timestamp far in the future, which the ingress then accepts indefinitely. An attacker who obtains one signed Mailgun webhook request, but not the signing key, could submit arbitrary inbound email that Action Mailbox processes as genuine, possibly leading to forged messages attributed to the sender of the attacker's choosing.Applications that receive inbound email through the Action Mailbox Mailgun ingress are affected.
Details
The fixed releases also reject a Mailgun request whose timestamp is more than 2 minutes ahead of the server's clock, as they already did for one more than 2 minutes behind it. An application whose clock runs more than 2 minutes behind Mailgun's will now reject genuine webhooks and should synchronize its clock.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/c3a295c5c22266e8ec4d0e664e6923a299235e7a.patch
- 8.0: https://github.com/rails/rails/commit/4aa2ec66822bc4eb8b341a0608f1c90a3e371a34.patch
Credit
This issue was responsibly reported by HackerOne researcher davutselcuk.
π¨ Action Mailbox: Possible signature replay in Action Mailbox Mailgun ingress
Impact
The Action Mailbox Mailgun ingress authenticates a request with an HMAC of the
timestampandtokenparameters concatenated without a separator, andActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator#recent?rejects only timestamps more than 2 minutes in the past. Because the signature does not fix the boundary between the two values, a captured signed request can be presented with a timestamp far in the future, which the ingress then accepts indefinitely. An attacker who obtains one signed Mailgun webhook request, but not the signing key, could submit arbitrary inbound email that Action Mailbox processes as genuine, possibly leading to forged messages attributed to the sender of the attacker's choosing.Applications that receive inbound email through the Action Mailbox Mailgun ingress are affected.
Details
The fixed releases also reject a Mailgun request whose timestamp is more than 2 minutes ahead of the server's clock, as they already did for one more than 2 minutes behind it. An application whose clock runs more than 2 minutes behind Mailgun's will now reject genuine webhooks and should synchronize its clock.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/c3a295c5c22266e8ec4d0e664e6923a299235e7a.patch
- 8.0: https://github.com/rails/rails/commit/4aa2ec66822bc4eb8b341a0608f1c90a3e371a34.patch
Credit
This issue was responsibly reported by HackerOne researcher davutselcuk.
π¨ Possible signature replay in Action Mailbox Mailgun ingress
Impact
The Action Mailbox Mailgun ingress authenticates a request with an HMAC of the
timestampandtokenparameters concatenated without a separator, and
ActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator#recent?
rejects only timestamps more than 2 minutes in the past. Because the signature
does not fix the boundary between the two values, a captured signed request
can be presented with a timestamp far in the future, which the ingress then
accepts indefinitely. An attacker who obtains one signed Mailgun webhook
request, but not the signing key, could submit arbitrary inbound email that
Action Mailbox processes as genuine, possibly leading to forged messages
attributed to the sender of the attacker's choosing.Applications that receive inbound email through the Action Mailbox Mailgun
ingress are affected.Details
The fixed releases also reject a Mailgun request whose timestamp is more than
2 minutes ahead of the server's clock, as they already did for one more than 2
minutes behind it. An application whose clock runs more than 2 minutes behind
Mailgun's will now reject genuine webhooks and should synchronize its clock.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/c3a295c5c22266e8ec4d0e664e6923a299235e7a.patch- 8.0:
https://github.com/rails/rails/commit/4aa2ec66822bc4eb8b341a0608f1c90a3e371a34.patchCredit
This issue was responsibly reported by HackerOne researcher
davutselcuk.
π¨ Possible signature replay in Action Mailbox Mailgun ingress
Impact
The Action Mailbox Mailgun ingress authenticates a request with an HMAC of the
timestampandtokenparameters concatenated without a separator, and
ActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator#recent?
rejects only timestamps more than 2 minutes in the past. Because the signature
does not fix the boundary between the two values, a captured signed request
can be presented with a timestamp far in the future, which the ingress then
accepts indefinitely. An attacker who obtains one signed Mailgun webhook
request, but not the signing key, could submit arbitrary inbound email that
Action Mailbox processes as genuine, possibly leading to forged messages
attributed to the sender of the attacker's choosing.Applications that receive inbound email through the Action Mailbox Mailgun
ingress are affected.Details
The fixed releases also reject a Mailgun request whose timestamp is more than
2 minutes ahead of the server's clock, as they already did for one more than 2
minutes behind it. An application whose clock runs more than 2 minutes behind
Mailgun's will now reject genuine webhooks and should synchronize its clock.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/c3a295c5c22266e8ec4d0e664e6923a299235e7a.patch- 8.0:
https://github.com/rails/rails/commit/4aa2ec66822bc4eb8b341a0608f1c90a3e371a34.patchCredit
This issue was responsibly reported by HackerOne researcher
davutselcuk.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ actionmailer (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Possible ReDoS vulnerability in block_format in Action Mailer
There is a possible ReDoS vulnerability in the block_format helper in Action Mailer. This vulnerability has been assigned the CVE identifier CVE-2024-47889.
Impact
Carefully crafted text can cause the block_format helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 requires Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users can avoid calling the
block_formathelper or upgrade to Ruby 3.2Credits
Thanks to yuki_osaki for the report!
π¨ Possible ReDoS vulnerability in block_format in Action Mailer
There is a possible ReDoS vulnerability in the block_format helper in Action Mailer. This vulnerability has been assigned the CVE identifier CVE-2024-47889.
Impact
Carefully crafted text can cause the block_format helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 requires Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users can avoid calling the
block_formathelper or upgrade to Ruby 3.2Credits
Thanks to yuki_osaki for the report!
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ actionpack (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
Impact
ActionController::Parameters#each_keydelegates to the internalActiveSupport::HashWithIndifferentAccessthat holds the request parameters, so when called with a block it returns that hash instead of theParametersinstance. The hash does not respond topermitted?, so Active Model mass assignment (new,assign_attributes,update) accepts it without raisingActiveModel::ForbiddenAttributesError. An application that passes the return value ofeach_keyto mass assignment could allow a remote, unauthenticated attacker to set attributes that the application does not permit, such as an authorization flag.This is an incomplete fix of CVE-2020-8164, which made
each,each_pairandeach_valuereturn theParametersinstance but lefteach_keydelegated.Details
The fixed releases define
Parameters#each_keyto yield each key and return theParametersinstance when given a block, aseach,each_pairandeach_valuedo, and to return anEnumeratorwithout one. Code that used the return value ofeach_keyas a hash now receives theParametersinstance, which mass assignment rejects unless it is permitted.Affected applications
An application is affected if it passes the return value of
ActionController::Parameters#each_key, called with a block, to mass assignment. Rails itself makes no such call.Workarounds
Do not use the return value of
each_key. Call it for its block only, and pass the permittedParametersinstance to mass assignment.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/8ba746e0a786458c281060823f2ccc5c5f6312ac.patch
- 8.0: https://github.com/rails/rails/commit/2fc8838300133931e19eed3ea6cee76a7e83f19c.patch
Versions affected
- actionpack < 8.0.5.2
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher smlee.
π¨ Action Pack: Possible DoS vulnerability in Action Controller Live streaming
Impact
ActionController::Live::Buffer#closepushes its end-of-stream marker onto the response's bounded queue while it holds the buffer's monitor. When the client has stopped reading and the queue is full, the push blocks, andBuffer#abort, which runs when the client disconnects or a write times out, waits indefinitely for the same monitor. Each such response could permanently hold a web server thread and itsActionController::Livethread, possibly resulting in a DoS vulnerability through thread exhaustion.Applications that stream responses with
ActionController::Live, includingsend_stream, are affected. Applications that serve large files through Active Storage proxy mode are exposed to unauthenticated clients.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/ccbfc09690fef05fdd2a9969c917a71b92cc98fc.patch
- 8.0: https://github.com/rails/rails/commit/27ad18ed5900dee28ba20e9c6fc718ff751fa215.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-LDFW5N2T).
π¨ Action Pack: Possible sensitive session information leak in Active Storage proxy mode
Impact
When
ActionDispatch::Cookiesreads a signed or encrypted cookie that was written under a rotated secret (config.action_dispatch.cookies_rotations) or in the format that a:hybridcookie serializer migrates from, it writes the cookie back to the response in the current format, and that write ignoresrequest.session_options[:skip].ActiveStorage::DisableSessionrelies on that option to keep the session cookie off the public, immutable responses of the Active Storage proxy controllers, but those controllers still load the session, so a request carrying an old-format session cookie could receive the rewritten session cookie inSet-Cookieon a cacheable response. A shared cache that stores such a response together with itsSet-Cookieheader could then serve one user's session to later requesters of the same URL, or serve an attacker's session to other users.Applications are affected when they serve Active Storage files through the proxy controllers, have a cookie rotation or a
:hybridserializer migration configured, and run behind a cache that storesSet-Cookieon public responses. This is a path around the fix for CVE-2024-26144.Details
In the fixed releases, a response that skips the session leaves an old-format signed or encrypted cookie unchanged, and the next request that does not skip the session upgrades it. An application that skips the session on every request no longer upgrades its signed or encrypted cookies. Cookies that the application sets explicitly are still written. See the Action Pack CHANGELOG.
Workarounds
Configure caching proxies not to store responses that carry a
Set-Cookieheader, or complete the cookie rotation or serializer migration and remove it from the configuration.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/849a6c30eacbb6ca4722132f43c4333a93188556.patch
- 8.0: https://github.com/rails/rails/commit/0e6cf8faa89caf4c64311d35ca2bc88c1458d4e3.patch
Credit
This issue was responsibly reported by HackerOne researcher flashmyname.
π¨ Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
Impact
ActionController::Parameters#each_keydelegates to the internalActiveSupport::HashWithIndifferentAccessthat holds the request parameters, so when called with a block it returns that hash instead of theParametersinstance. The hash does not respond topermitted?, so Active Model mass assignment (new,assign_attributes,update) accepts it without raisingActiveModel::ForbiddenAttributesError. An application that passes the return value ofeach_keyto mass assignment could allow a remote, unauthenticated attacker to set attributes that the application does not permit, such as an authorization flag.This is an incomplete fix of CVE-2020-8164, which made
each,each_pairandeach_valuereturn theParametersinstance but lefteach_keydelegated.Details
The fixed releases define
Parameters#each_keyto yield each key and return theParametersinstance when given a block, aseach,each_pairandeach_valuedo, and to return anEnumeratorwithout one. Code that used the return value ofeach_keyas a hash now receives theParametersinstance, which mass assignment rejects unless it is permitted.Affected applications
An application is affected if it passes the return value of
ActionController::Parameters#each_key, called with a block, to mass assignment. Rails itself makes no such call.Workarounds
Do not use the return value of
each_key. Call it for its block only, and pass the permittedParametersinstance to mass assignment.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/8ba746e0a786458c281060823f2ccc5c5f6312ac.patch
- 8.0: https://github.com/rails/rails/commit/2fc8838300133931e19eed3ea6cee76a7e83f19c.patch
Versions affected
- actionpack < 8.0.5.2
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher smlee.
π¨ Action Pack: Possible DoS vulnerability in Action Controller Live streaming
Impact
ActionController::Live::Buffer#closepushes its end-of-stream marker onto the response's bounded queue while it holds the buffer's monitor. When the client has stopped reading and the queue is full, the push blocks, andBuffer#abort, which runs when the client disconnects or a write times out, waits indefinitely for the same monitor. Each such response could permanently hold a web server thread and itsActionController::Livethread, possibly resulting in a DoS vulnerability through thread exhaustion.Applications that stream responses with
ActionController::Live, includingsend_stream, are affected. Applications that serve large files through Active Storage proxy mode are exposed to unauthenticated clients.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/ccbfc09690fef05fdd2a9969c917a71b92cc98fc.patch
- 8.0: https://github.com/rails/rails/commit/27ad18ed5900dee28ba20e9c6fc718ff751fa215.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-LDFW5N2T).
π¨ Action Pack: Possible sensitive session information leak in Active Storage proxy mode
Impact
When
ActionDispatch::Cookiesreads a signed or encrypted cookie that was written under a rotated secret (config.action_dispatch.cookies_rotations) or in the format that a:hybridcookie serializer migrates from, it writes the cookie back to the response in the current format, and that write ignoresrequest.session_options[:skip].ActiveStorage::DisableSessionrelies on that option to keep the session cookie off the public, immutable responses of the Active Storage proxy controllers, but those controllers still load the session, so a request carrying an old-format session cookie could receive the rewritten session cookie inSet-Cookieon a cacheable response. A shared cache that stores such a response together with itsSet-Cookieheader could then serve one user's session to later requesters of the same URL, or serve an attacker's session to other users.Applications are affected when they serve Active Storage files through the proxy controllers, have a cookie rotation or a
:hybridserializer migration configured, and run behind a cache that storesSet-Cookieon public responses. This is a path around the fix for CVE-2024-26144.Details
In the fixed releases, a response that skips the session leaves an old-format signed or encrypted cookie unchanged, and the next request that does not skip the session upgrades it. An application that skips the session on every request no longer upgrades its signed or encrypted cookies. Cookies that the application sets explicitly are still written. See the Action Pack CHANGELOG.
Workarounds
Configure caching proxies not to store responses that carry a
Set-Cookieheader, or complete the cookie rotation or serializer migration and remove it from the configuration.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/849a6c30eacbb6ca4722132f43c4333a93188556.patch
- 8.0: https://github.com/rails/rails/commit/0e6cf8faa89caf4c64311d35ca2bc88c1458d4e3.patch
Credit
This issue was responsibly reported by HackerOne researcher flashmyname.
π¨ Action Pack: Missing SameSite attribute on session cookies from Action Pack session stores
Impact
Action Pack session stores other than
ActionDispatch::Session::CookieStore(CacheStore,MemCacheStore, and third-party stores built onAbstractStore,AbstractSecureStoreor the session mixins) write the session cookie without aSameSiteattribute, regardless ofconfig.action_dispatch.cookies_same_site_protection, which defaults to:lax. OnlyCookieStoreapplies the configured policy. In browsers that do not treat a cookie without the attribute asSameSite=Lax, a cross-site request could carry the session cookie, possibly leading to cross-site request forgery against actions that do not verify an authenticity token, such as those of API-only applications.Applications are affected when they use a session store other than
CookieStoreand do not passsame_site:toconfig.session_store.Details
In the fixed releases, every session store sets the session cookie's
SameSiteattribute fromcookies_same_site_protectionwhen its options have no:same_sitekey. An explicitsame_site:option, includingsame_site: nil, and a:same_sitevalue in a store'sDEFAULT_OPTIONSstill take precedence.Workarounds
Pass
same_site:when configuring the session store, for exampleconfig.session_store :cache_store, same_site: :lax.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/2d9f502df941e31ce9bad0e846564f49396bed46.patch
- 8.0: https://github.com/rails/rails/commit/f2392996be723708271a8d30bfcf0edc221e53ef.patch
Credit
This issue was responsibly reported by HackerOne researcher tjvc.
π¨ Action Pack: Possible restoration of destroyed sessions in Action Dispatch CacheStore
Impact
ActionDispatch::Session::CacheStorewrites a session back to the cache at the end of each request that loaded it, without checking that the session's cache entry still exists. When a concurrent request destroys the session, throughreset_sessionon logout or by deleting its cache entry on the server, a request that loaded the session earlier and finishes later restores it under its original session ID. Logout and server-side revocation could therefore fail to end a session, and an attacker who holds a stolen session cookie could keep that session valid across the victim's logout.Applications that use
config.session_store :cache_storeare affected, with any cache backend.ActionDispatch::Session::CookieStoreis not affected, nor isActionDispatch::Session::MemCacheStorewith Dalli 4.0.0 or later, whose session store does not write back a session that was deleted.Details
The fixed releases record which session a request loaded and skip the write when that session's cache entry no longer exists. Changes that such a request makes to the destroyed session are discarded, and Rack logs a warning that the session could not be saved. Each request that writes back a session it loaded makes one additional cache read.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/d479192cf88a8b30a335a8bc25188a2d8e0f8d9f.patch
- 8.0: https://github.com/rails/rails/commit/5bb5ec66ed8faaf590ffe1222d7a5eb6e9d050f5.patch
Credit
Found by the team during internal code review.
π¨ Action Pack: Possible cache poisoning in Action Pack content negotiation
Impact
Action Pack negotiates the format of a rendered response from the
Accept,X-Requested-Withand, for XHR requests withoutAccept,Content-Typerequest headers, butActionController::Rendering#_set_vary_headeraddsVary: Acceptonly when the request carries a usableAcceptheader and the response has noVaryheader yet. A response to a request withoutAccept, or to an XHR request, therefore omits the headers that selected its representation, and a response whoseVarythe application set before rendering (for exampleVary: Accept-Language) never gainsAccept. A shared cache that honoursVarycould store such a response and serve it to later clients that request a different representation, possibly leading to cache poisoning in which visitors receive, until the entry expires, a page without its layout or HTML in place of JSON. The attacker cannot choose the content of the response.Applications that render negotiated responses from actions marked
public(for example withexpires_in ..., public: true) behind a shared cache that honoursVary, such as Thruster orRack::Cache, are affected.Details
In the fixed releases, a rendered response whose format is not given by the URL lists
AcceptandX-Requested-WithinVary, and alsoContent-Typefor an XHR request withoutAccept; whenconfig.action_dispatch.ignore_accept_headeris enabled, it lists onlyX-Requested-With. These fields are appended to an existingVaryvalue rather than skipped, andVary: *is left unchanged. Shared caches can store more variants of such responses than before. See the Action Pack CHANGELOG for details.Workarounds
Set
Vary: Accept, X-Requested-Withon negotiated responses in the application, for example in anafter_action, or do not mark negotiated responsespublic.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b.patch
- 8.0: https://github.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-7GHGLQGO, ANT-2026-5MT6C2R3).
π¨ Action Pack: Possible restoration of destroyed sessions in Action Dispatch CacheStore
Impact
ActionDispatch::Session::CacheStorewrites a session back to the cache at the end of each request that loaded it, without checking that the session's cache entry still exists. When a concurrent request destroys the session, throughreset_sessionon logout or by deleting its cache entry on the server, a request that loaded the session earlier and finishes later restores it under its original session ID. Logout and server-side revocation could therefore fail to end a session, and an attacker who holds a stolen session cookie could keep that session valid across the victim's logout.Applications that use
config.session_store :cache_storeare affected, with any cache backend.ActionDispatch::Session::CookieStoreis not affected, nor isActionDispatch::Session::MemCacheStorewith Dalli 4.0.0 or later, whose session store does not write back a session that was deleted.Details
The fixed releases record which session a request loaded and skip the write when that session's cache entry no longer exists. Changes that such a request makes to the destroyed session are discarded, and Rack logs a warning that the session could not be saved. Each request that writes back a session it loaded makes one additional cache read.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/d479192cf88a8b30a335a8bc25188a2d8e0f8d9f.patch
- 8.0: https://github.com/rails/rails/commit/5bb5ec66ed8faaf590ffe1222d7a5eb6e9d050f5.patch
Credit
Found by the team during internal code review.
π¨ Action Pack: Possible IP spoofing in Action Dispatch RemoteIp
Impact
Since Rails 8.1.0,
ActionDispatch::RemoteIpderivesrequest.remote_ipfromRack::Request#forwarded_for, which under Rack 3 reads the RFC 7239Forwardedheader in preference toX-Forwarded-For. When a reverse proxy appends the client address toX-Forwarded-Forbut passes a client-suppliedForwardedheader through unchanged,request.remote_ipreturns an address chosen by the client, and the IP spoofing check does not raise, because it compares onlyClient-Ipwith the forwarded addresses. An unauthenticated attacker could therefore spoofrequest.remote_ip, possibly bypassing IP-based access controls and rate limits keyed on the client address (including the defaultby:ofrate_limit), and falsifying the client address in logs.Details
The 8.1.0 change (2d084af8) switched
ActionDispatch::RemoteIpfrom readingX-Forwarded-Fordirectly to Rack'sforwarded_for, in order to reuse Rack's port handling. Rails continues to honorForwarded, the standard header.In the fixed releases, when
config.action_dispatch.ip_spoofing_checkis enabled (the default),ActionDispatch::RemoteIpalso compares the first untrusted client address inForwardedwith the first untrusted client address inX-Forwarded-For, as exact strings, and raisesActionDispatch::RemoteIp::IpSpoofAttackErrorwhen both headers are present and the addresses differ. Deployments whose proxies report the client address inconsistently between the two headers will receive this error after upgrading. See theactionpackCHANGELOG.Affected applications
An application is affected if it meets all of these requirements:
- Runs Rails 8.1.0 through 8.1.4 with Rack 3. Under Rack 2.2,
forwarded_forreads onlyX-Forwarded-For.- Is served behind a proxy that does not remove or overwrite a client-supplied
Forwardedheader.- Relies on
request.remote_ipfor access control, rate limiting, or auditing.The fix detects a spoofed
Forwardedheader only when the proxy also setsX-Forwarded-For. An application whose proxy passes a client-suppliedForwardedheader through and sets noX-Forwarded-Forremains exposed after upgrading, and should configure the proxy to remove or overwriteForwarded, or apply the workaround below.Mitigation
- Upgrade to a fixed version of
actionpack.- Configure reverse proxies to remove or overwrite any client-supplied
Forwardedheader.Workarounds
Applications whose proxies set
X-Forwarded-Forcan make Rack ignore theForwardedheader, restoring the client address resolution of Rails 8.0, by settingRack::Request.forwarded_priority = [:x_forwarded]in an initializer. This setting is available in Rack 3.0.0 and later, and it also causes Rack to ignoreForwardedwhen determining the request scheme, host, and port.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher luryus.
π¨ Action Pack: Missing SameSite attribute on session cookies from Action Pack session stores
Impact
Action Pack session stores other than
ActionDispatch::Session::CookieStore(CacheStore,MemCacheStore, and third-party stores built onAbstractStore,AbstractSecureStoreor the session mixins) write the session cookie without aSameSiteattribute, regardless ofconfig.action_dispatch.cookies_same_site_protection, which defaults to:lax. OnlyCookieStoreapplies the configured policy. In browsers that do not treat a cookie without the attribute asSameSite=Lax, a cross-site request could carry the session cookie, possibly leading to cross-site request forgery against actions that do not verify an authenticity token, such as those of API-only applications.Applications are affected when they use a session store other than
CookieStoreand do not passsame_site:toconfig.session_store.Details
In the fixed releases, every session store sets the session cookie's
SameSiteattribute fromcookies_same_site_protectionwhen its options have no:same_sitekey. An explicitsame_site:option, includingsame_site: nil, and a:same_sitevalue in a store'sDEFAULT_OPTIONSstill take precedence.Workarounds
Pass
same_site:when configuring the session store, for exampleconfig.session_store :cache_store, same_site: :lax.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/2d9f502df941e31ce9bad0e846564f49396bed46.patch
- 8.0: https://github.com/rails/rails/commit/f2392996be723708271a8d30bfcf0edc221e53ef.patch
Credit
This issue was responsibly reported by HackerOne researcher tjvc.
π¨ Action Pack: Possible cache poisoning in Action Pack content negotiation
Impact
Action Pack negotiates the format of a rendered response from the
Accept,X-Requested-Withand, for XHR requests withoutAccept,Content-Typerequest headers, butActionController::Rendering#_set_vary_headeraddsVary: Acceptonly when the request carries a usableAcceptheader and the response has noVaryheader yet. A response to a request withoutAccept, or to an XHR request, therefore omits the headers that selected its representation, and a response whoseVarythe application set before rendering (for exampleVary: Accept-Language) never gainsAccept. A shared cache that honoursVarycould store such a response and serve it to later clients that request a different representation, possibly leading to cache poisoning in which visitors receive, until the entry expires, a page without its layout or HTML in place of JSON. The attacker cannot choose the content of the response.Applications that render negotiated responses from actions marked
public(for example withexpires_in ..., public: true) behind a shared cache that honoursVary, such as Thruster orRack::Cache, are affected.Details
In the fixed releases, a rendered response whose format is not given by the URL lists
AcceptandX-Requested-WithinVary, and alsoContent-Typefor an XHR request withoutAccept; whenconfig.action_dispatch.ignore_accept_headeris enabled, it lists onlyX-Requested-With. These fields are appended to an existingVaryvalue rather than skipped, andVary: *is left unchanged. Shared caches can store more variants of such responses than before. See the Action Pack CHANGELOG for details.Workarounds
Set
Vary: Accept, X-Requested-Withon negotiated responses in the application, for example in anafter_action, or do not mark negotiated responsespublic.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b.patch
- 8.0: https://github.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-7GHGLQGO, ANT-2026-5MT6C2R3).
π¨ Missing SameSite attribute on session cookies from Action Pack session stores
Impact
Action Pack session stores other than
ActionDispatch::Session::CookieStore
(CacheStore,MemCacheStore, and third-party stores built on
AbstractStore,AbstractSecureStoreor the session mixins) write the
session cookie without aSameSiteattribute, regardless of
config.action_dispatch.cookies_same_site_protection, which defaults to
:lax. OnlyCookieStoreapplies the configured policy. In browsers that do
not treat a cookie without the attribute asSameSite=Lax, a cross-site
request could carry the session cookie, possibly leading to cross-site request
forgery against actions that do not verify an authenticity token, such as
those of API-only applications.Applications are affected when they use a session store other than
CookieStoreand do not passsame_site:toconfig.session_store.Details
In the fixed releases, every session store sets the session cookie's
SameSiteattribute fromcookies_same_site_protectionwhen its options have
no:same_sitekey. An explicitsame_site:option, including
same_site: nil, and a:same_sitevalue in a store'sDEFAULT_OPTIONS
still take precedence.Workarounds
Pass
same_site:when configuring the session store, for example
config.session_store :cache_store, same_site: :lax.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/2d9f502df941e31ce9bad0e846564f49396bed46.patch- 8.0:
https://github.com/rails/rails/commit/f2392996be723708271a8d30bfcf0edc221e53ef.patchCredit
This issue was responsibly reported by HackerOne researcher
tjvc.
π¨ Possible DoS vulnerability in Action Controller Live streaming
Impact
ActionController::Live::Buffer#closepushes its end-of-stream marker onto
the response's bounded queue while it holds the buffer's monitor. When the
client has stopped reading and the queue is full, the push blocks, and
Buffer#abort, which runs when the client disconnects or a write times out,
waits indefinitely for the same monitor. Each such response could permanently
hold a web server thread and itsActionController::Livethread, possibly
resulting in a DoS vulnerability through thread exhaustion.Applications that stream responses with
ActionController::Live, including
send_stream, are affected. Applications that serve large files through
Active Storage proxy mode are exposed to unauthenticated clients.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/ccbfc09690fef05fdd2a9969c917a71b92cc98fc.patch- 8.0:
https://github.com/rails/rails/commit/27ad18ed5900dee28ba20e9c6fc718ff751fa215.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-LDFW5N2T).
π¨ Possible Strong Parameters bypass in Parameters#each_key in Action Pack
Impact
ActionController::Parameters#each_keydelegates to the internal
ActiveSupport::HashWithIndifferentAccessthat holds the request parameters,
so when called with a block it returns that hash instead of theParameters
instance. The hash does not respond topermitted?, so Active Model mass
assignment (new,assign_attributes,update) accepts it without raising
ActiveModel::ForbiddenAttributesError. An application that passes the return
value ofeach_keyto mass assignment could allow a remote, unauthenticated
attacker to set attributes that the application does not permit, such as an
authorization flag.This is an incomplete fix of
CVE-2020-8164, which made
each,each_pairandeach_valuereturn theParametersinstance but left
each_keydelegated.Details
The fixed releases define
Parameters#each_keyto yield each key and return
theParametersinstance when given a block, aseach,each_pairand
each_valuedo, and to return anEnumeratorwithout one. Code that used the
return value ofeach_keyas a hash now receives theParametersinstance,
which mass assignment rejects unless it is permitted.Affected applications
An application is affected if it passes the return value of
ActionController::Parameters#each_key, called with a block, to mass
assignment. Rails itself makes no such call.Workarounds
Do not use the return value of
each_key. Call it for its block only, and
pass the permittedParametersinstance to mass assignment.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/8ba746e0a786458c281060823f2ccc5c5f6312ac.patch- 8.0:
https://github.com/rails/rails/commit/2fc8838300133931e19eed3ea6cee76a7e83f19c.patchVersions affected
- actionpack < 8.0.5.2
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
smlee.
π¨ Possible sensitive session information leak in Active Storage proxy mode
Impact
When
ActionDispatch::Cookiesreads a signed or encrypted cookie that was
written under a rotated secret (config.action_dispatch.cookies_rotations) or
in the format that a:hybridcookie serializer migrates from, it writes the
cookie back to the response in the current format, and that write ignores
request.session_options[:skip].ActiveStorage::DisableSessionrelies on
that option to keep the session cookie off the public, immutable responses of
the Active Storage proxy controllers, but those controllers still load the
session, so a request carrying an old-format session cookie could receive the
rewritten session cookie inSet-Cookieon a cacheable response. A shared
cache that stores such a response together with itsSet-Cookieheader could
then serve one user's session to later requesters of the same URL, or serve an
attacker's session to other users.Applications are affected when they serve Active Storage files through the
proxy controllers, have a cookie rotation or a:hybridserializer migration
configured, and run behind a cache that storesSet-Cookieon public
responses. This is a path around the fix for
CVE-2024-26144.Details
In the fixed releases, a response that skips the session leaves an old-format
signed or encrypted cookie unchanged, and the next request that does not skip
the session upgrades it. An application that skips the session on every
request no longer upgrades its signed or encrypted cookies. Cookies that the
application sets explicitly are still written. See the Action Pack CHANGELOG.Workarounds
Configure caching proxies not to store responses that carry a
Set-Cookie
header, or complete the cookie rotation or serializer migration and remove it
from the configuration.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/849a6c30eacbb6ca4722132f43c4333a93188556.patch- 8.0:
https://github.com/rails/rails/commit/0e6cf8faa89caf4c64311d35ca2bc88c1458d4e3.patchCredit
This issue was responsibly reported by HackerOne researcher
flashmyname.
π¨ Possible restoration of destroyed sessions in Action Dispatch CacheStore
Impact
ActionDispatch::Session::CacheStorewrites a session back to the cache at
the end of each request that loaded it, without checking that the session's
cache entry still exists. When a concurrent request destroys the session,
throughreset_sessionon logout or by deleting its cache entry on the
server, a request that loaded the session earlier and finishes later restores
it under its original session ID. Logout and server-side revocation could
therefore fail to end a session, and an attacker who holds a stolen session
cookie could keep that session valid across the victim's logout.Applications that use
config.session_store :cache_storeare affected, with
any cache backend.ActionDispatch::Session::CookieStoreis not affected, nor
isActionDispatch::Session::MemCacheStorewith Dalli 4.0.0 or later, whose
session store does not write back a session that was deleted.Details
The fixed releases record which session a request loaded and skip the write
when that session's cache entry no longer exists. Changes that such a request
makes to the destroyed session are discarded, and Rack logs a warning that the
session could not be saved. Each request that writes back a session it loaded
makes one additional cache read.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/d479192cf88a8b30a335a8bc25188a2d8e0f8d9f.patch- 8.0:
https://github.com/rails/rails/commit/5bb5ec66ed8faaf590ffe1222d7a5eb6e9d050f5.patchCredit
Found by the team during internal code review.
π¨ Possible IP spoofing in Action Dispatch RemoteIp
Impact
Since Rails 8.1.0,
ActionDispatch::RemoteIpderivesrequest.remote_ipfrom
Rack::Request#forwarded_for, which under Rack 3 reads the RFC 7239
Forwardedheader in preference toX-Forwarded-For. When a reverse proxy
appends the client address toX-Forwarded-Forbut passes a client-supplied
Forwardedheader through unchanged,request.remote_ipreturns an address
chosen by the client, and the IP spoofing check does not raise, because it
compares onlyClient-Ipwith the forwarded addresses. An unauthenticated
attacker could therefore spoofrequest.remote_ip, possibly bypassing
IP-based access controls and rate limits keyed on the client address
(including the defaultby:ofrate_limit), and falsifying the client
address in logs.Details
The 8.1.0 change
(2d084af8)
switchedActionDispatch::RemoteIpfrom readingX-Forwarded-Fordirectly to
Rack'sforwarded_for, in order to reuse Rack's port handling. Rails
continues to honorForwarded, the standard header.In the fixed releases, when
config.action_dispatch.ip_spoofing_checkis
enabled (the default),ActionDispatch::RemoteIpalso compares the first
untrusted client address inForwardedwith the first untrusted client
address inX-Forwarded-For, as exact strings, and raises
ActionDispatch::RemoteIp::IpSpoofAttackErrorwhen both headers are present
and the addresses differ. Deployments whose proxies report the client address
inconsistently between the two headers will receive this error after
upgrading. See theactionpackCHANGELOG.Affected applications
An application is affected if it meets all of these requirements:
- Runs Rails 8.1.0 through 8.1.4 with Rack 3. Under Rack 2.2,
forwarded_for
reads onlyX-Forwarded-For.- Is served behind a proxy that does not remove or overwrite a client-supplied
Forwardedheader.- Relies on
request.remote_ipfor access control, rate limiting, or
auditing.The fix detects a spoofed
Forwardedheader only when the proxy also sets
X-Forwarded-For. An application whose proxy passes a client-supplied
Forwardedheader through and sets noX-Forwarded-Forremains exposed after
upgrading, and should configure the proxy to remove or overwriteForwarded,
or apply the workaround below.Mitigation
- Upgrade to a fixed version of
actionpack.- Configure reverse proxies to remove or overwrite any client-supplied
Forwardedheader.Workarounds
Applications whose proxies set
X-Forwarded-Forcan make Rack ignore the
Forwardedheader, restoring the client address resolution of Rails 8.0, by
settingRack::Request.forwarded_priority = [:x_forwarded]in an initializer.
This setting is available in Rack 3.0.0 and later, and it also causes Rack to
ignoreForwardedwhen determining the request scheme, host, and port.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
luryus.
π¨ Missing SameSite attribute on session cookies from Action Pack session stores
Impact
Action Pack session stores other than
ActionDispatch::Session::CookieStore
(CacheStore,MemCacheStore, and third-party stores built on
AbstractStore,AbstractSecureStoreor the session mixins) write the
session cookie without aSameSiteattribute, regardless of
config.action_dispatch.cookies_same_site_protection, which defaults to
:lax. OnlyCookieStoreapplies the configured policy. In browsers that do
not treat a cookie without the attribute asSameSite=Lax, a cross-site
request could carry the session cookie, possibly leading to cross-site request
forgery against actions that do not verify an authenticity token, such as
those of API-only applications.Applications are affected when they use a session store other than
CookieStoreand do not passsame_site:toconfig.session_store.Details
In the fixed releases, every session store sets the session cookie's
SameSiteattribute fromcookies_same_site_protectionwhen its options have
no:same_sitekey. An explicitsame_site:option, including
same_site: nil, and a:same_sitevalue in a store'sDEFAULT_OPTIONS
still take precedence.Workarounds
Pass
same_site:when configuring the session store, for example
config.session_store :cache_store, same_site: :lax.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/2d9f502df941e31ce9bad0e846564f49396bed46.patch- 8.0:
https://github.com/rails/rails/commit/f2392996be723708271a8d30bfcf0edc221e53ef.patchCredit
This issue was responsibly reported by HackerOne researcher
tjvc.
π¨ Possible cache poisoning in Action Pack content negotiation
Impact
Action Pack negotiates the format of a rendered response from the
Accept,
X-Requested-Withand, for XHR requests withoutAccept,Content-Type
request headers, butActionController::Rendering#_set_vary_headeradds
Vary: Acceptonly when the request carries a usableAcceptheader and the
response has noVaryheader yet. A response to a request withoutAccept,
or to an XHR request, therefore omits the headers that selected its
representation, and a response whoseVarythe application set before
rendering (for exampleVary: Accept-Language) never gainsAccept. A shared
cache that honoursVarycould store such a response and serve it to later
clients that request a different representation, possibly leading to cache
poisoning in which visitors receive, until the entry expires, a page without
its layout or HTML in place of JSON. The attacker cannot choose the content of
the response.Applications that render negotiated responses from actions marked
public
(for example withexpires_in ..., public: true) behind a shared cache that
honoursVary, such as Thruster orRack::Cache, are affected.Details
In the fixed releases, a rendered response whose format is not given by the
URL listsAcceptandX-Requested-WithinVary, and alsoContent-Type
for an XHR request withoutAccept; when
config.action_dispatch.ignore_accept_headeris enabled, it lists only
X-Requested-With. These fields are appended to an existingVaryvalue
rather than skipped, andVary: *is left unchanged. Shared caches can store
more variants of such responses than before. See the Action Pack CHANGELOG for
details.Workarounds
Set
Vary: Accept, X-Requested-Withon negotiated responses in the
application, for example in anafter_action, or do not mark negotiated
responsespublic.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b.patch- 8.0:
https://github.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-7GHGLQGO,
ANT-2026-5MT6C2R3).
π¨ Possible DoS vulnerability in Action Controller Live streaming
Impact
ActionController::Live::Buffer#closepushes its end-of-stream marker onto
the response's bounded queue while it holds the buffer's monitor. When the
client has stopped reading and the queue is full, the push blocks, and
Buffer#abort, which runs when the client disconnects or a write times out,
waits indefinitely for the same monitor. Each such response could permanently
hold a web server thread and itsActionController::Livethread, possibly
resulting in a DoS vulnerability through thread exhaustion.Applications that stream responses with
ActionController::Live, including
send_stream, are affected. Applications that serve large files through
Active Storage proxy mode are exposed to unauthenticated clients.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/ccbfc09690fef05fdd2a9969c917a71b92cc98fc.patch- 8.0:
https://github.com/rails/rails/commit/27ad18ed5900dee28ba20e9c6fc718ff751fa215.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-LDFW5N2T).
π¨ Possible Strong Parameters bypass in Parameters#each_key in Action Pack
Impact
ActionController::Parameters#each_keydelegates to the internal
ActiveSupport::HashWithIndifferentAccessthat holds the request parameters,
so when called with a block it returns that hash instead of theParameters
instance. The hash does not respond topermitted?, so Active Model mass
assignment (new,assign_attributes,update) accepts it without raising
ActiveModel::ForbiddenAttributesError. An application that passes the return
value ofeach_keyto mass assignment could allow a remote, unauthenticated
attacker to set attributes that the application does not permit, such as an
authorization flag.This is an incomplete fix of
CVE-2020-8164, which made
each,each_pairandeach_valuereturn theParametersinstance but left
each_keydelegated.Details
The fixed releases define
Parameters#each_keyto yield each key and return
theParametersinstance when given a block, aseach,each_pairand
each_valuedo, and to return anEnumeratorwithout one. Code that used the
return value ofeach_keyas a hash now receives theParametersinstance,
which mass assignment rejects unless it is permitted.Affected applications
An application is affected if it passes the return value of
ActionController::Parameters#each_key, called with a block, to mass
assignment. Rails itself makes no such call.Workarounds
Do not use the return value of
each_key. Call it for its block only, and
pass the permittedParametersinstance to mass assignment.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/8ba746e0a786458c281060823f2ccc5c5f6312ac.patch- 8.0:
https://github.com/rails/rails/commit/2fc8838300133931e19eed3ea6cee76a7e83f19c.patchVersions affected
- actionpack < 8.0.5.2
- actionpack >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
smlee.
π¨ Possible sensitive session information leak in Active Storage proxy mode
Impact
When
ActionDispatch::Cookiesreads a signed or encrypted cookie that was
written under a rotated secret (config.action_dispatch.cookies_rotations) or
in the format that a:hybridcookie serializer migrates from, it writes the
cookie back to the response in the current format, and that write ignores
request.session_options[:skip].ActiveStorage::DisableSessionrelies on
that option to keep the session cookie off the public, immutable responses of
the Active Storage proxy controllers, but those controllers still load the
session, so a request carrying an old-format session cookie could receive the
rewritten session cookie inSet-Cookieon a cacheable response. A shared
cache that stores such a response together with itsSet-Cookieheader could
then serve one user's session to later requesters of the same URL, or serve an
attacker's session to other users.Applications are affected when they serve Active Storage files through the
proxy controllers, have a cookie rotation or a:hybridserializer migration
configured, and run behind a cache that storesSet-Cookieon public
responses. This is a path around the fix for
CVE-2024-26144.Details
In the fixed releases, a response that skips the session leaves an old-format
signed or encrypted cookie unchanged, and the next request that does not skip
the session upgrades it. An application that skips the session on every
request no longer upgrades its signed or encrypted cookies. Cookies that the
application sets explicitly are still written. See the Action Pack CHANGELOG.Workarounds
Configure caching proxies not to store responses that carry a
Set-Cookie
header, or complete the cookie rotation or serializer migration and remove it
from the configuration.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/849a6c30eacbb6ca4722132f43c4333a93188556.patch- 8.0:
https://github.com/rails/rails/commit/0e6cf8faa89caf4c64311d35ca2bc88c1458d4e3.patchCredit
This issue was responsibly reported by HackerOne researcher
flashmyname.
π¨ Possible restoration of destroyed sessions in Action Dispatch CacheStore
Impact
ActionDispatch::Session::CacheStorewrites a session back to the cache at
the end of each request that loaded it, without checking that the session's
cache entry still exists. When a concurrent request destroys the session,
throughreset_sessionon logout or by deleting its cache entry on the
server, a request that loaded the session earlier and finishes later restores
it under its original session ID. Logout and server-side revocation could
therefore fail to end a session, and an attacker who holds a stolen session
cookie could keep that session valid across the victim's logout.Applications that use
config.session_store :cache_storeare affected, with
any cache backend.ActionDispatch::Session::CookieStoreis not affected, nor
isActionDispatch::Session::MemCacheStorewith Dalli 4.0.0 or later, whose
session store does not write back a session that was deleted.Details
The fixed releases record which session a request loaded and skip the write
when that session's cache entry no longer exists. Changes that such a request
makes to the destroyed session are discarded, and Rack logs a warning that the
session could not be saved. Each request that writes back a session it loaded
makes one additional cache read.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/d479192cf88a8b30a335a8bc25188a2d8e0f8d9f.patch- 8.0:
https://github.com/rails/rails/commit/5bb5ec66ed8faaf590ffe1222d7a5eb6e9d050f5.patchCredit
Found by the team during internal code review.
π¨ Possible cache poisoning in Action Pack content negotiation
Impact
Action Pack negotiates the format of a rendered response from the
Accept,
X-Requested-Withand, for XHR requests withoutAccept,Content-Type
request headers, butActionController::Rendering#_set_vary_headeradds
Vary: Acceptonly when the request carries a usableAcceptheader and the
response has noVaryheader yet. A response to a request withoutAccept,
or to an XHR request, therefore omits the headers that selected its
representation, and a response whoseVarythe application set before
rendering (for exampleVary: Accept-Language) never gainsAccept. A shared
cache that honoursVarycould store such a response and serve it to later
clients that request a different representation, possibly leading to cache
poisoning in which visitors receive, until the entry expires, a page without
its layout or HTML in place of JSON. The attacker cannot choose the content of
the response.Applications that render negotiated responses from actions marked
public
(for example withexpires_in ..., public: true) behind a shared cache that
honoursVary, such as Thruster orRack::Cache, are affected.Details
In the fixed releases, a rendered response whose format is not given by the
URL listsAcceptandX-Requested-WithinVary, and alsoContent-Type
for an XHR request withoutAccept; when
config.action_dispatch.ignore_accept_headeris enabled, it lists only
X-Requested-With. These fields are appended to an existingVaryvalue
rather than skipped, andVary: *is left unchanged. Shared caches can store
more variants of such responses than before. See the Action Pack CHANGELOG for
details.Workarounds
Set
Vary: Accept, X-Requested-Withon negotiated responses in the
application, for example in anafter_action, or do not mark negotiated
responsespublic.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/7a955ca36779938267c93902c47d1f55bab99b4b.patch- 8.0:
https://github.com/rails/rails/commit/b58c107abe9c1f10c1d6a4941402c60e4dc4742c.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-7GHGLQGO,
ANT-2026-5MT6C2R3).
π¨ Rails has a possible XSS vulnerability in its Action Pack debug exceptions
Impact
The debug exceptions page does not properly escape exception messages. A carefully crafted exception message could inject arbitrary HTML and JavaScript into the page, leading to XSS. This affects applications with detailed exception pages enabled (
config.consider_all_requests_local = true), which is the default in development.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher fbettag.
π¨ Possible Content Security Policy bypass in Action Dispatch
There is a possible Cross Site Scripting (XSS) vulnerability in the
content_security_policyhelper in Action Pack.Impact
Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks.
Releases
The fixed releases are available at the normal locations.
Workarounds
Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.
Credits
Thanks to ryotak for the report!
π¨ Possible Content Security Policy bypass in Action Dispatch
There is a possible Cross Site Scripting (XSS) vulnerability in the
content_security_policyhelper in Action Pack.Impact
Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks.
Releases
The fixed releases are available at the normal locations.
Workarounds
Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.
Credits
Thanks to ryotak for the report!
π¨ Possible Content Security Policy bypass in Action Dispatch
There is a possible Cross Site Scripting (XSS) vulnerability in the
content_security_policyhelper in Action Pack.Impact
Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks.
Releases
The fixed releases are available at the normal locations.
Workarounds
Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.
Credits
Thanks to ryotak for the report!
π¨ Possible ReDoS vulnerability in query parameter filtering in Action Dispatch
There is a possible ReDoS vulnerability in the query parameter filtering routines of Action Dispatch. This vulnerability has been assigned the CVE identifier CVE-2024-41128.
Impact
Carefully crafted query parameters can cause query parameter filtering to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users on Ruby 3.2 are unaffected by this issue.
Credits
Thanks to scyoon for the report and patches!
π¨ Possible ReDoS vulnerability in HTTP Token authentication in Action Controller
There is a possible ReDoS vulnerability in Action Controller's HTTP Token authentication. This vulnerability has been assigned the CVE identifier CVE-2024-47887.
Impact
For applications using HTTP Token authentication via
authenticate_or_request_with_http_tokenor similar, a carefully crafted header may cause header parsing to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users on Ruby 3.2 are unaffected by this issue.
Credits
Thanks to scyoon for reporting
π¨ Possible ReDoS vulnerability in HTTP Token authentication in Action Controller
There is a possible ReDoS vulnerability in Action Controller's HTTP Token authentication. This vulnerability has been assigned the CVE identifier CVE-2024-47887.
Impact
For applications using HTTP Token authentication via
authenticate_or_request_with_http_tokenor similar, a carefully crafted header may cause header parsing to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users on Ruby 3.2 are unaffected by this issue.
Credits
Thanks to scyoon for reporting
π¨ Possible ReDoS vulnerability in query parameter filtering in Action Dispatch
There is a possible ReDoS vulnerability in the query parameter filtering routines of Action Dispatch. This vulnerability has been assigned the CVE identifier CVE-2024-41128.
Impact
Carefully crafted query parameters can cause query parameter filtering to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users on Ruby 3.2 are unaffected by this issue.
Credits
Thanks to scyoon for the report and patches!
π¨ Missing security headers in Action Pack on non-HTML responses
Permissions-Policy is Only Served on HTML Content-Type
The application configurable Permissions-Policy is only served on responses
with an HTML related Content-Type.This has been assigned the CVE identifier CVE-2024-28103.
Versions Affected: >= 6.1.0
Not affected: < 6.1.0
Fixed Versions: 6.1.7.8, 7.0.8.4, and 7.1.3.4Impact
Responses with a non-HTML Content-Type are not serving the configured Permissions-Policy. There are certain non-HTML Content-Types that would benefit from having the Permissions-Policy enforced.
Releases
The fixed releases are available at the normal locations.
Workarounds
N/A
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the supported release series in accordance with our
maintenance policy
regarding security issues. They are in git-am format and consist of a
single changeset.
- 6-1-include-permissions-policy-header-on-non-html.patch - Patch for 6.1 series
- 7-0-include-permissions-policy-header-on-non-html.patch - Patch for 7.0 series
- 7-1-include-permissions-policy-header-on-non-html.patch - Patch for 7.1 series
Credits
Thank you shinkbr for reporting this!
π¨ Rails has possible ReDoS vulnerability in Accept header parsing in Action Dispatch
Possible ReDoS vulnerability in Accept header parsing in Action Dispatch
There is a possible ReDoS vulnerability in the Accept header parsing routines
of Action Dispatch. This vulnerability has been assigned the CVE identifier
CVE-2024-26142.Versions Affected: >= 7.1.0, < 7.1.3.1
Not affected: < 7.1.0
Fixed Versions: 7.1.3.1Impact
Carefully crafted Accept headers can cause Accept header parsing in Action
Dispatch to take an unexpected amount of time, possibly resulting in a DoS
vulnerability. All users running an affected release should either upgrade or
use one of the workarounds immediately.Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby
3.2 or newer are unaffected.Releases
The fixed releases are available at the normal locations.
Workarounds
There are no feasible workarounds for this issue.
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the two supported release series. They are in git-am format and consist of a
single changeset.
- 7-1-accept-redox.patch - Patch for 7.1 series
Credits
Thanks svalkanov for the report and patch!
π¨ Rails has possible XSS Vulnerability in Action Controller
Possible XSS Vulnerability in Action Controller
There is a possible XSS vulnerability when using the translation helpers
(translate,t, etc) in Action Controller. This vulnerability has been
assigned the CVE identifier CVE-2024-26143.Versions Affected: >= 7.0.0.
Not affected: < 7.0.0
Fixed Versions: 7.1.3.1, 7.0.8.1Impact
Applications using translation methods like
translate, orton a
controller, with a key ending in "_html", a:defaultkey which contains
untrusted user input, and the resulting string is used in a view, may be
susceptible to an XSS vulnerability.For example, impacted code will look something like this:
class ArticlesController < ApplicationController def show @message = t("message_html", default: untrusted_input) # The `show` template displays the contents of `@message` end endTo reiterate the pre-conditions, applications must:
- Use a translation function from a controller (i.e. not I18n.t, or
tfrom
a view)- Use a key that ends in
_html- Use a default value where the default value is untrusted and unescaped input
- Send the text to the victim (whether that's part of a template, or a
rendercall)All users running an affected release should either upgrade or use one of the
workarounds immediately.Releases
The fixed releases are available at the normal locations.
Workarounds
There are no feasible workarounds for this issue.
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the two supported release series. They are in git-am format and consist of a
single changeset.
- 7-0-translate-xss.patch - Patch for 7.0 series
- 7-1-translate-xss.patch - Patch for 7.1 series
Credits
Thanks to ooooooo_q for the patch and fix!
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ actiontext (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Possible ReDoS vulnerability in plain_text_for_blockquote_node in Action Text
There is a possible ReDoS vulnerability in the plain_text_for_blockquote_node helper in Action Text. This vulnerability has been assigned the CVE identifier CVE-2024-47888.
Impact
Carefully crafted text can cause the plain_text_for_blockquote_node helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users can avoid calling
plain_text_for_blockquote_nodeor upgrade to Ruby 3.2Credits
Thanks to ooooooo_q for the report!
π¨ Possible ReDoS vulnerability in plain_text_for_blockquote_node in Action Text
There is a possible ReDoS vulnerability in the plain_text_for_blockquote_node helper in Action Text. This vulnerability has been assigned the CVE identifier CVE-2024-47888.
Impact
Carefully crafted text can cause the plain_text_for_blockquote_node helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.
Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Releases
The fixed releases are available at the normal locations.
Workarounds
Users can avoid calling
plain_text_for_blockquote_nodeor upgrade to Ruby 3.2Credits
Thanks to ooooooo_q for the report!
π¨ ActionText ContentAttachment can Contain Unsanitized HTML
Instances of ActionText::Attachable::ContentAttachment included within a rich_text_area tag could potentially contain unsanitized HTML.
This has been assigned the CVE identifier CVE-2024-32464.
Versions Affected: >= 7.1.0
Not affected: < 7.1.0
Fixed Versions: 7.1.3.4Impact
This could lead to a potential cross site scripting issue within the Trix editor.
Releases
The fixed releases are available at the normal locations.
Workarounds
N/A
Patches
To aid users who aren't able to upgrade immediately we have provided patches for the supported release series in accordance with our maintenance policy regarding security issues. They are in git-am format and consist of a single changeset.
- action_text_content_attachment_xss_7_1_stable.patch - Patch for 7.1 series
Credits
Thank you ooooooo_q for reporting this!
π¨ Trix Editor Arbitrary Code Execution Vulnerability
The Trix editor, versions prior to 2.1.1, is vulnerable to arbitrary code execution when copying and pasting content from the web or other documents with markup into the editor. The vulnerability stems from improper sanitization of pasted content, allowing an attacker to embed malicious scripts which are executed within the context of the application.
Vulnerable Versions:
- 1.x series up to and including 1.3.1
- 2.x series up to and including 2.1.0
Fixed Versions:
- v1.3.2
- v2.1.1
Vector:
- Bug 1: When copying content manipulated by a script, such as:
document.addEventListener('copy', function(e){ e.clipboardData.setData('text/html', '<div><noscript><div class="123</noscript>456<img src=1 onerror=alert(1)//"></div></noscript></div>'); e.preventDefault(); });and pasting into the Trix editor, the script within the content is executed.
- Bug 2: Similar execution occurs with content structured as:
document.write(`copy<div data-trix-attachment="{"contentType":"text/html","content":"<img src=1 onerror=alert(101)>HELLO123"}"></div>me`);Impact:
An attacker could exploit these vulnerabilities to execute arbitrary JavaScript code within the context of the user's session, potentially leading to unauthorized actions being performed or sensitive information being disclosed.
Remediation:
Update Recommendation: Users should upgrade to Trix editor version 2.1.1 or later, which incorporates proper sanitization of input from copied content.
CSP Enhancement: Additionally, enhancing the Content Security Policy (CSP) to disallow inline scripts can significantly mitigate the risk of such vulnerabilities. Set CSP policies such as script-src 'self' to ensure that only scripts hosted on the same origin are executed, and explicitly prohibit inline scripts using script-src-elem.
References:
- https://github.com/basecamp/trix/releases/tag/v2.1.1
- basecamp/trix#1147
- basecamp/trix#1149
- basecamp/trix#1153
Credit: These issues were reported by security researchers loknop and pinpie.
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ actionview (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Action View: Possible XSS vulnerability in highlight helper
Impact
ActionView::Helpers::TextHelper#highlightsubstitutes each matched phrase into the:highlighterstring without escaping it and returns the result marked HTML-safe. Because sanitizing leaves quote characters in text unescaped, a match substituted into a quoted attribute value of the highlighter, such as the<a href="search?q=\1">form shown in the method's documentation, could end the attribute value and add attributes to the element, possibly leading to XSS. Applications are affected when they pass a:highlighterthat places a placeholder inside an attribute value and highlight text or phrases that a user controls. The default<mark>\1</mark>highlighter and the block form are not affected.Details
The fixed releases HTML-escape each group substituted into the
:highlighterstring, so quotes in a match are rendered as"and'. Only the numbered placeholders\0to\9are expanded; otherString#subreplacement escapes, such as\k<name>,\&and\\, are left as written. A match can no longer begin on the>that closes a preceding tag. Escaping makes a placeholder safe as element content or inside a quoted attribute value, but not in an unquoted attribute value, a URL, JavaScript or CSS context, or an attribute whose value is HTML. See the Action View CHANGELOG for details.Workarounds
Use a
:highlighterthat places the matched phrase only in element content, such as the default<mark>\1</mark>.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/06938194b4fd59e1d2c8ab4a781f3c1e2b763425.patch
- 8.0: https://github.com/rails/rails/commit/c796f6198837479ada13290eb8fa767b5219a58a.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-THHUJQVO).
π¨ Action View: Possible XSS vulnerability in tag helpers
Impact
The fix for CVE-2026-33168 skips blank HTML attribute names in Action View tag helpers, but it tests the name before converting it to a string. A Symbol name made only of whitespace, such as
:" ", is not blank, becauseSymbol#blank?isSymbol#empty?, so it reaches the attribute escaping, which emits an attribute with no name and produces malformed HTML. The asset tag helpers, such asimage_tag,video_tagandaudio_tag, symbolize their options, so a whitespace String name passed to them takes the same path. A carefully crafted attribute value could then be misinterpreted by the browser as a separate attribute name, possibly leading to XSS. Applications that allow users to specify custom HTML attribute names are affected.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/9190210606ffe52f92fdc75637f8ff69404f22c8.patch
- 8.0: https://github.com/rails/rails/commit/f47452533e1f28d847c63181b9d5f8b7243ef9a4.patch
Credit
This issue was responsibly reported by HackerOne researcher thepo1es.
π¨ Action View: Possible XSS vulnerability in text helpers
Impact
With the HTML5 sanitizer (
Rails::HTML5::Sanitizer, the default vendor on CRuby for applications usingload_defaults 7.1or later), Nokogiri before 1.19.5 serializes<and>unescaped inside attribute values. The Action View text helpershighlightandsimple_formatsanitize their input and then process the resulting HTML as a string:highlightsplits it on tag boundaries to insert matches, andsimple_formatsplits it into paragraphs on blank lines. An unescaped>or a blank line inside an attribute value could cause markup in that value, which the sanitizer left inert, to be emitted as live elements in the helper'shtml_safeoutput, possibly leading to XSS. Applications that use the HTML5 sanitizer and pass untrusted text tohighlight, or tosimple_formatwithhtml_options, are affected.Details
The fixed releases require rails-html-sanitizer 1.7.2 or later, which requires Loofah 2.25.3 and Nokogiri 1.19.5. With these versions, the HTML5 sanitizer escapes
<and>in attribute values as<and>, as the HTML4 sanitizer already does. The parsed DOM is unchanged, but code or tests that compare sanitized HTML as a string may see the new serialization.Workarounds
Upgrade Nokogiri to 1.19.5 or later; the escaping is in its HTML5 serializer, so no Rails upgrade is needed. Alternatively, use the HTML4 sanitizer by setting
config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73.patch
- 8.0: https://github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11.patch
Credit
This issue was responsibly reported by HackerOne researcher azaran.
This issue was also found by the Anthropic OSS Scanner (ANT-2026-RTK47OH0).
π¨ Action View: Possible XSS vulnerability in strip_tags
Impact
strip_tagsin Action View returns its sanitized output markedhtml_safe, but the underlying sanitizer encodes only&,<and>, leaving"and'unencoded. Because ERB does not escape a string markedhtml_safe, untrusted input passed throughstrip_tagsand rendered inside a quoted HTML attribute value could close the attribute and add new attributes, possibly leading to XSS. Applications that renderstrip_tagsoutput from untrusted input inside an HTML attribute, for example in atitleattribute or a<meta content>tag, are affected. Output rendered as element content is not affected.Details
strip_tagsnow encodes"and'in its output, as well as&,<and>, without double-encoding existing entities. Applications that usestrip_tagsoutput outside HTML, such as in a text template or JSON, now see"and'where they saw"and';CGI.unescapeHTMLdecodes them. See the Action View CHANGELOG.Workarounds
Pass
strip_tagsoutput to an attribute through a tag helper, which escapes attribute values, for exampletag.a(title: strip_tags(user_input)).Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/568b19cb860322885593e308a7f27aceb779e9d7.patch
- 8.0: https://github.com/rails/rails/commit/c3772a10f405f9644125cbb484adfd2aa7a25a59.patch
Credit
This issue was responsibly reported by HackerOne researcher lucasluitjes.
π¨ Action View: Possible XSS vulnerability in highlight helper
Impact
ActionView::Helpers::TextHelper#highlightsubstitutes each matched phrase into the:highlighterstring without escaping it and returns the result marked HTML-safe. Because sanitizing leaves quote characters in text unescaped, a match substituted into a quoted attribute value of the highlighter, such as the<a href="search?q=\1">form shown in the method's documentation, could end the attribute value and add attributes to the element, possibly leading to XSS. Applications are affected when they pass a:highlighterthat places a placeholder inside an attribute value and highlight text or phrases that a user controls. The default<mark>\1</mark>highlighter and the block form are not affected.Details
The fixed releases HTML-escape each group substituted into the
:highlighterstring, so quotes in a match are rendered as"and'. Only the numbered placeholders\0to\9are expanded; otherString#subreplacement escapes, such as\k<name>,\&and\\, are left as written. A match can no longer begin on the>that closes a preceding tag. Escaping makes a placeholder safe as element content or inside a quoted attribute value, but not in an unquoted attribute value, a URL, JavaScript or CSS context, or an attribute whose value is HTML. See the Action View CHANGELOG for details.Workarounds
Use a
:highlighterthat places the matched phrase only in element content, such as the default<mark>\1</mark>.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/06938194b4fd59e1d2c8ab4a781f3c1e2b763425.patch
- 8.0: https://github.com/rails/rails/commit/c796f6198837479ada13290eb8fa767b5219a58a.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-THHUJQVO).
π¨ Action View: Possible XSS vulnerability in tag helpers
Impact
The fix for CVE-2026-33168 skips blank HTML attribute names in Action View tag helpers, but it tests the name before converting it to a string. A Symbol name made only of whitespace, such as
:" ", is not blank, becauseSymbol#blank?isSymbol#empty?, so it reaches the attribute escaping, which emits an attribute with no name and produces malformed HTML. The asset tag helpers, such asimage_tag,video_tagandaudio_tag, symbolize their options, so a whitespace String name passed to them takes the same path. A carefully crafted attribute value could then be misinterpreted by the browser as a separate attribute name, possibly leading to XSS. Applications that allow users to specify custom HTML attribute names are affected.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/9190210606ffe52f92fdc75637f8ff69404f22c8.patch
- 8.0: https://github.com/rails/rails/commit/f47452533e1f28d847c63181b9d5f8b7243ef9a4.patch
Credit
This issue was responsibly reported by HackerOne researcher thepo1es.
π¨ Action View: Possible XSS vulnerability in text helpers
Impact
With the HTML5 sanitizer (
Rails::HTML5::Sanitizer, the default vendor on CRuby for applications usingload_defaults 7.1or later), Nokogiri before 1.19.5 serializes<and>unescaped inside attribute values. The Action View text helpershighlightandsimple_formatsanitize their input and then process the resulting HTML as a string:highlightsplits it on tag boundaries to insert matches, andsimple_formatsplits it into paragraphs on blank lines. An unescaped>or a blank line inside an attribute value could cause markup in that value, which the sanitizer left inert, to be emitted as live elements in the helper'shtml_safeoutput, possibly leading to XSS. Applications that use the HTML5 sanitizer and pass untrusted text tohighlight, or tosimple_formatwithhtml_options, are affected.Details
The fixed releases require rails-html-sanitizer 1.7.2 or later, which requires Loofah 2.25.3 and Nokogiri 1.19.5. With these versions, the HTML5 sanitizer escapes
<and>in attribute values as<and>, as the HTML4 sanitizer already does. The parsed DOM is unchanged, but code or tests that compare sanitized HTML as a string may see the new serialization.Workarounds
Upgrade Nokogiri to 1.19.5 or later; the escaping is in its HTML5 serializer, so no Rails upgrade is needed. Alternatively, use the HTML4 sanitizer by setting
config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73.patch
- 8.0: https://github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11.patch
Credit
This issue was responsibly reported by HackerOne researcher azaran.
This issue was also found by the Anthropic OSS Scanner (ANT-2026-RTK47OH0).
π¨ Action View: Possible XSS vulnerability in strip_tags
Impact
strip_tagsin Action View returns its sanitized output markedhtml_safe, but the underlying sanitizer encodes only&,<and>, leaving"and'unencoded. Because ERB does not escape a string markedhtml_safe, untrusted input passed throughstrip_tagsand rendered inside a quoted HTML attribute value could close the attribute and add new attributes, possibly leading to XSS. Applications that renderstrip_tagsoutput from untrusted input inside an HTML attribute, for example in atitleattribute or a<meta content>tag, are affected. Output rendered as element content is not affected.Details
strip_tagsnow encodes"and'in its output, as well as&,<and>, without double-encoding existing entities. Applications that usestrip_tagsoutput outside HTML, such as in a text template or JSON, now see"and'where they saw"and';CGI.unescapeHTMLdecodes them. See the Action View CHANGELOG.Workarounds
Pass
strip_tagsoutput to an attribute through a tag helper, which escapes attribute values, for exampletag.a(title: strip_tags(user_input)).Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/568b19cb860322885593e308a7f27aceb779e9d7.patch
- 8.0: https://github.com/rails/rails/commit/c3772a10f405f9644125cbb484adfd2aa7a25a59.patch
Credit
This issue was responsibly reported by HackerOne researcher lucasluitjes.
π¨ Possible XSS vulnerability in Action View strip_tags
Impact
strip_tagsin Action View returns its sanitized output markedhtml_safe,
but the underlying sanitizer encodes only&,<and>, leaving"and
'unencoded. Because ERB does not escape a string markedhtml_safe,
untrusted input passed throughstrip_tagsand rendered inside a quoted HTML
attribute value could close the attribute and add new attributes, possibly
leading to XSS. Applications that renderstrip_tagsoutput from untrusted
input inside an HTML attribute, for example in atitleattribute or a
<meta content>tag, are affected. Output rendered as element content is not
affected.Details
strip_tagsnow encodes"and'in its output, as well as&,<and
>, without double-encoding existing entities. Applications that use
strip_tagsoutput outside HTML, such as in a text template or JSON, now see
"and'where they saw"and';CGI.unescapeHTMLdecodes
them. See the Action View CHANGELOG.Workarounds
Pass
strip_tagsoutput to an attribute through a tag helper, which escapes
attribute values, for exampletag.a(title: strip_tags(user_input)).Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/568b19cb860322885593e308a7f27aceb779e9d7.patch- 8.0:
https://github.com/rails/rails/commit/c3772a10f405f9644125cbb484adfd2aa7a25a59.patchCredit
This issue was responsibly reported by HackerOne researcher
lucasluitjes.
π¨ Possible XSS vulnerability in Action View highlight helper
Impact
ActionView::Helpers::TextHelper#highlightsubstitutes each matched phrase
into the:highlighterstring without escaping it and returns the result
marked HTML-safe. Because sanitizing leaves quote characters in text
unescaped, a match substituted into a quoted attribute value of the
highlighter, such as the<a href="search?q=\1">form shown in the method's
documentation, could end the attribute value and add attributes to the
element, possibly leading to XSS. Applications are affected when they pass a
:highlighterthat places a placeholder inside an attribute value and
highlight text or phrases that a user controls. The default<mark>\1</mark>
highlighter and the block form are not affected.Details
The fixed releases HTML-escape each group substituted into the
:highlighter
string, so quotes in a match are rendered as"and'. Only the
numbered placeholders\0to\9are expanded; otherString#sub
replacement escapes, such as\k<name>,\&and\\, are left as written. A
match can no longer begin on the>that closes a preceding tag. Escaping
makes a placeholder safe as element content or inside a quoted attribute
value, but not in an unquoted attribute value, a URL, JavaScript or CSS
context, or an attribute whose value is HTML. See the Action View CHANGELOG
for details.Workarounds
Use a
:highlighterthat places the matched phrase only in element content,
such as the default<mark>\1</mark>.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/06938194b4fd59e1d2c8ab4a781f3c1e2b763425.patch- 8.0:
https://github.com/rails/rails/commit/c796f6198837479ada13290eb8fa767b5219a58a.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-THHUJQVO).
π¨ Possible XSS vulnerability in Action View strip_tags
Impact
strip_tagsin Action View returns its sanitized output markedhtml_safe,
but the underlying sanitizer encodes only&,<and>, leaving"and
'unencoded. Because ERB does not escape a string markedhtml_safe,
untrusted input passed throughstrip_tagsand rendered inside a quoted HTML
attribute value could close the attribute and add new attributes, possibly
leading to XSS. Applications that renderstrip_tagsoutput from untrusted
input inside an HTML attribute, for example in atitleattribute or a
<meta content>tag, are affected. Output rendered as element content is not
affected.Details
strip_tagsnow encodes"and'in its output, as well as&,<and
>, without double-encoding existing entities. Applications that use
strip_tagsoutput outside HTML, such as in a text template or JSON, now see
"and'where they saw"and';CGI.unescapeHTMLdecodes
them. See the Action View CHANGELOG.Workarounds
Pass
strip_tagsoutput to an attribute through a tag helper, which escapes
attribute values, for exampletag.a(title: strip_tags(user_input)).Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/568b19cb860322885593e308a7f27aceb779e9d7.patch- 8.0:
https://github.com/rails/rails/commit/c3772a10f405f9644125cbb484adfd2aa7a25a59.patchCredit
This issue was responsibly reported by HackerOne researcher
lucasluitjes.
π¨ Possible XSS vulnerability in Action View highlight helper
Impact
ActionView::Helpers::TextHelper#highlightsubstitutes each matched phrase
into the:highlighterstring without escaping it and returns the result
marked HTML-safe. Because sanitizing leaves quote characters in text
unescaped, a match substituted into a quoted attribute value of the
highlighter, such as the<a href="search?q=\1">form shown in the method's
documentation, could end the attribute value and add attributes to the
element, possibly leading to XSS. Applications are affected when they pass a
:highlighterthat places a placeholder inside an attribute value and
highlight text or phrases that a user controls. The default<mark>\1</mark>
highlighter and the block form are not affected.Details
The fixed releases HTML-escape each group substituted into the
:highlighter
string, so quotes in a match are rendered as"and'. Only the
numbered placeholders\0to\9are expanded; otherString#sub
replacement escapes, such as\k<name>,\&and\\, are left as written. A
match can no longer begin on the>that closes a preceding tag. Escaping
makes a placeholder safe as element content or inside a quoted attribute
value, but not in an unquoted attribute value, a URL, JavaScript or CSS
context, or an attribute whose value is HTML. See the Action View CHANGELOG
for details.Workarounds
Use a
:highlighterthat places the matched phrase only in element content,
such as the default<mark>\1</mark>.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/06938194b4fd59e1d2c8ab4a781f3c1e2b763425.patch- 8.0:
https://github.com/rails/rails/commit/c796f6198837479ada13290eb8fa767b5219a58a.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-THHUJQVO).
π¨ Possible XSS vulnerability in Action View tag helpers
Impact
The fix for
CVE-2026-33168
skips blank HTML attribute names in Action View tag helpers, but it tests the
name before converting it to a string. A Symbol name made only of whitespace,
such as:" ", is not blank, becauseSymbol#blank?isSymbol#empty?, so
it reaches the attribute escaping, which emits an attribute with no name and
produces malformed HTML. The asset tag helpers, such asimage_tag,
video_tagandaudio_tag, symbolize their options, so a whitespace String
name passed to them takes the same path. A carefully crafted attribute value
could then be misinterpreted by the browser as a separate attribute name,
possibly leading to XSS. Applications that allow users to specify custom HTML
attribute names are affected.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/9190210606ffe52f92fdc75637f8ff69404f22c8.patch- 8.0:
https://github.com/rails/rails/commit/f47452533e1f28d847c63181b9d5f8b7243ef9a4.patchCredit
This issue was responsibly reported by HackerOne researcher
thepo1es.
π¨ Possible XSS vulnerability in Action View text helpers
Impact
With the HTML5 sanitizer (
Rails::HTML5::Sanitizer, the default vendor on
CRuby for applications usingload_defaults 7.1or later), Nokogiri before
1.19.5 serializes<and>unescaped inside attribute values. The Action
View text helpershighlightandsimple_formatsanitize their input and
then process the resulting HTML as a string:highlightsplits it on tag
boundaries to insert matches, andsimple_formatsplits it into paragraphs on
blank lines. An unescaped>or a blank line inside an attribute value could
cause markup in that value, which the sanitizer left inert, to be emitted as
live elements in the helper'shtml_safeoutput, possibly leading to XSS.
Applications that use the HTML5 sanitizer and pass untrusted text to
highlight, or tosimple_formatwithhtml_options, are affected.Details
The fixed releases require rails-html-sanitizer 1.7.2 or later, which requires
Loofah 2.25.3 and Nokogiri 1.19.5. With these versions, the HTML5 sanitizer
escapes<and>in attribute values as<and>, as the HTML4
sanitizer already does. The parsed DOM is unchanged, but code or tests that
compare sanitized HTML as a string may see the new serialization.Workarounds
Upgrade Nokogiri to 1.19.5 or later; the escaping is in its HTML5 serializer,
so no Rails upgrade is needed. Alternatively, use the HTML4 sanitizer by
settingconfig.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73.patch- 8.0:
https://github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11.patchCredit
This issue was responsibly reported by HackerOne researcher
azaran.
This issue was also found by the Anthropic OSS Scanner (ANT-2026-RTK47OH0).
π¨ Possible XSS vulnerability in Action View text helpers
Impact
With the HTML5 sanitizer (
Rails::HTML5::Sanitizer, the default vendor on
CRuby for applications usingload_defaults 7.1or later), Nokogiri before
1.19.5 serializes<and>unescaped inside attribute values. The Action
View text helpershighlightandsimple_formatsanitize their input and
then process the resulting HTML as a string:highlightsplits it on tag
boundaries to insert matches, andsimple_formatsplits it into paragraphs on
blank lines. An unescaped>or a blank line inside an attribute value could
cause markup in that value, which the sanitizer left inert, to be emitted as
live elements in the helper'shtml_safeoutput, possibly leading to XSS.
Applications that use the HTML5 sanitizer and pass untrusted text to
highlight, or tosimple_formatwithhtml_options, are affected.Details
The fixed releases require rails-html-sanitizer 1.7.2 or later, which requires
Loofah 2.25.3 and Nokogiri 1.19.5. With these versions, the HTML5 sanitizer
escapes<and>in attribute values as<and>, as the HTML4
sanitizer already does. The parsed DOM is unchanged, but code or tests that
compare sanitized HTML as a string may see the new serialization.Workarounds
Upgrade Nokogiri to 1.19.5 or later; the escaping is in its HTML5 serializer,
so no Rails upgrade is needed. Alternatively, use the HTML4 sanitizer by
settingconfig.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/adc3a32d4abea77ed3aacf6f5fb71cfc005bef73.patch- 8.0:
https://github.com/rails/rails/commit/009ea68342d05d02087c04dae7faaa4e4c1def11.patchCredit
This issue was responsibly reported by HackerOne researcher
azaran.
This issue was also found by the Anthropic OSS Scanner (ANT-2026-RTK47OH0).
π¨ Possible XSS vulnerability in Action View tag helpers
Impact
The fix for
CVE-2026-33168
skips blank HTML attribute names in Action View tag helpers, but it tests the
name before converting it to a string. A Symbol name made only of whitespace,
such as:" ", is not blank, becauseSymbol#blank?isSymbol#empty?, so
it reaches the attribute escaping, which emits an attribute with no name and
produces malformed HTML. The asset tag helpers, such asimage_tag,
video_tagandaudio_tag, symbolize their options, so a whitespace String
name passed to them takes the same path. A carefully crafted attribute value
could then be misinterpreted by the browser as a separate attribute name,
possibly leading to XSS. Applications that allow users to specify custom HTML
attribute names are affected.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/9190210606ffe52f92fdc75637f8ff69404f22c8.patch- 8.0:
https://github.com/rails/rails/commit/f47452533e1f28d847c63181b9d5f8b7243ef9a4.patchCredit
This issue was responsibly reported by HackerOne researcher
thepo1es.
π¨ Rails has a possible XSS vulnerability in its Action View tag helpers
Impact
When a blank string is used as an HTML attribute name in Action View tag helpers, the attribute escaping is bypassed, producing malformed HTML. A carefully crafted attribute value could then be misinterpreted by the browser as a separate attribute name, possibly leading to XSS. Applications that allow users to specify custom HTML attributes are affected.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher taise.
π¨ Rails has a possible XSS vulnerability in its Action View tag helpers
Impact
When a blank string is used as an HTML attribute name in Action View tag helpers, the attribute escaping is bypassed, producing malformed HTML. A carefully crafted attribute value could then be misinterpreted by the browser as a separate attribute name, possibly leading to XSS. Applications that allow users to specify custom HTML attributes are affected.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher taise.
π¨ Rails has a possible XSS vulnerability in its Action View tag helpers
Impact
When a blank string is used as an HTML attribute name in Action View tag helpers, the attribute escaping is bypassed, producing malformed HTML. A carefully crafted attribute value could then be misinterpreted by the browser as a separate attribute name, possibly leading to XSS. Applications that allow users to specify custom HTML attributes are affected.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher taise.
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ activejob (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ activemodel (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ activerecord (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Active Record logging vulnerable to ANSI escape injection
This vulnerability has been assigned the CVE identifier CVE-2025-55193
Impact
The ID passed to
findor similar methods may be logged without escaping. If this is directly to the terminal it may include unescaped ANSI sequences.Releases
The fixed releases are available at the normal locations.
Credits
Thanks to lio346 from Unit 515 of OPSWAT for reporting this vulnerability
π¨ Active Record logging vulnerable to ANSI escape injection
This vulnerability has been assigned the CVE identifier CVE-2025-55193
Impact
The ID passed to
findor similar methods may be logged without escaping. If this is directly to the terminal it may include unescaped ANSI sequences.Releases
The fixed releases are available at the normal locations.
Credits
Thanks to lio346 from Unit 515 of OPSWAT for reporting this vulnerability
π¨ Active Record logging vulnerable to ANSI escape injection
This vulnerability has been assigned the CVE identifier CVE-2025-55193
Impact
The ID passed to
findor similar methods may be logged without escaping. If this is directly to the terminal it may include unescaped ANSI sequences.Releases
The fixed releases are available at the normal locations.
Credits
Thanks to lio346 from Unit 515 of OPSWAT for reporting this vulnerability
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ activestorage (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Active Storage: Possible arbitrary file write and read in image analysis
Impact
A Rails application that processes attachments with ImageMagick may allow an unauthenticated attacker to write arbitrary files on the server and, when attachments are stored with the Disk service, to read arbitrary files readable by the application process. Those files typically include
secret_key_baseand credentials for external systems, which may in turn allow escalation to remote code execution or lateral movement to those systems.Details
ImageMagick selects a coder from the content of the file it is given, and some coders act on files named inside the image rather than on the image itself. Active Storage constrained none of ImageMagick's coders, and the ImageMagick analyzer runs when a file is attached, so an attacker who can upload a crafted file may be able to invoke one. Attaching the upload is sufficient; no variant, preview, or
analyzecall is required. One specific attack chain has been reported to us, but we do not assume it is the only one that exists.The fixed versions ship an ImageMagick security policy and prepend its directory to
MAGICK_CONFIGURE_PATHthroughMiniMagick.cli_env, so every ImageMagick process that MiniMagick spawns applies it. The policy denies theMSLscripting coder, the coders that read or delete files other than the image, fetch remote or local references, or display to a screen, every coder backed by Ghostscript together with thegsdelegate, and@filenameindirection. ImageMagick applies everypolicy.xmlon its search path, so the shipped policy adds to the host's policy rather than replacing it. The policy applies to every ImageMagick command that MiniMagick runs, not only those of Active Storage. See theactivestorageCHANGELOG and "ImageMagick Security Policy" in the Active Storage guide.Affected applications
An application is affected if it meets all of these requirements:
- Uses ImageMagick for Active Storage image processing. This is
config.active_storage.variant_processor = :mini_magick, which is the default for applications onload_defaults 6.1or earlier.- Runs ImageMagick under a security policy that does not already deny the coders involved. The policies that Debian and Ubuntu package do not.
- Allows file uploads from untrusted users.
Mitigation
- Upgrade to a fixed version of
activestorage.- An application whose variant processor is
:mini_magickmust use mini_magick>= 5.1, which applying the policy requires. With an older mini_magick, such an application raises an exception during boot.- An application that renders PostScript or PDF through ImageMagick must re-allow the
gsdelegate and the coders it uses in the host'spolicy.xml.- An application that replaces
MiniMagick.cli_envafter boot, clears the environment withMiniMagick.cli_prefix, or installs its ownMiniMagick::Shelldoes not receive the shipped policy and must carry its rules in ImageMagick's system policy. GraphicsMagick does not read ImageMagick policies.- If attachments are stored with the Disk service, change
secret_key_baseand every secret readable by the application process, including the master key and everythingconfig/credentials.yml.encholds, storage and database credentials, and third-party tokens. Do not retain an exposed secret as a fallback.Workarounds
Copy the rules of the policy that the fixed versions ship,
activestorage/lib/active_storage/image_magick/policy.xml, into ImageMagick's system policy, for example/etc/ImageMagick-7/policy.xml. At a minimum, deny theMSLcoder, the Ghostscript coders, and thegsdelegate:<policy domain="coder" rights="none" pattern="MSL"/> <policy domain="delegate" rights="none" pattern="gs"/> <policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}"/>Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher ryotak.
References
- ImageMagick security policy
π¨ Active Storage: Unsigned Content-Type in GCS direct uploads with cache_control
Impact
When a GCS service is configured with the
cache_controloption,ActiveStorage::Service::GCSService#url_for_direct_uploadsigns direct-upload URLs with V4, and the V4 signature covers only theCache-ControlandHostheaders. A direct-upload client can therefore send aContent-Typeof its choosing, and can omit the declaredContent-MD5, without invalidating the URL. GCS stores the supplied content type as object metadata, which takes precedence over theresponse-content-typethat Active Storage sets on download URLs, so an uploaded object could be served as inline HTML under the application's bucket path onstorage.googleapis.com. Script in such an object runs on the storage origin rather than the application's, but could register a Service Worker scoped to the bucket path and read or replace a victim's later responses for signed URLs in that bucket.Applications that use the GCS service with
cache_controlconfigured and accept direct uploads are affected. GCS services withoutcache_controlsign with V2 and are not affected.Details
The fixed releases sign every GCS direct-upload URL with V2, which binds an empty
Content-Typeand the declaredContent-MD5. The configuredCache-Controlis still returned byheaders_for_direct_uploadand sent by the client, but it is no longer part of the signature, and direct-upload URLs for these services are no longer limited to V4's seven-day maximum expiry. See the Active Storage CHANGELOG.Workarounds
Removing the
cache_controloption from the GCS service configuration makes Active Storage sign direct uploads with V2.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/8d93f6a872e9550a91bf0e4fce50083a235ef3b1.patch
- 8.0: https://github.com/rails/rails/commit/ddc08ba61a8001e7402864c62e466cf732fc7614.patch
Credit
This issue was responsibly reported by HackerOne researcher thepo1es.
π¨ Active Storage: Possible local file disclosure in video previews and analysis
Impact
Active Storage's
VideoPreviewer,VideoAnalyzerandAudioAnalyzerrunffmpegandffprobeon a blob's contents without restricting the input format, so FFmpeg selects a demuxer by probing the file. A blob created through a direct upload keeps the content type the client declared, so a client can store an HLS playlist under avideo/*oraudio/*type. When that blob is previewed or analyzed, thehlsdemuxer opens thefile://segments that the playlist names, and the preview image or the stored metadata could disclose a local media file that the application process can read and whose path the attacker knows.Applications that accept uploads from untrusted users and generate video previews, or analyze video or audio attachments with FFmpeg, are affected.
Details
The fixed releases limit the formats FFmpeg may open to common audio and video containers, configured by the new
config.active_storage.ffmpeg_allowed_formatssetting. Files in other formats no longer preview or receive media metadata; the Active Storage CHANGELOG names some of them and shows how to add a format to the list.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg on uploaded files by removing
ActiveStorage::Previewer::VideoPreviewerfromconfig.active_storage.previewers, andActiveStorage::Analyzer::VideoAnalyzerandActiveStorage::Analyzer::AudioAnalyzerfromconfig.active_storage.analyzers.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/3b1f2627538dc597cd973530c08514a26c2b0282.patch
- 8.0: https://github.com/rails/rails/commit/69aff80d115bbb9d1e82fd6c6f2fd3ddeafb958b.patch
Credit
This issue was responsibly reported by HackerOne researcher w3rmut.
π¨ Active Storage: Unsigned Content-Type in GCS direct uploads with cache_control
Impact
When a GCS service is configured with the
cache_controloption,ActiveStorage::Service::GCSService#url_for_direct_uploadsigns direct-upload URLs with V4, and the V4 signature covers only theCache-ControlandHostheaders. A direct-upload client can therefore send aContent-Typeof its choosing, and can omit the declaredContent-MD5, without invalidating the URL. GCS stores the supplied content type as object metadata, which takes precedence over theresponse-content-typethat Active Storage sets on download URLs, so an uploaded object could be served as inline HTML under the application's bucket path onstorage.googleapis.com. Script in such an object runs on the storage origin rather than the application's, but could register a Service Worker scoped to the bucket path and read or replace a victim's later responses for signed URLs in that bucket.Applications that use the GCS service with
cache_controlconfigured and accept direct uploads are affected. GCS services withoutcache_controlsign with V2 and are not affected.Details
The fixed releases sign every GCS direct-upload URL with V2, which binds an empty
Content-Typeand the declaredContent-MD5. The configuredCache-Controlis still returned byheaders_for_direct_uploadand sent by the client, but it is no longer part of the signature, and direct-upload URLs for these services are no longer limited to V4's seven-day maximum expiry. See the Active Storage CHANGELOG.Workarounds
Removing the
cache_controloption from the GCS service configuration makes Active Storage sign direct uploads with V2.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/8d93f6a872e9550a91bf0e4fce50083a235ef3b1.patch
- 8.0: https://github.com/rails/rails/commit/ddc08ba61a8001e7402864c62e466cf732fc7614.patch
Credit
This issue was responsibly reported by HackerOne researcher thepo1es.
π¨ Active Storage: Possible local file disclosure in video previews and analysis
Impact
Active Storage's
VideoPreviewer,VideoAnalyzerandAudioAnalyzerrunffmpegandffprobeon a blob's contents without restricting the input format, so FFmpeg selects a demuxer by probing the file. A blob created through a direct upload keeps the content type the client declared, so a client can store an HLS playlist under avideo/*oraudio/*type. When that blob is previewed or analyzed, thehlsdemuxer opens thefile://segments that the playlist names, and the preview image or the stored metadata could disclose a local media file that the application process can read and whose path the attacker knows.Applications that accept uploads from untrusted users and generate video previews, or analyze video or audio attachments with FFmpeg, are affected.
Details
The fixed releases limit the formats FFmpeg may open to common audio and video containers, configured by the new
config.active_storage.ffmpeg_allowed_formatssetting. Files in other formats no longer preview or receive media metadata; the Active Storage CHANGELOG names some of them and shows how to add a format to the list.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg on uploaded files by removing
ActiveStorage::Previewer::VideoPreviewerfromconfig.active_storage.previewers, andActiveStorage::Analyzer::VideoAnalyzerandActiveStorage::Analyzer::AudioAnalyzerfromconfig.active_storage.analyzers.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/3b1f2627538dc597cd973530c08514a26c2b0282.patch
- 8.0: https://github.com/rails/rails/commit/69aff80d115bbb9d1e82fd6c6f2fd3ddeafb958b.patch
Credit
This issue was responsibly reported by HackerOne researcher w3rmut.
π¨ Active Storage: Possible arbitrary file write and read in image analysis
Impact
A Rails application that processes attachments with ImageMagick may allow an unauthenticated attacker to write arbitrary files on the server and, when attachments are stored with the Disk service, to read arbitrary files readable by the application process. Those files typically include
secret_key_baseand credentials for external systems, which may in turn allow escalation to remote code execution or lateral movement to those systems.Details
ImageMagick selects a coder from the content of the file it is given, and some coders act on files named inside the image rather than on the image itself. Active Storage constrained none of ImageMagick's coders, and the ImageMagick analyzer runs when a file is attached, so an attacker who can upload a crafted file may be able to invoke one. Attaching the upload is sufficient; no variant, preview, or
analyzecall is required. One specific attack chain has been reported to us, but we do not assume it is the only one that exists.The fixed versions ship an ImageMagick security policy and prepend its directory to
MAGICK_CONFIGURE_PATHthroughMiniMagick.cli_env, so every ImageMagick process that MiniMagick spawns applies it. The policy denies theMSLscripting coder, the coders that read or delete files other than the image, fetch remote or local references, or display to a screen, every coder backed by Ghostscript together with thegsdelegate, and@filenameindirection. ImageMagick applies everypolicy.xmlon its search path, so the shipped policy adds to the host's policy rather than replacing it. The policy applies to every ImageMagick command that MiniMagick runs, not only those of Active Storage. See theactivestorageCHANGELOG and "ImageMagick Security Policy" in the Active Storage guide.Affected applications
An application is affected if it meets all of these requirements:
- Uses ImageMagick for Active Storage image processing. This is
config.active_storage.variant_processor = :mini_magick, which is the default for applications onload_defaults 6.1or earlier.- Runs ImageMagick under a security policy that does not already deny the coders involved. The policies that Debian and Ubuntu package do not.
- Allows file uploads from untrusted users.
Mitigation
- Upgrade to a fixed version of
activestorage.- An application whose variant processor is
:mini_magickmust use mini_magick>= 5.1, which applying the policy requires. With an older mini_magick, such an application raises an exception during boot.- An application that renders PostScript or PDF through ImageMagick must re-allow the
gsdelegate and the coders it uses in the host'spolicy.xml.- An application that replaces
MiniMagick.cli_envafter boot, clears the environment withMiniMagick.cli_prefix, or installs its ownMiniMagick::Shelldoes not receive the shipped policy and must carry its rules in ImageMagick's system policy. GraphicsMagick does not read ImageMagick policies.- If attachments are stored with the Disk service, change
secret_key_baseand every secret readable by the application process, including the master key and everythingconfig/credentials.yml.encholds, storage and database credentials, and third-party tokens. Do not retain an exposed secret as a fallback.Workarounds
Copy the rules of the policy that the fixed versions ship,
activestorage/lib/active_storage/image_magick/policy.xml, into ImageMagick's system policy, for example/etc/ImageMagick-7/policy.xml. At a minimum, deny theMSLcoder, the Ghostscript coders, and thegsdelegate:<policy domain="coder" rights="none" pattern="MSL"/> <policy domain="delegate" rights="none" pattern="gs"/> <policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}"/>Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher ryotak.
References
- ImageMagick security policy
π¨ Active Storage: Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage
Impact
ActiveStorage::Service::GCSService#url_for_direct_uploaddoes not bind the declared content length into the signed direct-upload URL, and#headers_for_direct_uploadreturns no length constraint, so the URL authorizes an upload body of any size. A direct-upload client could store a file larger than thebyte_sizeit declared, and the resulting blob keeps the declared size, possibly bypassing application file size validations and quotas. This is the weakness that CVE-2020-8162 fixed in the S3 service.Applications that store files in Google Cloud Storage and accept direct uploads are affected.
Details
The fixed releases sign an
x-goog-content-length-rangeheader that matches the blob's declaredbyte_sizeand return it fromheaders_for_direct_upload, so Cloud Storage rejects an upload body of any other size. Browsers send this header with the direct upload, so a bucket's CORS configuration must listx-goog-content-length-rangeinresponseHeader, or browser direct uploads fail after the upgrade. The Active Storage CHANGELOG and the CORS example in the Active Storage guide show the change.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/e19916cea31cbfb0030b165ae853b741f8dd57a7.patch
- 8.0: https://github.com/rails/rails/commit/7fe85a72a789eae5ee070ce3ee1dad10a8a5f70c.patch
Credit
This issue was responsibly reported by HackerOne researcher f4cts.
π¨ Active Storage: Possible DoS vulnerability in Active Storage proxy mode via storage errors during streaming
Impact
When Active Storage serves a file through its proxy controllers,
ActiveStorage::Streaming#send_blob_streamhandles an error from the storage service by callingheadto send a 404 or 500 response. If the error occurs after the first chunk has been written, the response is already committed, andheadreplaces the response body while the server is still reading the originalActionController::Livebuffer. That buffer is never closed, so the server thread handling the request blocks until the process restarts. Repeated failed downloads could exhaust the server's threads, possibly resulting in a DoS vulnerability.Applications are affected when they store files on a service that streams a download in several requests, such as Amazon S3, an S3-compatible service or Google Cloud Storage, and draw Active Storage's default routes. The proxy routes are drawn whether or not proxy mode is the default for the application. A file deleted while it is being served, or any other storage error partway through a download, triggers the condition.
Details
A storage error raised before the response is committed still produces a 404 or 500 response. After the fix, a storage error raised after the response is committed is re-raised instead, so the server closes the streamed response and releases the thread; the client receives a truncated body, and the exception reaches the application's error reporting.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/3c67a693fb21870ecb1222e3da59d5c491a62009.patch
- 8.0: https://github.com/rails/rails/commit/655b4442de136a3701334607f634d698bf9d5b82.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-FMPUMYTB).
π¨ Active Storage: Possible DoS vulnerability in Active Storage filename handling
Impact
ActiveStorage::Filename#baseand#extension_with_delimiter, and therefore#extension, pass the stored filename unmodified toFile.basenameandFile.extname, which raiseArgumentErrorwhen the name contains a NUL byte. Active Storage stores the client-supplied filename verbatim, so a user who is permitted to upload an attachment could persist such a filename on databases that accept NUL bytes in string columns, such as SQLite and MySQL/MariaDB. Each subsequent request that builds a variant or preview of the blob, opens it, or renders it as an Action Text attachment then raises, possibly resulting in a persistent DoS vulnerability for the pages that display the blob until it is purged or its filename is corrected. Applications that use PostgreSQL are not affected, because PostgreSQL rejects the row.Details
Filename#baseand#extension_with_delimiternow derive fromFilename#sanitized, the form thatFilename#to_sand theContent-Dispositionheader already use. For a filename that#sanitizedchanges, such as one containing a NUL byte, an invalid byte sequence, a path separator or another replaced character, the base and extension now agree with#to_s; the variant format inferred from such a name may change, and an existing variant may be regenerated once. Stored filenames are not modified, and no data migration is required.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/60f22af88b71eae251f112d8c0237a08a8832692.patch
- 8.0: https://github.com/rails/rails/commit/9b0d4bef2211a2c08cab2e0ea17fa1d0efd5d47a.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-UQM5Z4YL).
π¨ Active Storage: Possible arbitrary file read and remote code execution in video previews, analysis and image processing
Impact
ActiveStorage::Blob#openwrites a blob to a tempfile whose name carries the extension of the uploaded filename, and hands that path toffprobe(VideoAnalyzer,AudioAnalyzer),ffmpeg(VideoPreviewer) and ImageMagick (ImageAnalyzer, the:mini_magickvariant 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.avsextension 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.Details
The 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.
Affected applications
An application is affected if it meets all of these requirements:
- Accepts uploads from untrusted users.
- Analyzes video or audio attachments (which Active Storage does on attach by default), generates video previews, or processes images with ImageMagick.
The AviSynth attack additionally requires an FFmpeg built with
--enable-avisynthand 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.Mitigation
- Upgrade to a fixed version of
activestorage.Expire and change secrets
Upgrading 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 inconfig/credentials.yml.encthat it decrypts, the Active Storage service credentials, database credentials, and tokens for third-party services. Changingsecret_key_baseexpires active sessions and invalidates signed and encrypted cookies, signed global IDs and Active Storage URLs. Do not retain an exposed secret as a fallback.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg on uploaded files by removing
ActiveStorage::Previewer::VideoPreviewerfromconfig.active_storage.previewers, andActiveStorage::Analyzer::VideoAnalyzerandActiveStorage::Analyzer::AudioAnalyzerfromconfig.active_storage.analyzers. Running an FFmpeg built without AviSynth support closes the AviSynth attack but not the extension-selected decoders of ImageMagick.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch
- 8.0: https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher pirikara.
π¨ Active Storage: Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage
Impact
ActiveStorage::Service::GCSService#url_for_direct_uploaddoes not bind the declared content length into the signed direct-upload URL, and#headers_for_direct_uploadreturns no length constraint, so the URL authorizes an upload body of any size. A direct-upload client could store a file larger than thebyte_sizeit declared, and the resulting blob keeps the declared size, possibly bypassing application file size validations and quotas. This is the weakness that CVE-2020-8162 fixed in the S3 service.Applications that store files in Google Cloud Storage and accept direct uploads are affected.
Details
The fixed releases sign an
x-goog-content-length-rangeheader that matches the blob's declaredbyte_sizeand return it fromheaders_for_direct_upload, so Cloud Storage rejects an upload body of any other size. Browsers send this header with the direct upload, so a bucket's CORS configuration must listx-goog-content-length-rangeinresponseHeader, or browser direct uploads fail after the upgrade. The Active Storage CHANGELOG and the CORS example in the Active Storage guide show the change.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/e19916cea31cbfb0030b165ae853b741f8dd57a7.patch
- 8.0: https://github.com/rails/rails/commit/7fe85a72a789eae5ee070ce3ee1dad10a8a5f70c.patch
Credit
This issue was responsibly reported by HackerOne researcher f4cts.
π¨ Active Storage: Possible DoS vulnerability in Active Storage filename handling
Impact
ActiveStorage::Filename#baseand#extension_with_delimiter, and therefore#extension, pass the stored filename unmodified toFile.basenameandFile.extname, which raiseArgumentErrorwhen the name contains a NUL byte. Active Storage stores the client-supplied filename verbatim, so a user who is permitted to upload an attachment could persist such a filename on databases that accept NUL bytes in string columns, such as SQLite and MySQL/MariaDB. Each subsequent request that builds a variant or preview of the blob, opens it, or renders it as an Action Text attachment then raises, possibly resulting in a persistent DoS vulnerability for the pages that display the blob until it is purged or its filename is corrected. Applications that use PostgreSQL are not affected, because PostgreSQL rejects the row.Details
Filename#baseand#extension_with_delimiternow derive fromFilename#sanitized, the form thatFilename#to_sand theContent-Dispositionheader already use. For a filename that#sanitizedchanges, such as one containing a NUL byte, an invalid byte sequence, a path separator or another replaced character, the base and extension now agree with#to_s; the variant format inferred from such a name may change, and an existing variant may be regenerated once. Stored filenames are not modified, and no data migration is required.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/60f22af88b71eae251f112d8c0237a08a8832692.patch
- 8.0: https://github.com/rails/rails/commit/9b0d4bef2211a2c08cab2e0ea17fa1d0efd5d47a.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-UQM5Z4YL).
π¨ Active Storage: Possible DoS vulnerability in Active Storage proxy mode via storage errors during streaming
Impact
When Active Storage serves a file through its proxy controllers,
ActiveStorage::Streaming#send_blob_streamhandles an error from the storage service by callingheadto send a 404 or 500 response. If the error occurs after the first chunk has been written, the response is already committed, andheadreplaces the response body while the server is still reading the originalActionController::Livebuffer. That buffer is never closed, so the server thread handling the request blocks until the process restarts. Repeated failed downloads could exhaust the server's threads, possibly resulting in a DoS vulnerability.Applications are affected when they store files on a service that streams a download in several requests, such as Amazon S3, an S3-compatible service or Google Cloud Storage, and draw Active Storage's default routes. The proxy routes are drawn whether or not proxy mode is the default for the application. A file deleted while it is being served, or any other storage error partway through a download, triggers the condition.
Details
A storage error raised before the response is committed still produces a 404 or 500 response. After the fix, a storage error raised after the response is committed is re-raised instead, so the server closes the streamed response and releases the thread; the client receives a truncated body, and the exception reaches the application's error reporting.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/3c67a693fb21870ecb1222e3da59d5c491a62009.patch
- 8.0: https://github.com/rails/rails/commit/655b4442de136a3701334607f634d698bf9d5b82.patch
Credit
This issue was found by the Anthropic OSS Scanner (ANT-2026-FMPUMYTB).
π¨ Active Storage: Possible arbitrary file read and remote code execution in video previews, analysis and image processing
Impact
ActiveStorage::Blob#openwrites a blob to a tempfile whose name carries the extension of the uploaded filename, and hands that path toffprobe(VideoAnalyzer,AudioAnalyzer),ffmpeg(VideoPreviewer) and ImageMagick (ImageAnalyzer, the:mini_magickvariant 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.avsextension 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.Details
The 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.
Affected applications
An application is affected if it meets all of these requirements:
- Accepts uploads from untrusted users.
- Analyzes video or audio attachments (which Active Storage does on attach by default), generates video previews, or processes images with ImageMagick.
The AviSynth attack additionally requires an FFmpeg built with
--enable-avisynthand 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.Mitigation
- Upgrade to a fixed version of
activestorage.Expire and change secrets
Upgrading 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 inconfig/credentials.yml.encthat it decrypts, the Active Storage service credentials, database credentials, and tokens for third-party services. Changingsecret_key_baseexpires active sessions and invalidates signed and encrypted cookies, signed global IDs and Active Storage URLs. Do not retain an exposed secret as a fallback.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg on uploaded files by removing
ActiveStorage::Previewer::VideoPreviewerfromconfig.active_storage.previewers, andActiveStorage::Analyzer::VideoAnalyzerandActiveStorage::Analyzer::AudioAnalyzerfromconfig.active_storage.analyzers. Running an FFmpeg built without AviSynth support closes the AviSynth attack but not the extension-selected decoders of ImageMagick.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch
- 8.0: https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patch
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher pirikara.
π¨ Possible arbitrary file write and read in Active Storage image analysis
Impact
A Rails application that processes attachments with ImageMagick may allow an
unauthenticated attacker to write arbitrary files on the server and, when
attachments are stored with the Disk service, to read arbitrary files readable
by the application process. Those files typically includesecret_key_base
and credentials for external systems, which may in turn allow escalation to
remote code execution or lateral movement to those systems.Details
ImageMagick selects a coder from the content of the file it is given, and some
coders act on files named inside the image rather than on the image itself.
Active Storage constrained none of ImageMagick's coders, and the ImageMagick
analyzer runs when a file is attached, so an attacker who can upload a crafted
file may be able to invoke one. Attaching the upload is sufficient; no
variant, preview, oranalyzecall is required. One specific attack chain has
been reported to us, but we do not assume it is the only one that exists.The fixed versions ship an ImageMagick security policy and prepend its
directory toMAGICK_CONFIGURE_PATHthroughMiniMagick.cli_env, so every
ImageMagick process that MiniMagick spawns applies it. The policy denies the
MSLscripting coder, the coders that read or delete files other than the
image, fetch remote or local references, or display to a screen, every coder
backed by Ghostscript together with thegsdelegate, and@filename
indirection. ImageMagick applies everypolicy.xmlon its search path, so the
shipped policy adds to the host's policy rather than replacing it. The policy
applies to every ImageMagick command that MiniMagick runs, not only those of
Active Storage. See theactivestorageCHANGELOG and "ImageMagick Security
Policy" in the Active Storage guide.Affected applications
An application is affected if it meets all of these requirements:
- Uses ImageMagick for Active Storage image processing. This is
config.active_storage.variant_processor = :mini_magick, which is the
default for applications onload_defaults 6.1or earlier.- Runs ImageMagick under a security policy that does not already deny the
coders involved. The policies that Debian and Ubuntu package do not.- Allows file uploads from untrusted users.
Mitigation
- Upgrade to a fixed version of
activestorage.- An application whose variant processor is
:mini_magickmust use
mini_magick>= 5.1, which applying the policy requires. With an older
mini_magick, such an application raises an exception during boot.- An application that renders PostScript or PDF through ImageMagick must
re-allow thegsdelegate and the coders it uses in the host's
policy.xml.- An application that replaces
MiniMagick.cli_envafter boot, clears the
environment withMiniMagick.cli_prefix, or installs its own
MiniMagick::Shelldoes not receive the shipped policy and must carry its
rules in ImageMagick's system policy. GraphicsMagick does not read
ImageMagick policies.- If attachments are stored with the Disk service, change
secret_key_base
and every secret readable by the application process, including the master
key and everythingconfig/credentials.yml.encholds, storage and database
credentials, and third-party tokens. Do not retain an exposed secret as a
fallback.Workarounds
Copy the rules of the policy that the fixed versions ship,
activestorage/lib/active_storage/image_magick/policy.xml, into ImageMagick's
system policy, for example/etc/ImageMagick-7/policy.xml. At a minimum, deny
theMSLcoder, the Ghostscript coders, and thegsdelegate:<policy domain="coder" rights="none" pattern="MSL"/> <policy domain="delegate" rights="none" pattern="gs"/> <policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}"/>Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
ryotak.References
- ImageMagick security policy
π¨ Possible local file disclosure in Active Storage video previews and analysis
Impact
Active Storage's
VideoPreviewer,VideoAnalyzerandAudioAnalyzerrun
ffmpegandffprobeon a blob's contents without restricting the input
format, so FFmpeg selects a demuxer by probing the file. A blob created
through a direct upload keeps the content type the client declared, so a
client can store an HLS playlist under avideo/*oraudio/*type. When
that blob is previewed or analyzed, thehlsdemuxer opens thefile://
segments that the playlist names, and the preview image or the stored metadata
could disclose a local media file that the application process can read and
whose path the attacker knows.Applications that accept uploads from untrusted users and generate video
previews, or analyze video or audio attachments with FFmpeg, are affected.Details
The fixed releases limit the formats FFmpeg may open to common audio and video
containers, configured by the new
config.active_storage.ffmpeg_allowed_formatssetting. Files in other formats
no longer preview or receive media metadata; the Active Storage CHANGELOG
names some of them and shows how to add a format to the list.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg
on uploaded files by removingActiveStorage::Previewer::VideoPreviewerfrom
config.active_storage.previewers, and
ActiveStorage::Analyzer::VideoAnalyzerand
ActiveStorage::Analyzer::AudioAnalyzerfrom
config.active_storage.analyzers.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/3b1f2627538dc597cd973530c08514a26c2b0282.patch- 8.0:
https://github.com/rails/rails/commit/69aff80d115bbb9d1e82fd6c6f2fd3ddeafb958b.patchCredit
This issue was responsibly reported by HackerOne researcher
w3rmut.
π¨ Unsigned Content-Type in Active Storage GCS direct uploads with cache_control
Impact
When a GCS service is configured with the
cache_controloption,
ActiveStorage::Service::GCSService#url_for_direct_uploadsigns direct-upload
URLs with V4, and the V4 signature covers only theCache-ControlandHost
headers. A direct-upload client can therefore send aContent-Typeof its
choosing, and can omit the declaredContent-MD5, without invalidating the
URL. GCS stores the supplied content type as object metadata, which takes
precedence over theresponse-content-typethat Active Storage sets on
download URLs, so an uploaded object could be served as inline HTML under the
application's bucket path onstorage.googleapis.com. Script in such an
object runs on the storage origin rather than the application's, but could
register a Service Worker scoped to the bucket path and read or replace a
victim's later responses for signed URLs in that bucket.Applications that use the GCS service with
cache_controlconfigured and
accept direct uploads are affected. GCS services withoutcache_controlsign
with V2 and are not affected.Details
The fixed releases sign every GCS direct-upload URL with V2, which binds an
emptyContent-Typeand the declaredContent-MD5. The configured
Cache-Controlis still returned byheaders_for_direct_uploadand sent by
the client, but it is no longer part of the signature, and direct-upload URLs
for these services are no longer limited to V4's seven-day maximum expiry. See
the Active Storage CHANGELOG.Workarounds
Removing the
cache_controloption from the GCS service configuration makes
Active Storage sign direct uploads with V2.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/8d93f6a872e9550a91bf0e4fce50083a235ef3b1.patch- 8.0:
https://github.com/rails/rails/commit/ddc08ba61a8001e7402864c62e466cf732fc7614.patchCredit
This issue was responsibly reported by HackerOne researcher
thepo1es.
π¨ Possible DoS vulnerability in Active Storage proxy mode via storage errors during streaming
Impact
When Active Storage serves a file through its proxy controllers,
ActiveStorage::Streaming#send_blob_streamhandles an error from the storage
service by callingheadto send a 404 or 500 response. If the error occurs
after the first chunk has been written, the response is already committed, and
headreplaces the response body while the server is still reading the
originalActionController::Livebuffer. That buffer is never closed, so the
server thread handling the request blocks until the process restarts. Repeated
failed downloads could exhaust the server's threads, possibly resulting in a
DoS vulnerability.Applications are affected when they store files on a service that streams a
download in several requests, such as Amazon S3, an S3-compatible service or
Google Cloud Storage, and draw Active Storage's default routes. The proxy
routes are drawn whether or not proxy mode is the default for the application.
A file deleted while it is being served, or any other storage error partway
through a download, triggers the condition.Details
A storage error raised before the response is committed still produces a 404
or 500 response. After the fix, a storage error raised after the response is
committed is re-raised instead, so the server closes the streamed response and
releases the thread; the client receives a truncated body, and the exception
reaches the application's error reporting.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/3c67a693fb21870ecb1222e3da59d5c491a62009.patch- 8.0:
https://github.com/rails/rails/commit/655b4442de136a3701334607f634d698bf9d5b82.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-FMPUMYTB).
π¨ Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage
Impact
ActiveStorage::Service::GCSService#url_for_direct_uploaddoes not bind the
declared content length into the signed direct-upload URL, and
#headers_for_direct_uploadreturns no length constraint, so the URL
authorizes an upload body of any size. A direct-upload client could store a
file larger than thebyte_sizeit declared, and the resulting blob keeps the
declared size, possibly bypassing application file size validations and
quotas. This is the weakness that CVE-2020-8162 fixed in the S3 service.Applications that store files in Google Cloud Storage and accept direct
uploads are affected.Details
The fixed releases sign an
x-goog-content-length-rangeheader that matches
the blob's declaredbyte_sizeand return it from
headers_for_direct_upload, so Cloud Storage rejects an upload body of any
other size. Browsers send this header with the direct upload, so a bucket's
CORS configuration must listx-goog-content-length-rangein
responseHeader, or browser direct uploads fail after the upgrade. The Active
Storage CHANGELOG and the CORS example in the Active Storage guide show the
change.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/e19916cea31cbfb0030b165ae853b741f8dd57a7.patch- 8.0:
https://github.com/rails/rails/commit/7fe85a72a789eae5ee070ce3ee1dad10a8a5f70c.patchCredit
This issue was responsibly reported by HackerOne researcher
f4cts.
π¨ Possible DoS vulnerability in Active Storage filename handling
Impact
ActiveStorage::Filename#baseand#extension_with_delimiter, and therefore
#extension, pass the stored filename unmodified toFile.basenameand
File.extname, which raiseArgumentErrorwhen the name contains a NUL byte.
Active Storage stores the client-supplied filename verbatim, so a user who is
permitted to upload an attachment could persist such a filename on databases
that accept NUL bytes in string columns, such as SQLite and MySQL/MariaDB.
Each subsequent request that builds a variant or preview of the blob, opens
it, or renders it as an Action Text attachment then raises, possibly resulting
in a persistent DoS vulnerability for the pages that display the blob until it
is purged or its filename is corrected. Applications that use PostgreSQL are
not affected, because PostgreSQL rejects the row.Details
Filename#baseand#extension_with_delimiternow derive from
Filename#sanitized, the form thatFilename#to_sand the
Content-Dispositionheader already use. For a filename that#sanitized
changes, such as one containing a NUL byte, an invalid byte sequence, a path
separator or another replaced character, the base and extension now agree with
#to_s; the variant format inferred from such a name may change, and an
existing variant may be regenerated once. Stored filenames are not modified,
and no data migration is required.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/60f22af88b71eae251f112d8c0237a08a8832692.patch- 8.0:
https://github.com/rails/rails/commit/9b0d4bef2211a2c08cab2e0ea17fa1d0efd5d47a.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-UQM5Z4YL).
π¨ Possible arbitrary file read and remote code execution in Active Storage video previews, analysis and image processing
Impact
ActiveStorage::Blob#openwrites a blob to a tempfile whose name carries the
extension of the uploaded filename, and hands that path toffprobe
(VideoAnalyzer,AudioAnalyzer),ffmpeg(VideoPreviewer) and
ImageMagick (ImageAnalyzer, the:mini_magickvariant 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.avsextension 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.Details
The 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.Affected applications
An application is affected if it meets all of these requirements:
- Accepts uploads from untrusted users.
- Analyzes video or audio attachments (which Active Storage does on attach by
default), generates video previews, or processes images with ImageMagick.The AviSynth attack additionally requires an FFmpeg built with
--enable-avisynthand 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.Mitigation
- Upgrade to a fixed version of
activestorage.Expire and change secrets
Upgrading 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, includingsecret_key_base, the master key and everything in
config/credentials.yml.encthat it decrypts, the Active Storage service
credentials, database credentials, and tokens for third-party services.
Changingsecret_key_baseexpires active sessions and invalidates signed and
encrypted cookies, signed global IDs and Active Storage URLs. Do not retain an
exposed secret as a fallback.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg
on uploaded files by removingActiveStorage::Previewer::VideoPreviewerfrom
config.active_storage.previewers, and
ActiveStorage::Analyzer::VideoAnalyzerand
ActiveStorage::Analyzer::AudioAnalyzerfrom
config.active_storage.analyzers. Running an FFmpeg built without AviSynth
support closes the AviSynth attack but not the extension-selected decoders of
ImageMagick.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch- 8.0:
https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patchVersions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
pirikara.
π¨ Possible local file disclosure in Active Storage video previews and analysis
Impact
Active Storage's
VideoPreviewer,VideoAnalyzerandAudioAnalyzerrun
ffmpegandffprobeon a blob's contents without restricting the input
format, so FFmpeg selects a demuxer by probing the file. A blob created
through a direct upload keeps the content type the client declared, so a
client can store an HLS playlist under avideo/*oraudio/*type. When
that blob is previewed or analyzed, thehlsdemuxer opens thefile://
segments that the playlist names, and the preview image or the stored metadata
could disclose a local media file that the application process can read and
whose path the attacker knows.Applications that accept uploads from untrusted users and generate video
previews, or analyze video or audio attachments with FFmpeg, are affected.Details
The fixed releases limit the formats FFmpeg may open to common audio and video
containers, configured by the new
config.active_storage.ffmpeg_allowed_formatssetting. Files in other formats
no longer preview or receive media metadata; the Active Storage CHANGELOG
names some of them and shows how to add a format to the list.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg
on uploaded files by removingActiveStorage::Previewer::VideoPreviewerfrom
config.active_storage.previewers, and
ActiveStorage::Analyzer::VideoAnalyzerand
ActiveStorage::Analyzer::AudioAnalyzerfrom
config.active_storage.analyzers.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/3b1f2627538dc597cd973530c08514a26c2b0282.patch- 8.0:
https://github.com/rails/rails/commit/69aff80d115bbb9d1e82fd6c6f2fd3ddeafb958b.patchCredit
This issue was responsibly reported by HackerOne researcher
w3rmut.
π¨ Unsigned Content-Type in Active Storage GCS direct uploads with cache_control
Impact
When a GCS service is configured with the
cache_controloption,
ActiveStorage::Service::GCSService#url_for_direct_uploadsigns direct-upload
URLs with V4, and the V4 signature covers only theCache-ControlandHost
headers. A direct-upload client can therefore send aContent-Typeof its
choosing, and can omit the declaredContent-MD5, without invalidating the
URL. GCS stores the supplied content type as object metadata, which takes
precedence over theresponse-content-typethat Active Storage sets on
download URLs, so an uploaded object could be served as inline HTML under the
application's bucket path onstorage.googleapis.com. Script in such an
object runs on the storage origin rather than the application's, but could
register a Service Worker scoped to the bucket path and read or replace a
victim's later responses for signed URLs in that bucket.Applications that use the GCS service with
cache_controlconfigured and
accept direct uploads are affected. GCS services withoutcache_controlsign
with V2 and are not affected.Details
The fixed releases sign every GCS direct-upload URL with V2, which binds an
emptyContent-Typeand the declaredContent-MD5. The configured
Cache-Controlis still returned byheaders_for_direct_uploadand sent by
the client, but it is no longer part of the signature, and direct-upload URLs
for these services are no longer limited to V4's seven-day maximum expiry. See
the Active Storage CHANGELOG.Workarounds
Removing the
cache_controloption from the GCS service configuration makes
Active Storage sign direct uploads with V2.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/8d93f6a872e9550a91bf0e4fce50083a235ef3b1.patch- 8.0:
https://github.com/rails/rails/commit/ddc08ba61a8001e7402864c62e466cf732fc7614.patchCredit
This issue was responsibly reported by HackerOne researcher
thepo1es.
π¨ Possible DoS vulnerability in Active Storage proxy mode via storage errors during streaming
Impact
When Active Storage serves a file through its proxy controllers,
ActiveStorage::Streaming#send_blob_streamhandles an error from the storage
service by callingheadto send a 404 or 500 response. If the error occurs
after the first chunk has been written, the response is already committed, and
headreplaces the response body while the server is still reading the
originalActionController::Livebuffer. That buffer is never closed, so the
server thread handling the request blocks until the process restarts. Repeated
failed downloads could exhaust the server's threads, possibly resulting in a
DoS vulnerability.Applications are affected when they store files on a service that streams a
download in several requests, such as Amazon S3, an S3-compatible service or
Google Cloud Storage, and draw Active Storage's default routes. The proxy
routes are drawn whether or not proxy mode is the default for the application.
A file deleted while it is being served, or any other storage error partway
through a download, triggers the condition.Details
A storage error raised before the response is committed still produces a 404
or 500 response. After the fix, a storage error raised after the response is
committed is re-raised instead, so the server closes the streamed response and
releases the thread; the client receives a truncated body, and the exception
reaches the application's error reporting.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/3c67a693fb21870ecb1222e3da59d5c491a62009.patch- 8.0:
https://github.com/rails/rails/commit/655b4442de136a3701334607f634d698bf9d5b82.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-FMPUMYTB).
π¨ Possible arbitrary file write and read in Active Storage image analysis
Impact
A Rails application that processes attachments with ImageMagick may allow an
unauthenticated attacker to write arbitrary files on the server and, when
attachments are stored with the Disk service, to read arbitrary files readable
by the application process. Those files typically includesecret_key_base
and credentials for external systems, which may in turn allow escalation to
remote code execution or lateral movement to those systems.Details
ImageMagick selects a coder from the content of the file it is given, and some
coders act on files named inside the image rather than on the image itself.
Active Storage constrained none of ImageMagick's coders, and the ImageMagick
analyzer runs when a file is attached, so an attacker who can upload a crafted
file may be able to invoke one. Attaching the upload is sufficient; no
variant, preview, oranalyzecall is required. One specific attack chain has
been reported to us, but we do not assume it is the only one that exists.The fixed versions ship an ImageMagick security policy and prepend its
directory toMAGICK_CONFIGURE_PATHthroughMiniMagick.cli_env, so every
ImageMagick process that MiniMagick spawns applies it. The policy denies the
MSLscripting coder, the coders that read or delete files other than the
image, fetch remote or local references, or display to a screen, every coder
backed by Ghostscript together with thegsdelegate, and@filename
indirection. ImageMagick applies everypolicy.xmlon its search path, so the
shipped policy adds to the host's policy rather than replacing it. The policy
applies to every ImageMagick command that MiniMagick runs, not only those of
Active Storage. See theactivestorageCHANGELOG and "ImageMagick Security
Policy" in the Active Storage guide.Affected applications
An application is affected if it meets all of these requirements:
- Uses ImageMagick for Active Storage image processing. This is
config.active_storage.variant_processor = :mini_magick, which is the
default for applications onload_defaults 6.1or earlier.- Runs ImageMagick under a security policy that does not already deny the
coders involved. The policies that Debian and Ubuntu package do not.- Allows file uploads from untrusted users.
Mitigation
- Upgrade to a fixed version of
activestorage.- An application whose variant processor is
:mini_magickmust use
mini_magick>= 5.1, which applying the policy requires. With an older
mini_magick, such an application raises an exception during boot.- An application that renders PostScript or PDF through ImageMagick must
re-allow thegsdelegate and the coders it uses in the host's
policy.xml.- An application that replaces
MiniMagick.cli_envafter boot, clears the
environment withMiniMagick.cli_prefix, or installs its own
MiniMagick::Shelldoes not receive the shipped policy and must carry its
rules in ImageMagick's system policy. GraphicsMagick does not read
ImageMagick policies.- If attachments are stored with the Disk service, change
secret_key_base
and every secret readable by the application process, including the master
key and everythingconfig/credentials.yml.encholds, storage and database
credentials, and third-party tokens. Do not retain an exposed secret as a
fallback.Workarounds
Copy the rules of the policy that the fixed versions ship,
activestorage/lib/active_storage/image_magick/policy.xml, into ImageMagick's
system policy, for example/etc/ImageMagick-7/policy.xml. At a minimum, deny
theMSLcoder, the Ghostscript coders, and thegsdelegate:<policy domain="coder" rights="none" pattern="MSL"/> <policy domain="delegate" rights="none" pattern="gs"/> <policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPS2,EPS3,EPI,EPSF,EPSI,EPT,EPT2,EPT3,PDF,AI,EPDF,PDFA,POCKETMOD,XPS,PCL}"/>Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Versions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
ryotak.References
- ImageMagick security policy
π¨ Possible circumvention of file size limits in Active Storage direct uploads to Google Cloud Storage
Impact
ActiveStorage::Service::GCSService#url_for_direct_uploaddoes not bind the
declared content length into the signed direct-upload URL, and
#headers_for_direct_uploadreturns no length constraint, so the URL
authorizes an upload body of any size. A direct-upload client could store a
file larger than thebyte_sizeit declared, and the resulting blob keeps the
declared size, possibly bypassing application file size validations and
quotas. This is the weakness that CVE-2020-8162 fixed in the S3 service.Applications that store files in Google Cloud Storage and accept direct
uploads are affected.Details
The fixed releases sign an
x-goog-content-length-rangeheader that matches
the blob's declaredbyte_sizeand return it from
headers_for_direct_upload, so Cloud Storage rejects an upload body of any
other size. Browsers send this header with the direct upload, so a bucket's
CORS configuration must listx-goog-content-length-rangein
responseHeader, or browser direct uploads fail after the upgrade. The Active
Storage CHANGELOG and the CORS example in the Active Storage guide show the
change.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/e19916cea31cbfb0030b165ae853b741f8dd57a7.patch- 8.0:
https://github.com/rails/rails/commit/7fe85a72a789eae5ee070ce3ee1dad10a8a5f70c.patchCredit
This issue was responsibly reported by HackerOne researcher
f4cts.
π¨ Possible DoS vulnerability in Active Storage filename handling
Impact
ActiveStorage::Filename#baseand#extension_with_delimiter, and therefore
#extension, pass the stored filename unmodified toFile.basenameand
File.extname, which raiseArgumentErrorwhen the name contains a NUL byte.
Active Storage stores the client-supplied filename verbatim, so a user who is
permitted to upload an attachment could persist such a filename on databases
that accept NUL bytes in string columns, such as SQLite and MySQL/MariaDB.
Each subsequent request that builds a variant or preview of the blob, opens
it, or renders it as an Action Text attachment then raises, possibly resulting
in a persistent DoS vulnerability for the pages that display the blob until it
is purged or its filename is corrected. Applications that use PostgreSQL are
not affected, because PostgreSQL rejects the row.Details
Filename#baseand#extension_with_delimiternow derive from
Filename#sanitized, the form thatFilename#to_sand the
Content-Dispositionheader already use. For a filename that#sanitized
changes, such as one containing a NUL byte, an invalid byte sequence, a path
separator or another replaced character, the base and extension now agree with
#to_s; the variant format inferred from such a name may change, and an
existing variant may be regenerated once. Stored filenames are not modified,
and no data migration is required.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/60f22af88b71eae251f112d8c0237a08a8832692.patch- 8.0:
https://github.com/rails/rails/commit/9b0d4bef2211a2c08cab2e0ea17fa1d0efd5d47a.patchCredit
This issue was found by the Anthropic OSS Scanner (ANT-2026-UQM5Z4YL).
π¨ Possible arbitrary file read and remote code execution in Active Storage video previews, analysis and image processing
Impact
ActiveStorage::Blob#openwrites a blob to a tempfile whose name carries the
extension of the uploaded filename, and hands that path toffprobe
(VideoAnalyzer,AudioAnalyzer),ffmpeg(VideoPreviewer) and
ImageMagick (ImageAnalyzer, the:mini_magickvariant 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.avsextension 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.Details
The 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.Affected applications
An application is affected if it meets all of these requirements:
- Accepts uploads from untrusted users.
- Analyzes video or audio attachments (which Active Storage does on attach by
default), generates video previews, or processes images with ImageMagick.The AviSynth attack additionally requires an FFmpeg built with
--enable-avisynthand 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.Mitigation
- Upgrade to a fixed version of
activestorage.Expire and change secrets
Upgrading 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, includingsecret_key_base, the master key and everything in
config/credentials.yml.encthat it decrypts, the Active Storage service
credentials, database credentials, and tokens for third-party services.
Changingsecret_key_baseexpires active sessions and invalidates signed and
encrypted cookies, signed global IDs and Active Storage URLs. Do not retain an
exposed secret as a fallback.Workarounds
Applications that cannot upgrade can stop Active Storage from running FFmpeg
on uploaded files by removingActiveStorage::Previewer::VideoPreviewerfrom
config.active_storage.previewers, and
ActiveStorage::Analyzer::VideoAnalyzerand
ActiveStorage::Analyzer::AudioAnalyzerfrom
config.active_storage.analyzers. Running an FFmpeg built without AviSynth
support closes the AviSynth attack but not the extension-selected decoders of
ImageMagick.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/72136ff39153bc8d63ecbc899993848eb3d6573e.patch- 8.0:
https://github.com/rails/rails/commit/8106938fb0a595f11006dd1497cd409e27d7d636.patchVersions affected
- activestorage < 8.0.5.2
- activestorage >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by HackerOne researcher
pirikara.
π¨ Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing
Impact
In its default configuration, a Rails application that displays image variants may allow an
unauthenticated attacker to read arbitrary files from the server, including the process environment.
That environment typically holdssecret_key_baseand often credentials for external systems, which
may in turn allow escalation to remote code execution or lateral movement to those systems.Details
libvips reads and writes file formats through "loaders" and "savers" (or more generally
"operations"), many of which are backed by third-party libraries. It marks some of these operations
as "unfuzzed", meaning they are unsafe for untrusted content, and several handle formats unrelated
to web images. Active Storage did not disable the unfuzzed operations, so an attacker who can upload
a crafted file and cause a variant to be generated from it may be able to invoke one.We are aware of a mechanism by which an attacker, by uploading a crafted file, is able to cause
disclosure of the contents of arbitrary files accessible on the filesystem of the targeted
application. One specific attack chain has been reported to us (see "Disclosure" below), but we do
not assume it is the only one that exists.Affected applications
An application is affected if it meets all of these requirements:
- Uses libvips for Active Storage image processing. This is
config.active_storage.variant_processor = :vips,
whichload_defaults 7.0set and no later default has changed.- Allows image uploads from untrusted users.
Generating variants is not a separate requirement.
Mitigation
- Upgrade to a fixed version of
activestorage.- The minimum version of libvips must be upgraded to
>= 8.13.- Change
secret_key_baseand change any secrets accessible in the application environment (see "Expire and change secrets" below)Earlier versions of libvips (
< 8.13) cannot disable unfuzzed operations at all, and Active Storage
will raise an exception during boot in such an unsecurable environment.Expire and change secrets
Upgrading closes the vulnerability but does not undo an exfiltrated secret if that already
occurred. An affected application should treat every secret readable by the application process as
potentially exposed and change it, including:
secret_key_base- The master key, whether stored in
config/master.keyor supplied asRAILS_MASTER_KEY, along
with everything inconfig/credentials.yml.encthat it decrypts- Credentials for the Active Storage service, such as S3, GCS, or Azure keys
- Database credentials
- Tokens and keys for any third-party service the application calls
Changing
secret_key_baseexpires active sessions and requires users to log in again. Encrypted
cookies, signed cookies, signed global IDs, and Active Storage URLs are also affected.Rotation should only be used as an intermediate step if necessary. Do not retain an exposed secret
as a fallback.Workarounds
If libvips
< 8.13is being used, there are no workarounds available other than removing the
dependency on libvips from the application. Some applications may haveruby-vipsdeclared as a
dependency only for image analysis, and those applications may be able to simply removeruby-vips
from the Gemfile to remove libvips from the application. Applications that do not use Active Storage
can removeruby-vipsfrom the Gemfile to avoid the boot-time checks.If libvips
>= 8.13is present on the system, applications can disable the unfuzzed operations
without upgrading Rails by setting theVIPS_BLOCK_UNTRUSTEDenvironment variable, which libvips
reads while initializing.Applications also running ruby-vips
>= 2.2.1or later can instead call
Vips.block_untrusted(true)from an initializer.Releases
The fixed releases are available at the normal locations.
Versions affected
- activestorage < 7.2.3.2
- activestorage >= 8.0, < 8.0.5.1
- activestorage >= 8.1, < 8.1.3.1
Disclosure
Technical details of the attack chain are intentionally omitted from this advisory. They would add
nothing to an administrator's decision to upgrade, while making it substantially easier to attack
applications that have not yet done so.Details will be disclosed no later than 2026-08-28, via the Rails Security
Announcements forum.Credit
This issue was responsibly reported by 0xacb, s3np41k1r1t0 and castilho from Ethiack, and RyotaK from GMO Flatt Security Inc..
References
- libvips 8.13 release notes, blocking of unfuzzed loaders
- W.A. Arbaugh, W.L. Fithen, and J. McHugh, "Windows of Vulnerability: A Case Study
Analysis", IEEE Computer 33(12), December 2000- https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve
- https://blog.flatt.tech/entry/kindarails2shell_rails
π¨ Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing
Impact
In its default configuration, a Rails application that displays image variants may allow an
unauthenticated attacker to read arbitrary files from the server, including the process environment.
That environment typically holdssecret_key_baseand often credentials for external systems, which
may in turn allow escalation to remote code execution or lateral movement to those systems.Details
libvips reads and writes file formats through "loaders" and "savers" (or more generally
"operations"), many of which are backed by third-party libraries. It marks some of these operations
as "unfuzzed", meaning they are unsafe for untrusted content, and several handle formats unrelated
to web images. Active Storage did not disable the unfuzzed operations, so an attacker who can upload
a crafted file and cause a variant to be generated from it may be able to invoke one.We are aware of a mechanism by which an attacker, by uploading a crafted file, is able to cause
disclosure of the contents of arbitrary files accessible on the filesystem of the targeted
application. One specific attack chain has been reported to us (see "Disclosure" below), but we do
not assume it is the only one that exists.Affected applications
An application is affected if it meets all of these requirements:
- Uses libvips for Active Storage image processing. This is
config.active_storage.variant_processor = :vips,
whichload_defaults 7.0set and no later default has changed.- Allows image uploads from untrusted users.
Generating variants is not a separate requirement.
Mitigation
- Upgrade to a fixed version of
activestorage.- The minimum version of libvips must be upgraded to
>= 8.13.- Change
secret_key_baseand change any secrets accessible in the application environment (see "Expire and change secrets" below)Earlier versions of libvips (
< 8.13) cannot disable unfuzzed operations at all, and Active Storage
will raise an exception during boot in such an unsecurable environment.Expire and change secrets
Upgrading closes the vulnerability but does not undo an exfiltrated secret if that already
occurred. An affected application should treat every secret readable by the application process as
potentially exposed and change it, including:
secret_key_base- The master key, whether stored in
config/master.keyor supplied asRAILS_MASTER_KEY, along
with everything inconfig/credentials.yml.encthat it decrypts- Credentials for the Active Storage service, such as S3, GCS, or Azure keys
- Database credentials
- Tokens and keys for any third-party service the application calls
Changing
secret_key_baseexpires active sessions and requires users to log in again. Encrypted
cookies, signed cookies, signed global IDs, and Active Storage URLs are also affected.Rotation should only be used as an intermediate step if necessary. Do not retain an exposed secret
as a fallback.Workarounds
If libvips
< 8.13is being used, there are no workarounds available other than removing the
dependency on libvips from the application. Some applications may haveruby-vipsdeclared as a
dependency only for image analysis, and those applications may be able to simply removeruby-vips
from the Gemfile to remove libvips from the application. Applications that do not use Active Storage
can removeruby-vipsfrom the Gemfile to avoid the boot-time checks.If libvips
>= 8.13is present on the system, applications can disable the unfuzzed operations
without upgrading Rails by setting theVIPS_BLOCK_UNTRUSTEDenvironment variable, which libvips
reads while initializing.Applications also running ruby-vips
>= 2.2.1or later can instead call
Vips.block_untrusted(true)from an initializer.Releases
The fixed releases are available at the normal locations.
Versions affected
- activestorage < 7.2.3.2
- activestorage >= 8.0, < 8.0.5.1
- activestorage >= 8.1, < 8.1.3.1
Disclosure
Technical details of the attack chain are intentionally omitted from this advisory. They would add
nothing to an administrator's decision to upgrade, while making it substantially easier to attack
applications that have not yet done so.Details will be disclosed no later than 2026-08-28, via the Rails Security
Announcements forum.Credit
This issue was responsibly reported by 0xacb, s3np41k1r1t0 and castilho from Ethiack, and RyotaK from GMO Flatt Security Inc..
References
- libvips 8.13 release notes, blocking of unfuzzed loaders
- W.A. Arbaugh, W.L. Fithen, and J. McHugh, "Windows of Vulnerability: A Case Study
Analysis", IEEE Computer 33(12), December 2000- https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve
- https://blog.flatt.tech/entry/kindarails2shell_rails
π¨ Active Storage has possible arbitrary file read and remote code execution in Active Storage variant processing
Impact
In its default configuration, a Rails application that displays image variants may allow an
unauthenticated attacker to read arbitrary files from the server, including the process environment.
That environment typically holdssecret_key_baseand often credentials for external systems, which
may in turn allow escalation to remote code execution or lateral movement to those systems.Details
libvips reads and writes file formats through "loaders" and "savers" (or more generally
"operations"), many of which are backed by third-party libraries. It marks some of these operations
as "unfuzzed", meaning they are unsafe for untrusted content, and several handle formats unrelated
to web images. Active Storage did not disable the unfuzzed operations, so an attacker who can upload
a crafted file and cause a variant to be generated from it may be able to invoke one.We are aware of a mechanism by which an attacker, by uploading a crafted file, is able to cause
disclosure of the contents of arbitrary files accessible on the filesystem of the targeted
application. One specific attack chain has been reported to us (see "Disclosure" below), but we do
not assume it is the only one that exists.Affected applications
An application is affected if it meets all of these requirements:
- Uses libvips for Active Storage image processing. This is
config.active_storage.variant_processor = :vips,
whichload_defaults 7.0set and no later default has changed.- Allows image uploads from untrusted users.
Generating variants is not a separate requirement.
Mitigation
- Upgrade to a fixed version of
activestorage.- The minimum version of libvips must be upgraded to
>= 8.13.- Change
secret_key_baseand change any secrets accessible in the application environment (see "Expire and change secrets" below)Earlier versions of libvips (
< 8.13) cannot disable unfuzzed operations at all, and Active Storage
will raise an exception during boot in such an unsecurable environment.Expire and change secrets
Upgrading closes the vulnerability but does not undo an exfiltrated secret if that already
occurred. An affected application should treat every secret readable by the application process as
potentially exposed and change it, including:
secret_key_base- The master key, whether stored in
config/master.keyor supplied asRAILS_MASTER_KEY, along
with everything inconfig/credentials.yml.encthat it decrypts- Credentials for the Active Storage service, such as S3, GCS, or Azure keys
- Database credentials
- Tokens and keys for any third-party service the application calls
Changing
secret_key_baseexpires active sessions and requires users to log in again. Encrypted
cookies, signed cookies, signed global IDs, and Active Storage URLs are also affected.Rotation should only be used as an intermediate step if necessary. Do not retain an exposed secret
as a fallback.Workarounds
If libvips
< 8.13is being used, there are no workarounds available other than removing the
dependency on libvips from the application. Some applications may haveruby-vipsdeclared as a
dependency only for image analysis, and those applications may be able to simply removeruby-vips
from the Gemfile to remove libvips from the application. Applications that do not use Active Storage
can removeruby-vipsfrom the Gemfile to avoid the boot-time checks.If libvips
>= 8.13is present on the system, applications can disable the unfuzzed operations
without upgrading Rails by setting theVIPS_BLOCK_UNTRUSTEDenvironment variable, which libvips
reads while initializing.Applications also running ruby-vips
>= 2.2.1or later can instead call
Vips.block_untrusted(true)from an initializer.Releases
The fixed releases are available at the normal locations.
Versions affected
- activestorage < 7.2.3.2
- activestorage >= 8.0, < 8.0.5.1
- activestorage >= 8.1, < 8.1.3.1
Disclosure
Technical details of the attack chain are intentionally omitted from this advisory. They would add
nothing to an administrator's decision to upgrade, while making it substantially easier to attack
applications that have not yet done so.Details will be disclosed no later than 2026-08-28, via the Rails Security
Announcements forum.Credit
This issue was responsibly reported by 0xacb, s3np41k1r1t0 and castilho from Ethiack, and RyotaK from GMO Flatt Security Inc..
References
- libvips 8.13 release notes, blocking of unfuzzed loaders
- W.A. Arbaugh, W.L. Fithen, and J. McHugh, "Windows of Vulnerability: A Case Study
Analysis", IEEE Computer 33(12), December 2000- https://ethiack.com/info-hub/research/kindarails2shell-rails-rce-cve
- https://blog.flatt.tech/entry/kindarails2shell_rails
π¨ Rails Active Storage has a possible DoS vulnerability in proxy mode via multi-range requests
Impact
Active Storage's proxy controller does not limit the number of byte ranges in an HTTP Range header. A request with thousands of small ranges causes disproportionate CPU usage compared to a normal request for the same file, possibly resulting in a DoS vulnerability.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher thwin_htet.
π¨ Rails Active Storage has a possible DoS vulnerability in proxy mode via multi-range requests
Impact
Active Storage's proxy controller does not limit the number of byte ranges in an HTTP Range header. A request with thousands of small ranges causes disproportionate CPU usage compared to a normal request for the same file, possibly resulting in a DoS vulnerability.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher thwin_htet.
π¨ Rails Active Storage has a possible DoS vulnerability in proxy mode via multi-range requests
Impact
Active Storage's proxy controller does not limit the number of byte ranges in an HTTP Range header. A request with thousands of small ranges causes disproportionate CPU usage compared to a normal request for the same file, possibly resulting in a DoS vulnerability.
Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher thwin_htet.
π¨ Rails Active Storage has possible Path Traversal in DiskService
Impact
Active Storage's
DiskService#path_fordoes not validate that the resolved filesystem path remains within the storage root directory. If a blob key containing path traversal sequences (e.g.../) is used, it could allow reading, writing, or deleting arbitrary files on the server. Blob keys are expected to be trusted strings, but some applications could be passing user input as keys and would be affected.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher ksw9722.
π¨ Rails Active Storage has possible glob injection in its DiskService
Impact
Active Storage's
DiskService#delete_prefixedpasses blob keys directly toDir.globwithout escaping glob metacharacters. If a blob key contains attacker-controlled input or custom-generated keys with glob metacharacters, it may be possible to delete unintended files from the storage directory.Releases
The fixed releases are available at the normal locations.
π¨ Rails Active Storage has possible glob injection in its DiskService
Impact
Active Storage's
DiskService#delete_prefixedpasses blob keys directly toDir.globwithout escaping glob metacharacters. If a blob key contains attacker-controlled input or custom-generated keys with glob metacharacters, it may be possible to delete unintended files from the storage directory.Releases
The fixed releases are available at the normal locations.
π¨ Rails Active Storage has possible Path Traversal in DiskService
Impact
Active Storage's
DiskService#path_fordoes not validate that the resolved filesystem path remains within the storage root directory. If a blob key containing path traversal sequences (e.g.../) is used, it could allow reading, writing, or deleting arbitrary files on the server. Blob keys are expected to be trusted strings, but some applications could be passing user input as keys and would be affected.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher ksw9722.
π¨ Rails Active Storage has a possible DoS vulnerability when in proxy mode via Range requests
Impact
When serving files through Active Storage's
Blobs::ProxyController, the controller loads the entire requested byte range into memory before sending it. A request with a large or unbounded Range header (e.g.bytes=0-) could cause the server to allocate memory proportional to the file size, possibly resulting in a DoS vulnerability through memory exhaustion.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone user pirikara
π¨ Rails Active Storage has a possible DoS vulnerability when in proxy mode via Range requests
Impact
When serving files through Active Storage's
Blobs::ProxyController, the controller loads the entire requested byte range into memory before sending it. A request with a large or unbounded Range header (e.g.bytes=0-) could cause the server to allocate memory proportional to the file size, possibly resulting in a DoS vulnerability through memory exhaustion.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone user pirikara
π¨ Rails Active Storage has possible content type bypass via metadata in direct uploads
Impact
Active Storage's
DirectUploadsControlleraccepts arbitrary metadata from the client and persists it on the blob. Because internal flags likeidentifiedandanalyzedare stored in the same metadata hash, a malicious direct-upload client could set these flags.Releases
The fixed releases are available at the normal locations.
Credit
This was responsible reported by Hackerone researcher pwnie
π¨ Rails Active Storage has possible glob injection in its DiskService
Impact
Active Storage's
DiskService#delete_prefixedpasses blob keys directly toDir.globwithout escaping glob metacharacters. If a blob key contains attacker-controlled input or custom-generated keys with glob metacharacters, it may be possible to delete unintended files from the storage directory.Releases
The fixed releases are available at the normal locations.
π¨ Rails Active Storage has possible Path Traversal in DiskService
Impact
Active Storage's
DiskService#path_fordoes not validate that the resolved filesystem path remains within the storage root directory. If a blob key containing path traversal sequences (e.g.../) is used, it could allow reading, writing, or deleting arbitrary files on the server. Blob keys are expected to be trusted strings, but some applications could be passing user input as keys and would be affected.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher ksw9722.
π¨ Rails Active Storage has a possible DoS vulnerability when in proxy mode via Range requests
Impact
When serving files through Active Storage's
Blobs::ProxyController, the controller loads the entire requested byte range into memory before sending it. A request with a large or unbounded Range header (e.g.bytes=0-) could cause the server to allocate memory proportional to the file size, possibly resulting in a DoS vulnerability through memory exhaustion.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone user pirikara
π¨ Rails Active Storage has possible content type bypass via metadata in direct uploads
Impact
Active Storage's
DirectUploadsControlleraccepts arbitrary metadata from the client and persists it on the blob. Because internal flags likeidentifiedandanalyzedare stored in the same metadata hash, a malicious direct-upload client could set these flags.Releases
The fixed releases are available at the normal locations.
Credit
This was responsible reported by Hackerone researcher pwnie
π¨ Rails Active Storage has possible content type bypass via metadata in direct uploads
Impact
Active Storage's
DirectUploadsControlleraccepts arbitrary metadata from the client and persists it on the blob. Because internal flags likeidentifiedandanalyzedare stored in the same metadata hash, a malicious direct-upload client could set these flags.Releases
The fixed releases are available at the normal locations.
Credit
This was responsible reported by Hackerone researcher pwnie
π¨ Active Storage allowed transformation methods that were potentially unsafe
Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.
The default allowed list contains three methods allowing for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters.
This has been assigned the CVE identifier CVE-2025-24293.
Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1Impact
This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor.
Vulnerable code will look something similar to this:
<%= image_tag blob.variant(params[:t] => params[:v]) %>Where the transformation method or its arguments are untrusted arbitrary input.
All users running an affected release should either upgrade or use one of the workarounds immediately.
Releases
The fixed releases are available at the normal locations.
Workarounds
Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous.
Strict validation of user supplied methods and parameters should be performed as well as having a strong ImageMagick security policy deployed.
Credits
Thank you lio346 from Unit 515 of OPSWAT for reporting this!
π¨ Active Storage allowed transformation methods that were potentially unsafe
Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.
The default allowed list contains three methods allowing for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters.
This has been assigned the CVE identifier CVE-2025-24293.
Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1Impact
This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor.
Vulnerable code will look something similar to this:
<%= image_tag blob.variant(params[:t] => params[:v]) %>Where the transformation method or its arguments are untrusted arbitrary input.
All users running an affected release should either upgrade or use one of the workarounds immediately.
Releases
The fixed releases are available at the normal locations.
Workarounds
Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous.
Strict validation of user supplied methods and parameters should be performed as well as having a strong ImageMagick security policy deployed.
Credits
Thank you lio346 from Unit 515 of OPSWAT for reporting this!
π¨ Active Storage allowed transformation methods that were potentially unsafe
Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.
The default allowed list contains three methods allowing for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters.
This has been assigned the CVE identifier CVE-2025-24293.
Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1Impact
This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor.
Vulnerable code will look something similar to this:
<%= image_tag blob.variant(params[:t] => params[:v]) %>Where the transformation method or its arguments are untrusted arbitrary input.
All users running an affected release should either upgrade or use one of the workarounds immediately.
Releases
The fixed releases are available at the normal locations.
Workarounds
Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous.
Strict validation of user supplied methods and parameters should be performed as well as having a strong ImageMagick security policy deployed.
Credits
Thank you lio346 from Unit 515 of OPSWAT for reporting this!
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ activesupport (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Active Support: Possible DoS vulnerability in Active Support safe_constantize
Impact
When constant lookup raises
LoadError,ActiveSupport::Inflector#safe_constantize(andString#safe_constantize) builds a regular expression from the requested constant name without escaping it, so a caller that passes untrusted input lets the attacker choose the source of a pattern that the application compiles. Crafted patterns can trigger defects in Ruby's regular expression compiler, possibly leading to a crash of the server process, and repeated requests could keep the application unavailable.Action Cable passes the
channelvalue of eachsubscribecommand tosafe_constantizebefore any channel lookup, so in the default configuration an unauthenticated client of the Action Cable endpoint can reach this code.Details
The check that decides whether
safe_constantizereturnsnilor re-raises theLoadErrornow matches the first segment of the constant name against the error message as a literal string, and no longer compiles a regular expression. It returns the same result as before for constant names that contain no regular expression syntax.Affected applications
An application is affected if it meets all of these requirements:
- Mounts Action Cable, which a new Rails application does by default at
/cable(config.action_cable.mount_path), or otherwise passes untrusted input tosafe_constantize.- Accepts Action Cable connections from untrusted clients.
ApplicationCable::Connection#connectauthenticates nobody unless the application adds a check.Workarounds
Applications that do not use Action Cable can set
config.action_cable.mount_path = nilto remove the endpoint. Applications that use Action Cable can callreject_unauthorized_connectioninApplicationCable::Connection#connectfor unauthenticated clients, which limits exposure to authenticated users but does not remove it.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/95aa9e416016524956d4904fed96eaed079580bb.patch
- 8.0: https://github.com/rails/rails/commit/210ac22d446c8e2625b091e79256806b836eee20.patch
Versions affected
- activesupport < 8.0.5.2
- activesupport >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by Felix Tscheulin (flixt) through HackerOne researcher scheja, and independently by Bucky Wolfe (Igneous), who provided a proof of concept that crashes the server. It was also found by the Anthropic OSS Scanner (ANT-2026-ZUN5KU3Q).
π¨ Active Support: Possible XSS vulnerability in Active Support MessagePack serializer
Impact
ActiveSupport::MessagePackserializes anActiveSupport::SafeBufferas its bytes alone and deserializes it as a newSafeBuffer, so a buffer that is no longerhtml_safe?(for example, one mutated in place withgsub!) is restored ashtml_safe. If such a buffer holds untrusted input and is stored through a MessagePack serializer, rendering it after it is loaded bypasses ERB auto-escaping, possibly leading to XSS.Applications on Rails 8.1 are affected if they use a MessagePack serializer, such as
config.action_dispatch.cookies_serializer = :message_packor:message_pack_allow_marshal, orserializer: :message_packforRails.cache,ActiveSupport::MessageVerifierorActiveSupport::MessageEncryptor, and store aSafeBufferthat was mutated in place with untrusted input. Rails 8.0 and earlier do not serializeSafeBufferwith MessagePack and are not affected.Details
The fixed releases serialize a
SafeBufferthat is nothtml_safe?with a marker and deserialize it as aString; aSafeBufferthat ishtml_safe?keeps the existing format. Versions without the fix cannot read an unsafe buffer serialized by the fixed releases, so during a rolling deploy a cookie or cache entry holding one could fail to load on a process that has not been upgraded.Workarounds
Applications that cannot upgrade can convert a
SafeBufferto aStringwithto_strbefore storing it in a value that a MessagePack serializer writes.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Credit
This issue was responsibly reported by HackerOne researcher jcwilk.
π¨ Active Support: Possible DoS vulnerability in Active Support safe_constantize
Impact
When constant lookup raises
LoadError,ActiveSupport::Inflector#safe_constantize(andString#safe_constantize) builds a regular expression from the requested constant name without escaping it, so a caller that passes untrusted input lets the attacker choose the source of a pattern that the application compiles. Crafted patterns can trigger defects in Ruby's regular expression compiler, possibly leading to a crash of the server process, and repeated requests could keep the application unavailable.Action Cable passes the
channelvalue of eachsubscribecommand tosafe_constantizebefore any channel lookup, so in the default configuration an unauthenticated client of the Action Cable endpoint can reach this code.Details
The check that decides whether
safe_constantizereturnsnilor re-raises theLoadErrornow matches the first segment of the constant name against the error message as a literal string, and no longer compiles a regular expression. It returns the same result as before for constant names that contain no regular expression syntax.Affected applications
An application is affected if it meets all of these requirements:
- Mounts Action Cable, which a new Rails application does by default at
/cable(config.action_cable.mount_path), or otherwise passes untrusted input tosafe_constantize.- Accepts Action Cable connections from untrusted clients.
ApplicationCable::Connection#connectauthenticates nobody unless the application adds a check.Workarounds
Applications that do not use Action Cable can set
config.action_cable.mount_path = nilto remove the endpoint. Applications that use Action Cable can callreject_unauthorized_connectioninApplicationCable::Connection#connectfor unauthenticated clients, which limits exposure to authenticated users but does not remove it.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/95aa9e416016524956d4904fed96eaed079580bb.patch
- 8.0: https://github.com/rails/rails/commit/210ac22d446c8e2625b091e79256806b836eee20.patch
Versions affected
- activesupport < 8.0.5.2
- activesupport >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by Felix Tscheulin (flixt) through HackerOne researcher scheja, and independently by Bucky Wolfe (Igneous), who provided a proof of concept that crashes the server. It was also found by the Anthropic OSS Scanner (ANT-2026-ZUN5KU3Q).
π¨ Possible DoS vulnerability in Active Support safe_constantize
Impact
When constant lookup raises
LoadError,
ActiveSupport::Inflector#safe_constantize(andString#safe_constantize)
builds a regular expression from the requested constant name without escaping
it, so a caller that passes untrusted input lets the attacker choose the
source of a pattern that the application compiles. Crafted patterns can
trigger defects in Ruby's regular expression compiler, possibly leading to a
crash of the server process, and repeated requests could keep the application
unavailable.Action Cable passes the
channelvalue of eachsubscribecommand to
safe_constantizebefore any channel lookup, so in the default configuration
an unauthenticated client of the Action Cable endpoint can reach this code.Details
The check that decides whether
safe_constantizereturnsnilor re-raises
theLoadErrornow matches the first segment of the constant name against the
error message as a literal string, and no longer compiles a regular
expression. It returns the same result as before for constant names that
contain no regular expression syntax.Affected applications
An application is affected if it meets all of these requirements:
- Mounts Action Cable, which a new Rails application does by default at
/cable(config.action_cable.mount_path), or otherwise passes untrusted
input tosafe_constantize.- Accepts Action Cable connections from untrusted clients.
ApplicationCable::Connection#connectauthenticates nobody unless the
application adds a check.Workarounds
Applications that do not use Action Cable can set
config.action_cable.mount_path = nilto remove the endpoint. Applications
that use Action Cable can callreject_unauthorized_connectionin
ApplicationCable::Connection#connectfor unauthenticated clients, which
limits exposure to authenticated users but does not remove it.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/95aa9e416016524956d4904fed96eaed079580bb.patch- 8.0:
https://github.com/rails/rails/commit/210ac22d446c8e2625b091e79256806b836eee20.patchVersions affected
- activesupport < 8.0.5.2
- activesupport >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by Felix Tscheulin
(flixt) through HackerOne researcher
scheja, and independently by Bucky Wolfe
(Igneous), who provided a proof of concept that
crashes the server. It was also found by the Anthropic OSS Scanner
(ANT-2026-ZUN5KU3Q).
π¨ Possible XSS vulnerability in Active Support MessagePack serializer
Impact
ActiveSupport::MessagePackserializes anActiveSupport::SafeBufferas its
bytes alone and deserializes it as a newSafeBuffer, so a buffer that is no
longerhtml_safe?(for example, one mutated in place withgsub!) is
restored ashtml_safe. If such a buffer holds untrusted input and is stored
through a MessagePack serializer, rendering it after it is loaded bypasses ERB
auto-escaping, possibly leading to XSS.Applications on Rails 8.1 are affected if they use a MessagePack serializer,
such asconfig.action_dispatch.cookies_serializer = :message_packor
:message_pack_allow_marshal, orserializer: :message_packfor
Rails.cache,ActiveSupport::MessageVerifieror
ActiveSupport::MessageEncryptor, and store aSafeBufferthat was mutated
in place with untrusted input. Rails 8.0 and earlier do not serialize
SafeBufferwith MessagePack and are not affected.Details
The fixed releases serialize a
SafeBufferthat is nothtml_safe?with a
marker and deserialize it as aString; aSafeBufferthat ishtml_safe?
keeps the existing format. Versions without the fix cannot read an unsafe
buffer serialized by the fixed releases, so during a rolling deploy a cookie
or cache entry holding one could fail to load on a process that has not been
upgraded.Workarounds
Applications that cannot upgrade can convert a
SafeBufferto aStringwith
to_strbefore storing it in a value that a MessagePack serializer writes.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
Credit
This issue was responsibly reported by HackerOne researcher
jcwilk.
π¨ Possible DoS vulnerability in Active Support safe_constantize
Impact
When constant lookup raises
LoadError,
ActiveSupport::Inflector#safe_constantize(andString#safe_constantize)
builds a regular expression from the requested constant name without escaping
it, so a caller that passes untrusted input lets the attacker choose the
source of a pattern that the application compiles. Crafted patterns can
trigger defects in Ruby's regular expression compiler, possibly leading to a
crash of the server process, and repeated requests could keep the application
unavailable.Action Cable passes the
channelvalue of eachsubscribecommand to
safe_constantizebefore any channel lookup, so in the default configuration
an unauthenticated client of the Action Cable endpoint can reach this code.Details
The check that decides whether
safe_constantizereturnsnilor re-raises
theLoadErrornow matches the first segment of the constant name against the
error message as a literal string, and no longer compiles a regular
expression. It returns the same result as before for constant names that
contain no regular expression syntax.Affected applications
An application is affected if it meets all of these requirements:
- Mounts Action Cable, which a new Rails application does by default at
/cable(config.action_cable.mount_path), or otherwise passes untrusted
input tosafe_constantize.- Accepts Action Cable connections from untrusted clients.
ApplicationCable::Connection#connectauthenticates nobody unless the
application adds a check.Workarounds
Applications that do not use Action Cable can set
config.action_cable.mount_path = nilto remove the endpoint. Applications
that use Action Cable can callreject_unauthorized_connectionin
ApplicationCable::Connection#connectfor unauthenticated clients, which
limits exposure to authenticated users but does not remove it.Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1:
https://github.com/rails/rails/commit/95aa9e416016524956d4904fed96eaed079580bb.patch- 8.0:
https://github.com/rails/rails/commit/210ac22d446c8e2625b091e79256806b836eee20.patchVersions affected
- activesupport < 8.0.5.2
- activesupport >= 8.1, < 8.1.4.1
Credit
This issue was responsibly reported by Felix Tscheulin
(flixt) through HackerOne researcher
scheja, and independently by Bucky Wolfe
(Igneous), who provided a proof of concept that
crashes the server. It was also found by the Anthropic OSS Scanner
(ANT-2026-ZUN5KU3Q).
π¨ Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
Impact
NumberToDelimitedConverterused a regular expression withgsub!to insert thousands delimiters. This could produce quadratic time complexity on long digit strings.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher scyoon.
π¨ Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
Impact
NumberToDelimitedConverterused a regular expression withgsub!to insert thousands delimiters. This could produce quadratic time complexity on long digit strings.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher scyoon.
π¨ Rails Active Support has a possible DoS vulnerability in its number helpers
Impact
Active Support number helpers accept strings containing scientific notation (e.g.
1e10000), which when converted to a string could be expanded into extremely large decimal representations. This can cause excessive memory allocation and CPU consumption when the expanded number is formatted, possibly resulting in a DoS vulnerability.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher manun.
π¨ Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
Impact
SafeBuffer#%does not propagate the@html_unsafeflag to the newly created buffer. If aSafeBufferis mutated in place (e.g. viagsub!) and then formatted with%using untrusted arguments, the result incorrectly reportshtml_safe? == true, bypassing ERB auto-escaping and possibly leading to XSS.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by @ch4n3-yoon
π¨ Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
Impact
SafeBuffer#%does not propagate the@html_unsafeflag to the newly created buffer. If aSafeBufferis mutated in place (e.g. viagsub!) and then formatted with%using untrusted arguments, the result incorrectly reportshtml_safe? == true, bypassing ERB auto-escaping and possibly leading to XSS.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by @ch4n3-yoon
π¨ Rails Active Support has a possible DoS vulnerability in its number helpers
Impact
Active Support number helpers accept strings containing scientific notation (e.g.
1e10000), which when converted to a string could be expanded into extremely large decimal representations. This can cause excessive memory allocation and CPU consumption when the expanded number is formatted, possibly resulting in a DoS vulnerability.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher manun.
π¨ Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
Impact
NumberToDelimitedConverterused a regular expression withgsub!to insert thousands delimiters. This could produce quadratic time complexity on long digit strings.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher scyoon.
π¨ Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
Impact
SafeBuffer#%does not propagate the@html_unsafeflag to the newly created buffer. If aSafeBufferis mutated in place (e.g. viagsub!) and then formatted with%using untrusted arguments, the result incorrectly reportshtml_safe? == true, bypassing ERB auto-escaping and possibly leading to XSS.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by @ch4n3-yoon
π¨ Rails Active Support has a possible DoS vulnerability in its number helpers
Impact
Active Support number helpers accept strings containing scientific notation (e.g.
1e10000), which when converted to a string could be expanded into extremely large decimal representations. This can cause excessive memory allocation and CPU consumption when the expanded number is formatted, possibly resulting in a DoS vulnerability.Releases
The fixed releases are available at the normal locations.
Credit
This issue was responsibly reported by Hackerone researcher manun.
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ bigdecimal (indirect, 4.1.2 β 4.1.3) Β· Repo Β· Changelog
Release Notes
4.1.3
What's Changed
- Stop use RB_GC_GUARD on uninitialized value by @tompng in #536
- Fix unused-but-set-global warnings in clang-23 by @nobu in #540
- Declare TypedData with RUBY_TYPED_THREAD_SAFE_FREE by @byroot in #541
- Bit-burst algorithm version of BigMath.erf and BigMath.erfc by @tompng in #458
- Keep Newton division divisor alive by @OskarEichler in #548
- Correct nullable BigDecimal conversion signature by @OskarEichler in #551
- Fix out-of-bounds write in Newton-Raphson division, Improve normalize by @tompng in #553
- Fix precision loss in Newton-Raphson inverse by @tompng in #552
- Honor exception: false for complex conversion by @OskarEichler in #549
- Honor exception: false for strings with null bytes by @OskarEichler in #550
- Guard string VALUEs while parsing their C string by @tompng in #556
- Make String#to_d accept embedded NUL bytes and reject ASCII-incompatible strings by @tompng in #557
- Faster gamma calculation by @tompng in #524
- Bump version to v4.1.3 by @tompng in #558
New Contributors
- @OskarEichler made their first contribution in #548
Full Changelog: v4.1.2...v4.1.3
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 33 commits:
Bump version to v4.1.3 (#558)Faster gamma calculation (#524)Make String#to_d accept embedded NUL bytes and reject ASCII-incompatible strings (#557)Guard string VALUEs while parsing their C string (#556)Honor exception: false for strings with null bytes (#550)Honor exception: false for complex conversion (#549)Merge pull request #555 from ruby/dependabot/github_actions/step-security/harden-runner-2.21.1Bump step-security/harden-runner from 2.21.0 to 2.21.1Fix precision loss in Newton-Raphson inverse (#552)Bump step-security/harden-runner from 2.20.0 to 2.21.0 (#546)Bump rubygems/release-gem from 1.4.0 to 1.4.1 (#545)Fix out-of-bounds write in Newton-Raphson division, Improve normalize (#553)Correct nullable BigDecimal conversion signature (#551)Keep Newton division divisor alive (#548)Bit-burst algorithm version of BigMath.erf and BigMath.erfc (#458)Bump actions/checkout from 7.0.0 to 7.0.1 (#543)Bump step-security/harden-runner from 2.19.4 to 2.20.0 (#542)Declare TypedData with RUBY_TYPED_THREAD_SAFE_FREE (#541)Merge pull request #540 from nobu/unused-variablesFix unused-but-set-global warnings in clang-23Merge pull request #539 from ruby/dependabot/github_actions/actions/checkout-7.0.0Bump actions/checkout from 6.0.3 to 7.0.0Merge pull request #538 from ruby/dependabot/github_actions/rubygems/release-gem-1.4.0Bump rubygems/release-gem from 1.2.0 to 1.4.0Bump actions/checkout from 6.0.2 to 6.0.3 (#537)Stop use RB_GC_GUARD on uninitialized value (#536)Bump step-security/harden-runner from 2.19.3 to 2.19.4 (#534)Merge pull request #533 from ruby/dependabot/github_actions/step-security/harden-runner-2.19.3Bump step-security/harden-runner from 2.19.1 to 2.19.3Merge pull request #532 from ruby/dependabot/github_actions/step-security/harden-runner-2.19.1Bump step-security/harden-runner from 2.19.0 to 2.19.1Merge pull request #530 from ruby/dependabot/github_actions/step-security/harden-runner-2.19.0Bump step-security/harden-runner from 2.17.0 to 2.19.0
βοΈ date (indirect, 3.5.1 β 3.6.0) Β· Repo Β· Changelog
Release Notes
3.6.0
What's Changed
- Optimize Gregorian date conversions with Neri-Schneider algorithm by @mensfeld in #152
- [DOC] Fix link by @BurdetteLamar in #160
- Add truffleruby in CI by @eregon in #166
- Fix stray bracket in Date#new_start call-seq by @zonuexe in #171
- Fix _strptime argument checks by @nobu in #173
- Avoid NUL-terminated ISO 8601 component checks by @nobu in #177
- Add generated dependency file by @nobu in #185
- Suppress warnings by clang 21 by @nobu in #186
- Preserve input encoding when parsing time zones by @nobu in #187
- Validate the commercial week range before conversion by @nobu in #188
- Range-check the integral Rational offset by @sjh9714 in #183
- Implement compaction and embedded structs by @byroot in #162
New Contributors
- @mensfeld made their first contribution in #152
- @eregon made their first contribution in #166
- @zonuexe made their first contribution in #171
- @sjh9714 made their first contribution in #183
Full Changelog: v3.5.1...v3.6.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ globalid (indirect, 1.3.0 β 1.4.0) Β· Repo Β· Changelog
Release Notes
1.4.0
What's Changed
- Add
GlobalID::Locator.fetchwith distinct not-found and unavailable errors by @rosa in #206- Change the underlying URI parser (from RFC2396 to RFC3986) by @Drowze in #202
- Don't try to constantize GID's class too soon by @paulRbr in #204
- Allow custom locators to override model class by @xijo in #203
New Contributors
- @rosa made their first contribution in #206
- @Drowze made their first contribution in #202
- @paulRbr made their first contribution in #204
- @xijo made their first contribution in #203
Full Changelog: v1.3.0...v1.4.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 14 commits:
Release 1.4.0Frozen string literalsMerge pull request #203 from xijo/support_model_class_override_for_custom_locatorsAllow custom locators to override model class derivationMerge pull request #204 from paulRbr/dont-constantize-model-when-not-neededDon't try to constantize GID's class too soonMerge pull request #202 from Drowze/swappable-uri-parserChange the underlying URI parser (from RFC2396 to RFC3986)Merge pull request #206 from rosa/fetchAdd `GlobalID::Locator.fetch` with distinct not-found and unavailable errorsMerge pull request #207 from byroot/fix-ciUpdate CI matrixAdd minitest-mock in GemfileProperly require rails in the Railtie
βοΈ marcel (indirect, 1.1.0 β 1.2.1) Β· Repo Β· Changelog
Release Notes
1.2.1
- Revert BMP images type to just
image/bmpinstead ofimage/bmp;format=compressed.
The later is more precise, but cause backward compatibility issues with Active Storage.Full Changelog: v1.2.0...v1.2.1
1.2.0
What's Changed
- Stop mutating source IO state during magic-byte detection by @andreaslillebo in #143
- improve SVG detection by @alexanderadam in #129
- improve HTML detection by @alexanderadam in #130
- add fixture for BOM CSV by @alexanderadam in #134
- add unicode string support by @alexanderadam in #138
- Add support for Sony RAW image format magic detection by @bogdan in #142
- Add support for .gpx files by @trekdemo in #113
- add
tika.xmlregex support by @alexanderadam in #132- add pkcs8 detection by @alexanderadam in #133
- Add hprof fixture and fix trailing space bug by @alexanderadam in #136
New Contributors
- @andreaslillebo made their first contribution in #143
- @alexanderadam made their first contribution in #129
- @bogdan made their first contribution in #142
- @trekdemo made their first contribution in #113
Full Changelog: v1.1.1...v1.2.0
1.1.1
What's Changed
New Contributors
Full Changelog: v1.1.0...v1.1.1
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 37 commits:
Release 1.2.1Merge pull request #148 from rails/bmp-raw-typeRelease 1.2.0Prefer audio/ogg instead of audio/opusMerge pull request #136 from alexanderadam/fix/remove_trailing_mime_type_spaces_and_add_hprof_fixture_issue_112Add hprof to allowed regexp typesAlways run generate_tables.rbRemove trailign type name in all tablesremove trailing mime type spaces & hprof fixtureMerge pull request #133 from alexanderadam/fix/p8_detection_issue_90Merge pull request #132 from alexanderadam/fix/bzip2_detection_with_regex_issue_128Generate regexp directly during build not bootUpdate tika.xmlsimplify regex logic and allow only tested typesadd tika regex supportFix trailing space in hprof formatMerge pull request #113 from trekdemo/add-gpxAdd support for .gpx filesMerge pull request #142 from bogdan/x-raw-sonyAdd support for Sony RAW image formatMerge pull request #138 from alexanderadam/feat/add_unicode_string_type_supportMerge pull request #137 from alexanderadam/feat/more_fixtures_issue_2Merge pull request #134 from alexanderadam/feat/add_test_fixture_for_BOM_CSV_issue_103Merge pull request #130 from alexanderadam/fix/improve_html_detection_issue_79Merge pull request #129 from alexanderadam/fix/improve_svg_detection_issue_107Just use String#bMerge pull request #143 from andreaslillebo/mime-type-for-mutates-io-encodingRelease 1.1.1Remove now-redundant Ruby 3.4 frozen-string workaroundsStop mutating source IO encoding during magic-byte detectionFix Ruby 3.4 frozen string literal warnings with StringIO (#140)improve SVG detectionadd unicode string supportfeat: add more fixturesadd fixture for BOM CSVadd pkcs8 detectionimprove HTML detection
βοΈ net-imap (indirect, 0.6.6 β 0.6.8) Β· Repo Β· Changelog
Release Notes
0.6.8
What's Changed
Added
- π₯ Map
IO::TimeoutErrortoNet::OpenTimeoutby @jbourassa in #770- π₯ Improved SequenceSet implicit integer coercion by @nevans in #783
Fixed
- π Fix
ResponseParseruse of global config by @nevans in #769- π Fix
SequenceSet#slicewhen starting at "*" by @nevans in #772- π Fix
SequenceSet#slicewith valid positiverange.beginbut invalid negativerange.endby @nevans in #776- π Fix
SequenceSet#slice-> nil for invalid start by @nevans in #777- π Fix
SequenceSet#slice(cardinality..any)-> empty by @nevans in #778- π Allow
SequenceSet#slicelength to be zero by @nevans in #781- π Allow
SequenceSet#slicelength to be negative by @nevans in #782Documentation
Other Changes
- β»οΈ Extract internal
Utilsmodule by @nevans in #779- β»οΈ Refactoring
SequenceSet#[]and#ordered_atinternals by @nevans in #774Miscellaneous
- β Upgrade simplecov config for 1.2.0 by @nevans in #780
- β Improve
SequenceSet#slicetest coverage by @nevans in #773New Contributors
- @jbourassa made their first contribution in #770
Full Changelog: v0.6.7...v0.6.8
0.6.7
What's Changed
Added
- β¨ Add SequenceSet predicates for comparing any/all/none above/below a number by @nevans in #737
- Parse NIL APPENDLIMIT values in STATUS responses by @OskarEichler in #749
- ποΈ Add
#tls_socket?and#tls_connected?debug methods by @nevans in #767Fixed
- Compare SearchResult values instead of hashes in eql? by @OskarEichler in #738
- Honor clone freeze keywords for
ConfigandSequenceSetby @OskarEichler in #739- Normalize response types consistently when clearing responses by @OskarEichler in #747
- Handle zero and negative SequenceSet min/max counts by @OskarEichler in #742
- Keep large ordered sequence indices as integers by @OskarEichler in #743
- Accept string arguments in SequenceSet delete? by @OskarEichler in #741
- Use the documented 16 KiB non-synchronizing literal default by @OskarEichler in #744
- Parse STATUS responses with empty attribute lists by @OskarEichler in #748
- Match ID string literal bytes without encoding conflicts by @OskarEichler in #740
- π Fix
#inspectoutput whenSSLSocket#connectfails by @nevans in #764- π Don't freeze caller's
ssl: ctx_paramshash by @nevans in #765Documentation
- ποΈ Fix Config attributes docs broken by rdoc 8.0 by @nevans in #735
- ποΈ Fix ghost
method:directives broken by rdoc 8.0 by @nevans in #734- π Various documentation updates by @nevans in #763
Other Changes
- Use benchmark_driver by @nobu in #733
- β»οΈ Match subclasses in
SearchResult#eql?/#hashby @nevans in #751- Preserve caller fetch modifiers when adding keyword options by @OskarEichler in #746
- β‘ Scan raw command literals without copying the remaining input by @OskarEichler in #745
Miscellaneous
- β Update bin/test test runner and README by @nevans in #727
- β Ratchet up minimum test coverage requirements by @nevans in #725
- β Move various IMAP client tests to their own files by @nevans in #728
- β Use release version of test-unit-ruby-core by @nevans in #736
- β Fix JRuby local backtrace test assertions by @nevans in #732
- β Improve
SearchResult#eql?and#hashtests by @nevans in #750- β¬οΈ Bump step-security/harden-runner from 2.20.0 to 2.21.0 by @dependabot[bot] in #731
- β¬οΈ Bump step-security/harden-runner from 2.21.0 to 2.21.1 by @dependabot[bot] in #761
New Contributors
- @OskarEichler made their first contribution in #738
Full Changelog: v0.6.6...v0.6.7
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ net-protocol (indirect, 0.3.0 β 0.4.0) Β· Repo Β· Changelog
Release Notes
0.4.0
What's Changed
- Only require io/wait on Ruby versions earlier than 3.2 by @headius in #75
- Take #69, #70 and #71, each with a test by @hsbt in #77
New Contributors
Full Changelog: v0.3.0...v0.4.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 13 commits:
v0.4.0Merge pull request #77 from ruby/claude/great-vaughan-8eb8d4Test that an exception out of a message leaves the IO usableRestore message logging and clear write state on exceptional exitsTest that write0 honours a :wait_readable from the socketWait for readability when an SSL write requests itTest that a negative read length leaves the buffer aloneReject negative read lengths before changing the bufferMerge pull request #75 from headius/io-wait-requireOnly require io/wait on Ruby versions earlier than 3.2Merge pull request #73 from ruby/dependabot/github_actions/step-security/harden-runner-2.21.1Bump step-security/harden-runner from 2.21.0 to 2.21.1Exclude dependabot updates from release note
βοΈ net-smtp (indirect, 0.5.1 β 0.5.2) Β· Repo Β· Changelog
Release Notes
0.5.2
What's Changed
- Rescue SystemCallError in the TLS test server by @hsbt in #107
- Reset SMTP error state before opening a fresh session by @OskarEichler in #101
- Preserve caller SSL context options when starting SMTP by @OskarEichler in #99
- Initialize SMTP exception messages through the superclass by @OskarEichler in #103
New Contributors
- @OskarEichler made their first contribution in #101
Full Changelog: v0.5.1...v0.5.2
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 20 commits:
v0.5.2Enabled trusted publisherExclude dependabot updates from release noteMerge pull request #103 from OskarEichler/codex/errors-smtpMerge pull request #99 from OskarEichler/codex/options-smtpMerge pull request #101 from OskarEichler/codex/retry-smtpMerge pull request #107 from ruby/claude/jovial-babbage-818864Rescue SystemCallError in the TLS test serverAdd regression coverage for initialize smtp exception messages through the superclassAdd regression coverage for reset smtp error state before opening a fresh sessionAdd regression coverage for preserve caller ssl context options when starting smtpInitialize SMTP exception messages through the superclassReset SMTP error state before opening a fresh sessionPreserve caller SSL context options when starting SMTPMerge pull request #98 from ruby/dependabot/github_actions/actions/checkout-7Bump actions/checkout from 6 to 7Merge pull request #96 from ruby/dependabot/github_actions/actions/checkout-6Bump actions/checkout from 5 to 6Merge pull request #93 from ruby/dependabot/github_actions/actions/checkout-5Bump actions/checkout from 4 to 5
βοΈ rack (indirect, 2.2.25 β 3.2.9) Β· Repo Β· Changelog
Security Advisories π¨
π¨ Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch
Summary
Rack::Staticnormalizes the request path withUtils.clean_path_infowhen deciding which file to serve, but matchesheader_rulesagainst a path that is only URL-decoded. A request containing dot segments, raw or percent-encoded, is served the normalized target file while the header rules for that file's location are not applied.This allows an attacker to receive a protected static file without the security headers configured for it.
Details
Rack::Static#callcomputes the served path asUtils.clean_path_info(Utils.unescape_path(path)).Rack::Static#applicable_rulesapplies onlyUtils.unescape_pathbefore testing string and regular expression rules. A request for/assets/../uploads/file.htmlor/assets/..%2fuploads/file.htmlis served asuploads/file.html, but the decoded path/assets/../uploads/file.htmldoes not start withuploads, so a rule scoped to that directory never matches.The fix for CVE-2026-34786 (GHSA-q4qf-9j86-f5mh) added URL decoding to rule matching but did not add dot segment normalization, so versions that include that fix remain affected.
Impact
Applications that use
Rack::Staticheader_rulesto attach security-relevant headers to particular paths or file types are affected. An unauthenticated attacker who knows the path of a protected file can request it through a dot segment path and receive it without those headers, for example withoutContent-Disposition: attachmentor a restrictiveContent-Security-Policythat prevents uploaded HTML from rendering inline. The file itself is served unchanged. Applications that do not use path-specificheader_rulesare not affected.Mitigation
- Update to a patched version of Rack in which
header_rulesare matched against the same normalized path used to serve the file.- Reject requests containing dot segments at a reverse proxy or application boundary.
- Do not rely solely on
Rack::Staticheader_rulesto prevent inline rendering of untrusted uploads; serve them from a separate origin.Credit
- Reporter and Remediation developer
π¨ Rack: Multipart parsing allows DoS via unbounded scan buffer growth
Summary
Rack::Multipart::Parserreads the request body in chunks ofrack.multipart.buffer_size(1 MiB by default) into an internal scan buffer. Parsed bytes are only discarded from that buffer when a chunk ends inside a part body. A request whose parts are sized so that every chunk ends inside, or immediately after, a part's headers is never compacted, so the buffer grows to the size of the request.This results in a denial of service condition through memory exhaustion for applications that parse multipart requests.
Details
The parser appends each chunk read from the input to a
StringScannerand advances through boundaries, headers, and bodies. In the body state, when no closing boundary is found, the consumed prefix is removed before more data is read. In the header state, and in the body state when no body bytes have been consumed yet, the parser requests more data without removing anything. Bytes skipped between parts are not counted against any limit.An attacker can therefore construct parts that each fit within one chunk and align the chunk boundaries with the part headers. The existing limits on buffered non-file field data, header size, and preamble size do not apply, because each individual part remains small. With default limits the buffer can reach roughly 4 GiB (4096 parts of about 1 MiB). Ordinary file uploads aligned the same way are bounded by the file part limit at roughly 128 MiB per request.
Impact
Any application that parses multipart requests with Rack is affected in its default configuration. An unauthenticated attacker can cause a single request to hold memory proportional to its size for the duration of parsing, exhausting worker memory. The attack requires only a well-formed multipart body.
Mitigation
- Update to a patched version of Rack in which the parser discards parsed bytes from its scan buffer before reading more data.
- Limit the request body size at a reverse proxy or application boundary.
- Set
RACK_MULTIPART_PARSER_BYTESIZE_LIMITto the largest multipart body the application needs to accept, which bounds the memory a single request can hold.
π¨ Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass
Summary
The guard added for CVE-2026-26961 (GHSA-vgpv-f759-9wx3), which rejects multipart requests with more than one
boundaryparameter, only inspects the part of theContent-Typeheader after the boundary it extracts. AContent-Typewhose firstboundaryparameter is empty or begins with a quote, semicolon, or comma is skipped by the extraction pattern, so a secondboundaryparameter is accepted silently and Rack parses the body with a boundary that a conforming parser would not derive from the header.Details
Rack::Multipart::Parser.parse_boundaryextracts the boundary with a regular expression that uses a lazy prefix and a value class excluding",;, and,. For a header such asmultipart/form-data; boundary=";boundary=AaB03x"ormultipart/form-data; boundary=; boundary=AaB03x, the pattern skips the firstboundary=and anchors on the second, and the subsequent check for anotherboundary=in the remaining text finds nothing. Rack then usesAaB03x.RFC 9110 parses the first header as a single parameter whose value is
;boundary=AaB03x, which is not a legal boundary under RFC 2046, so the only conformant outcome is rejection. Inspecting intermediaries that implement the standard grammar, such as ModSecurity, see a different boundary or no multipart body at all.The fix counts
boundary=occurrences across the entire header value and rejects the request when there is more than one.Impact
As with CVE-2026-26961, an attacker can craft a multipart request that a web application firewall or other inspecting proxy in front of a Rack application interprets differently from Rack, so form fields and file uploads reach the application without inspection. Rack itself grants no capability beyond that of a well-formed request with the same body. All supported versions, including 2.2, are affected.
Mitigation
- Update to a patched version of Rack.
- Reject requests whose
Content-Typecontains more than oneboundaryparameter at the reverse proxy.
π¨ Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header β incomplete fix of CVE-2026-34835
Summary
Rack::Request#host_with_port, and therefore#base_urland#url, return the raw authority string when it fails validation. An attacker-controlledHost,X-Forwarded-Host, orForwarded: host=value containing characters that are not permitted in an authority is embedded verbatim in URLs generated by the application.This completes the fix for CVE-2026-34835 (GHSA-g2pf-xv49-m2h5), which made
#hostand#hostnamereturnnilfor an invalid authority but left this path unchanged.Details
Rack::Request#host_with_portsplits the authority withsplit_authority. When theAUTHORITYpattern does not match, no components are returned andhost_with_portfalls back to returning the unvalidated authority string.base_urlis"#{scheme}://#{host_with_port}"andurlappends the full path, so both inherit the raw value.For a request with
Host: evil.com/@legit.com,hostreturnsnilwhilehost_with_portreturnsevil.com/@legit.comandbase_urlreturnshttp://evil.com/@legit.com. A validHosttogether with an invalidX-Forwarded-Hostproduces the same result, because forwarded headers take priority by default.Impact
Applications that build absolute URLs, redirects, or origin-dependent checks from
req.url,req.base_url, orreq.host_with_port, and that do not enforce a host allowlist, may emit URLs containing attacker-chosen characters such as@,/,?,#, spaces, or angle brackets. Generated links andLocationheaders can be redirected through userinfo tricks, string-based URL checks can be bypassed, and markup is reflected where the application does not escape the value. For example,redirectin Sinatra behind a proxy that forwardsX-Forwarded-Hostemits the raw invalid authority inLocation.Rails overrides these methods in Action Dispatch and is not expected to be affected. Rack 3.1 and 3.2 are affected. Rack 2.2 did not receive the CVE-2026-34835 change and returns the raw value from every host method.
Mitigation
- Update to a patched version of Rack, in which
host_with_portreturnsnilfor an invalid authority andbase_urlfalls back to the server's own name.- Enforce a host allowlist with
Rack::Protection::HostAuthorization,config.hostsin Rails, or at the reverse proxy, and configure the proxy to overwriteX-Forwarded-HostandForwarded.- Pin the authority with the
rack.request.config:authoritykey where available.
π¨ Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch
Summary
Rack::Staticnormalizes the request path withUtils.clean_path_infowhen deciding which file to serve, but matchesheader_rulesagainst a path that is only URL-decoded. A request containing dot segments, raw or percent-encoded, is served the normalized target file while the header rules for that file's location are not applied.This allows an attacker to receive a protected static file without the security headers configured for it.
Details
Rack::Static#callcomputes the served path asUtils.clean_path_info(Utils.unescape_path(path)).Rack::Static#applicable_rulesapplies onlyUtils.unescape_pathbefore testing string and regular expression rules. A request for/assets/../uploads/file.htmlor/assets/..%2fuploads/file.htmlis served asuploads/file.html, but the decoded path/assets/../uploads/file.htmldoes not start withuploads, so a rule scoped to that directory never matches.The fix for CVE-2026-34786 (GHSA-q4qf-9j86-f5mh) added URL decoding to rule matching but did not add dot segment normalization, so versions that include that fix remain affected.
Impact
Applications that use
Rack::Staticheader_rulesto attach security-relevant headers to particular paths or file types are affected. An unauthenticated attacker who knows the path of a protected file can request it through a dot segment path and receive it without those headers, for example withoutContent-Disposition: attachmentor a restrictiveContent-Security-Policythat prevents uploaded HTML from rendering inline. The file itself is served unchanged. Applications that do not use path-specificheader_rulesare not affected.Mitigation
- Update to a patched version of Rack in which
header_rulesare matched against the same normalized path used to serve the file.- Reject requests containing dot segments at a reverse proxy or application boundary.
- Do not rely solely on
Rack::Staticheader_rulesto prevent inline rendering of untrusted uploads; serve them from a separate origin.Credit
- Reporter and Remediation developer
π¨ Rack: Multipart parsing allows DoS via unbounded scan buffer growth
Summary
Rack::Multipart::Parserreads the request body in chunks ofrack.multipart.buffer_size(1 MiB by default) into an internal scan buffer. Parsed bytes are only discarded from that buffer when a chunk ends inside a part body. A request whose parts are sized so that every chunk ends inside, or immediately after, a part's headers is never compacted, so the buffer grows to the size of the request.This results in a denial of service condition through memory exhaustion for applications that parse multipart requests.
Details
The parser appends each chunk read from the input to a
StringScannerand advances through boundaries, headers, and bodies. In the body state, when no closing boundary is found, the consumed prefix is removed before more data is read. In the header state, and in the body state when no body bytes have been consumed yet, the parser requests more data without removing anything. Bytes skipped between parts are not counted against any limit.An attacker can therefore construct parts that each fit within one chunk and align the chunk boundaries with the part headers. The existing limits on buffered non-file field data, header size, and preamble size do not apply, because each individual part remains small. With default limits the buffer can reach roughly 4 GiB (4096 parts of about 1 MiB). Ordinary file uploads aligned the same way are bounded by the file part limit at roughly 128 MiB per request.
Impact
Any application that parses multipart requests with Rack is affected in its default configuration. An unauthenticated attacker can cause a single request to hold memory proportional to its size for the duration of parsing, exhausting worker memory. The attack requires only a well-formed multipart body.
Mitigation
- Update to a patched version of Rack in which the parser discards parsed bytes from its scan buffer before reading more data.
- Limit the request body size at a reverse proxy or application boundary.
- Set
RACK_MULTIPART_PARSER_BYTESIZE_LIMITto the largest multipart body the application needs to accept, which bounds the memory a single request can hold.
π¨ Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass
Summary
The guard added for CVE-2026-26961 (GHSA-vgpv-f759-9wx3), which rejects multipart requests with more than one
boundaryparameter, only inspects the part of theContent-Typeheader after the boundary it extracts. AContent-Typewhose firstboundaryparameter is empty or begins with a quote, semicolon, or comma is skipped by the extraction pattern, so a secondboundaryparameter is accepted silently and Rack parses the body with a boundary that a conforming parser would not derive from the header.Details
Rack::Multipart::Parser.parse_boundaryextracts the boundary with a regular expression that uses a lazy prefix and a value class excluding",;, and,. For a header such asmultipart/form-data; boundary=";boundary=AaB03x"ormultipart/form-data; boundary=; boundary=AaB03x, the pattern skips the firstboundary=and anchors on the second, and the subsequent check for anotherboundary=in the remaining text finds nothing. Rack then usesAaB03x.RFC 9110 parses the first header as a single parameter whose value is
;boundary=AaB03x, which is not a legal boundary under RFC 2046, so the only conformant outcome is rejection. Inspecting intermediaries that implement the standard grammar, such as ModSecurity, see a different boundary or no multipart body at all.The fix counts
boundary=occurrences across the entire header value and rejects the request when there is more than one.Impact
As with CVE-2026-26961, an attacker can craft a multipart request that a web application firewall or other inspecting proxy in front of a Rack application interprets differently from Rack, so form fields and file uploads reach the application without inspection. Rack itself grants no capability beyond that of a well-formed request with the same body. All supported versions, including 2.2, are affected.
Mitigation
- Update to a patched version of Rack.
- Reject requests whose
Content-Typecontains more than oneboundaryparameter at the reverse proxy.
π¨ Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header β incomplete fix of CVE-2026-34835
Summary
Rack::Request#host_with_port, and therefore#base_urland#url, return the raw authority string when it fails validation. An attacker-controlledHost,X-Forwarded-Host, orForwarded: host=value containing characters that are not permitted in an authority is embedded verbatim in URLs generated by the application.This completes the fix for CVE-2026-34835 (GHSA-g2pf-xv49-m2h5), which made
#hostand#hostnamereturnnilfor an invalid authority but left this path unchanged.Details
Rack::Request#host_with_portsplits the authority withsplit_authority. When theAUTHORITYpattern does not match, no components are returned andhost_with_portfalls back to returning the unvalidated authority string.base_urlis"#{scheme}://#{host_with_port}"andurlappends the full path, so both inherit the raw value.For a request with
Host: evil.com/@legit.com,hostreturnsnilwhilehost_with_portreturnsevil.com/@legit.comandbase_urlreturnshttp://evil.com/@legit.com. A validHosttogether with an invalidX-Forwarded-Hostproduces the same result, because forwarded headers take priority by default.Impact
Applications that build absolute URLs, redirects, or origin-dependent checks from
req.url,req.base_url, orreq.host_with_port, and that do not enforce a host allowlist, may emit URLs containing attacker-chosen characters such as@,/,?,#, spaces, or angle brackets. Generated links andLocationheaders can be redirected through userinfo tricks, string-based URL checks can be bypassed, and markup is reflected where the application does not escape the value. For example,redirectin Sinatra behind a proxy that forwardsX-Forwarded-Hostemits the raw invalid authority inLocation.Rails overrides these methods in Action Dispatch and is not expected to be affected. Rack 3.1 and 3.2 are affected. Rack 2.2 did not receive the CVE-2026-34835 change and returns the raw value from every host method.
Mitigation
- Update to a patched version of Rack, in which
host_with_portreturnsnilfor an invalid authority andbase_urlfalls back to the server's own name.- Enforce a host allowlist with
Rack::Protection::HostAuthorization,config.hostsin Rails, or at the reverse proxy, and configure the proxy to overwriteX-Forwarded-HostandForwarded.- Pin the authority with the
rack.request.config:authoritykey where available.
π¨ Rack::Request accepts invalid Host characters, enabling host allowlist bypass
Summary
Rack::Requestparses theHostheader using anAUTHORITYregular expression that accepts characters not permitted in RFC-compliant hostnames, including/,?,#, and@. Becausereq.hostreturns the full parsed value, applications that validate hosts using naive prefix or suffix checks can be bypassed.For example, a check such as
req.host.start_with?("myapp.com")can be bypassed withHost: myapp.com@evil.com, and a check such asreq.host.end_with?("myapp.com")can be bypassed withHost: evil.com/myapp.com.This can lead to host header poisoning in applications that use
req.host,req.url, orreq.base_urlfor link generation, redirects, or origin validation.Details
Rack::Requestparses the authority component using logic equivalent to:AUTHORITY = / \A (?<host> \[(?<address>#{ipv6})\] | (?<address>[[[:graph:]&&[^\[\]]]]*?) ) (:(?<port>\d+))? \z /xThe character class used for non-IPv6 hosts accepts nearly all printable characters except
[and]. This includes reserved URI delimiters such as@,/,?, and#, which are not valid hostname characters under RFC 3986 host syntax.As a result, values such as the following are accepted and returned through
req.host:myapp.com@evil.com evil.com/myapp.com evil.com#myapp.comApplications that attempt to allowlist hosts using string prefix or suffix checks may therefore treat attacker-controlled hosts as trusted. For example:
req.host.start_with?("myapp.com")accepts:
myapp.com@evil.comand:
req.host.end_with?("myapp.com")accepts:
evil.com/myapp.comWhen those values are later used to build absolute URLs or enforce origin restrictions, the application may produce attacker-controlled results.
Impact
Applications that rely on
req.host,req.url, orreq.base_urlmay be affected if they perform naive host validation or assume Rack only returns RFC-valid hostnames.In affected deployments, an attacker may be able to bypass host allowlists and poison generated links, redirects, or origin-dependent security decisions. This can enable attacks such as password reset link poisoning or other host header injection issues.
The practical impact depends on application behavior. If the application or reverse proxy already enforces strict host validation, exploitability may be reduced or eliminated.
Mitigation
- Update to a patched version of Rack that rejects invalid authority characters in
Host.- Enforce strict
Hostheader validation at the reverse proxy or load balancer.- Do not rely on prefix or suffix string checks such as
start_with?orend_with?for host allowlisting.- Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.
π¨ Rack::Static prefix matching can expose unintended files under the static root
Summary
Rack::Staticdetermines whether a request should be served as a static file using a simple string prefix check. When configured with URL prefixes such as"/css", it matches any request path that begins with that string, including unrelated paths such as"/css-config.env"or"/css-backup.sql".As a result, files under the static root whose names merely share the configured prefix may be served unintentionally, leading to information disclosure.
Details
Rack::Static#route_fileperforms static-route matching using logic equivalent to:@urls.any? { |url| path.index(url) == 0 }This checks only whether the request path starts with the configured prefix string. It does not require a path segment boundary after the prefix.
For example, with:
use Rack::Static, urls: ["/css", "/js"], root: "public"the following path is matched as intended:
/css/style.cssbut these paths are also matched:
/css-config.env /css-backup.sql /csssecrets.ymlIf such files exist under the configured static root, Rack forwards the request to the file server and serves them as static content.
This means a configuration intended to expose only directory trees such as
/css/...and/js/...may also expose sibling files whose names begin with those same strings.Impact
An attacker can request files under the configured static root whose names share a configured URL prefix and obtain their contents.
In affected deployments, this may expose configuration files, secrets, backups, environment files, or other unintended static content located under the same root directory.
Mitigation
- Update to a patched version of Rack that enforces a path boundary when matching configured static URL prefixes.
- Match only paths that are either exactly equal to the configured prefix or begin with
prefix + "/".- Avoid placing sensitive files under the
Rack::Staticroot directory.- Prefer static URL mappings that cannot overlap with sensitive filenames.
π¨ Rack:: Static header_rules bypass via URL-encoded paths
Summary
Rack::Static#applicable_rulesevaluates severalheader_rulestypes against the raw URL-encodedPATH_INFO, while the underlying file-serving path is decoded before the file is served. As a result, a request for a URL-encoded variant of a static path can serve the same file without the headers thatheader_ruleswere intended to apply.In deployments that rely on
Rack::Staticto attach security-relevant response headers to static content, this can allow an attacker to bypass those headers by requesting an encoded form of the path.Details
Rack::Static#applicable_rulesmatches rule types such as:fonts,Array, andRegexpdirectly against the incomingPATH_INFO. For example:when :fonts /\.(?:ttf|otf|eot|woff2|woff|svg)\z/.match?(path) when Array /\.(#{rule.join('|')})\z/.match?(path) when Regexp rule.match?(path)These checks operate on the raw request path. If the request contains encoded characters such as
%2Ein place of., the rule may fail to match even though the file path is later decoded and served successfully by the static file server.For example, both of the following requests may resolve to the same file on disk:
/fonts/test.woff /fonts/test%2Ewoffbut only the unencoded form may receive the headers configured through
header_rules.This creates a canonicalization mismatch between the path used for header policy decisions and the path ultimately used for file serving.
Impact
Applications that rely on
Rack::Staticheader_rulesto apply security-relevant headers to static files may be affected.In affected deployments, an attacker can request an encoded variant of a static file path and receive the same file without the intended headers. Depending on how
header_rulesare used, this may bypass protections such as clickjacking defenses, content restrictions, or other response policies applied to static content.The practical impact depends on the configured rules and the types of files being served. If
header_rulesare only used for non-security purposes such as caching, the issue may have limited security significance.Mitigation
- Update to a patched version of Rack that applies
header_rulesto a decoded path consistently with static file resolution.- Do not rely solely on
Rack::Staticheader_rulesfor security-critical headers where encoded path variants may reach the application.- Prefer setting security headers at the reverse proxy or web server layer so they apply consistently to both encoded and unencoded path forms.
- Normalize or reject encoded path variants for static content at the edge, where feasible.
π¨ Rack's multipart byte range processing allows denial of service via excessive overlapping ranges
Summary
Rack::Utils.get_byte_rangesparses the HTTPRangeheader without limiting the number of individual byte ranges. Although the existing fix for CVE-2024-26141 rejects ranges whose total byte coverage exceeds the file size, it does not restrict the count of ranges. An attacker can supply many small overlapping ranges such as0-0,0-0,0-0,...to trigger disproportionate CPU, memory, I/O, and bandwidth consumption per request.This results in a denial of service condition in Rack file-serving paths that process multipart byte range responses.
Details
Rack::Utils.get_byte_rangesaccepts a comma-separated list of byte ranges and validates them based on their aggregate size, but does not impose a limit on how many individual ranges may be supplied.As a result, a request such as:
Range: bytes=0-0,0-0,0-0,0-0,...can contain thousands of overlapping one-byte ranges while still satisfying the total-size check added for CVE-2024-26141.
When such a header is processed by Rackβs file-serving code, each range causes additional work, including multipart response generation, per-range iteration, file seek and read operations, and temporary string allocation for response size calculation and output. This allows a relatively small request header to trigger disproportionately expensive processing and a much larger multipart response.
The issue is distinct from CVE-2024-26141. That fix prevents range sets whose total byte coverage exceeds the file size, but does not prevent a large number of overlapping ranges whose summed size remains within that limit.
Impact
Applications that expose file-serving paths with byte range support may be vulnerable to denial of service.
An unauthenticated attacker can send crafted
Rangeheaders containing many small overlapping ranges to consume excessive CPU time, memory, file I/O, and bandwidth. Repeated requests may reduce application availability and increase pressure on workers and garbage collection.Mitigation
- Update to a patched version of Rack that limits the number of accepted byte ranges.
- Reject or normalize multipart byte range requests containing excessive range counts.
- Consider disabling multipart range support where it is not required.
- Apply request filtering or header restrictions at the reverse proxy or application boundary to limit abusive
Rangeheaders.
π¨ Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters
Summary
Rack::Multipart::Parser#handle_mime_headparses quoted multipart parameters such asContent-Disposition: form-data; name="..."using repeatedString#indexsearches combined withString#slice!prefix deletion. For escape-heavy quoted values, this causes super-linear processing.An unauthenticated attacker can send a crafted
multipart/form-datarequest containing many parts with long backslash-escaped parameter values to trigger excessive CPU usage during multipart parsing.This results in a denial of service condition in Rack applications that accept multipart form data.
Details
Rack::Multipart::Parser#handle_mime_headparses quoted parameter values by repeatedly:
- Searching for the next quote or backslash,
- Copying the preceding substring into a new buffer, and
- Removing the processed prefix from the original string with
slice!.An attacker can exploit this by sending a multipart request with many parts whose
nameparameters contain long escape-heavy values such as:name="a\\a\\a\\a\\a\\..."Under default Rack limits, a request can contain up to 4095 parts. If many of those parts use long quoted values with dense escape characters, the parser performs disproportionately expensive CPU work while remaining within normal request size and part-count limits.
Impact
Any Rack application that accepts
multipart/form-datarequests may be affected, including file upload endpoints and standard HTML form handlers.An unauthenticated attacker can send crafted multipart requests that consume excessive CPU time during request parsing. Repeated requests can tie up application workers, reduce throughput, and degrade or deny service availability.
Mitigation
- Update to a patched version of Rack that parses quoted multipart parameters without repeated rescanning and destructive prefix deletion.
- Apply request throttling or rate limiting to multipart upload endpoints.
- Where operationally feasible, restrict or isolate multipart parsing on untrusted high-volume endpoints.
π¨ Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.
Summary
Rack::Multipart::Parserextracts theboundaryparameter frommultipart/form-datausing a greedy regular expression. When aContent-Typeheader contains multipleboundaryparameters, Rack selects the last one rather than the first.In deployments where an upstream proxy, WAF, or intermediary interprets the first
boundaryparameter, this mismatch can allow an attacker to smuggle multipart content past upstream inspection and have Rack parse a different body structure than the intermediary validated.Details
Rack identifies the multipart boundary using logic equivalent to:
MULTIPART = %r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|niBecause the expression is greedy, it matches the last
boundary=parameter in a header such as:Content-Type: multipart/form-data; boundary=safe; boundary=maliciousAs a result, Rack parses the request body using
malicious, while another component may interpret the same header usingsafe.This creates an interpretation conflict. If an upstream WAF or proxy inspects multipart parts using the first boundary and Rack later parses the body using the last boundary, a client may be able to place malicious form fields or uploaded content in parts that Rack accepts but the upstream component did not inspect as intended.
This issue is most relevant in layered deployments where security decisions are made before the request reaches Rack.
Impact
Applications that accept
multipart/form-datauploads behind an inspecting proxy or WAF may be affected.In such deployments, an attacker may be able to bypass upstream filtering of uploaded files or form fields by sending a request with multiple
boundaryparameters and relying on the intermediary and Rack to parse the request differently.The practical impact depends on deployment architecture. If no upstream component relies on a different multipart interpretation, this behavior may not provide meaningful additional attacker capability.
Mitigation
- Update to a patched version of Rack that rejects ambiguous multipart
Content-Typeheaders or parses duplicateboundaryparameters consistently.- Reject requests containing multiple
boundaryparameters.- Normalize or regenerate multipart metadata at the trusted edge before forwarding requests to Rack.
- Avoid relying on upstream inspection of malformed multipart requests unless duplicate parameter handling is explicitly consistent across components.
π¨ Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
Summary
Rack::Utils.forwarded_valuesparses the RFC 7239Forwardedheader by splitting on semicolons before handling quoted-string values. Because quoted values may legally contain semicolons, a header such as:Forwarded: for="127.0.0.1;host=evil.com;proto=https"can be interpreted by Rack as multiple
Forwardeddirectives rather than as a single quotedforvalue.In deployments where an upstream proxy, WAF, or intermediary validates or preserves quoted
Forwardedvalues differently, this discrepancy can allow an attacker to smugglehost,proto,for, orbyparameters through a single header value.Details
Rack::Utils.forwarded_valuesprocesses the header using logic equivalent to:forwarded_header.split(';').each_with_object({}) do |field, values| field.split(',').each do |pair| pair = pair.split('=').map(&:strip).join('=') return nil unless pair =~ /\A(by|for|host|proto)="?([^"]+)"?\Z/i (values[$1.downcase.to_sym] ||= []) << $2 end endThe method splits on
;before it parses individualname=valuepairs. This is inconsistent with RFC 7239, which permits quoted-string values, and quoted strings may contain semicolons as literal content.As a result, a header value such as:
Forwarded: for="127.0.0.1;host=evil.com;proto=https"is not treated as a single
forvalue. Instead, Rack may interpret it as if the client had supplied separatefor,host, andprotodirectives.This creates an interpretation conflict when another component in front of Rack treats the quoted value as valid literal content, while Rack reparses it as multiple forwarding parameters.
Impact
Applications that rely on
Forwardedto derive request metadata may observe attacker-controlled values forhost,proto,for, or related URL components.In affected deployments, this can lead to host or scheme spoofing in derived values such as
req.host,req.scheme,req.base_url, orreq.url. Applications that use those values for password reset links, redirects, absolute URL generation, logging, IP-based decisions, or backend requests may be vulnerable to downstream security impact.The practical security impact depends on deployment architecture. If clients can already supply arbitrary trusted
Forwardedparameters directly, this bug may not add meaningful attacker capability. The issue is most relevant where an upstream component and Rack interpret the sameForwardedheader differently.Mitigation
- Update to a patched version of Rack that parses
Forwardedquoted-string values before splitting on parameter delimiters.- Avoid trusting client-supplied
Forwardedheaders unless they are normalized or regenerated by a trusted reverse proxy.- Prefer stripping inbound
Forwardedheaders at the edge and reconstructing them from trusted proxy metadata.- Avoid using
req.host,req.scheme,req.base_url, orreq.urlfor security-sensitive operations unless the forwarding chain is explicitly trusted and validated.
π¨ Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header
Summary
Rack::Utils.select_best_encodingprocessesAccept-Encodingvalues with quadratic time complexity when the header contains many wildcard (*) entries. Because this method is used byRack::Deflaterto choose a response encoding, an unauthenticated attacker can send a single request with a craftedAccept-Encodingheader and cause disproportionate CPU consumption on the compression middleware path.This results in a denial of service condition for applications using
Rack::Deflater.Details
Rack::Utils.select_best_encodingexpands parsedAccept-Encodingvalues into a list of candidate encodings. When an entry is*, the method computes the set of concrete encodings by subtracting the encodings already present in the request:if m == "*" (available_encodings - accept_encoding.map(&:first)).each do |m2| expanded_accept_encoding << [m2, q, preference] end else expanded_accept_encoding << [m, q, preference] endBecause
accept_encoding.map(&:first)is evaluated inside the loop, it is recomputed for each wildcard entry. If the request containsNwildcard entries, this produces repeated scans over the full parsed header and causes quadratic behavior.After expansion, the method also performs additional work over
expanded_accept_encoding, including per-entry deletion, which further increases the cost for large inputs.
Rack::Deflaterinvokes this method for each request when the middleware is enabled:Utils.select_best_encoding(ENCODINGS, Utils.parse_encodings(accept_encoding))As a result, a client can trigger this expensive code path simply by sending a large
Accept-Encodingheader containing many repeated wildcard values.For example, a request with an approximately 8 KB
Accept-Encodingheader containing about 1,000*;q=0.5entries can cause roughly 170 ms of CPU time in a single request on theRack::Deflaterpath, compared to a negligible baseline for a normal header.This issue is distinct from CVE-2024-26146. That issue concerned regular expression denial of service during
Acceptheader parsing, whereas this issue arises later during encoding selection after the header has already been parsed.Impact
Any Rack application using
Rack::Deflatermay be affected.An unauthenticated attacker can send requests with crafted
Accept-Encodingheaders to trigger excessive CPU usage in the encoding selection logic. Repeated requests can consume worker time disproportionately and reduce application availability.The attack does not require invalid HTTP syntax or large payload bodies. A single header-sized request is sufficient to reach the vulnerable code path.
Mitigation
- Update to a patched version of Rack in which encoding selection does not repeatedly rescan the parsed header for wildcard entries.
- Avoid enabling
Rack::Deflateron untrusted traffic.- Apply request filtering or header size / format restrictions at the reverse proxy or application boundary to limit abusive
Accept-Encodingvalues.
π¨ Rack has a root directory disclosure via unescaped regex interpolation in Rack::Directory
Summary
Rack::Directoryinterpolates the configuredrootpath directly into a regular expression when deriving the displayed directory path. Ifrootcontains regex metacharacters such as+,*, or., the prefix stripping can fail and the generated directory listing may expose the full filesystem path in the HTML output.Details
Rack::Directory::DirectoryBody#eachcomputes the visible path using code equivalent to:show_path = Utils.escape_html(path.sub(/\A#{root}/, ''))Here,
rootis a developer-configured filesystem path. It is normalized earlier withFile.expand_path(root)and then inserted directly into a regular expression without escaping.Because the value is treated as regex syntax rather than as a literal string, metacharacters in the configured path can change how the prefix match behaves. When that happens, the expected root prefix is not removed from
path, and the absolute filesystem path is rendered into the HTML directory listing.Impact
If
Rack::Directoryis configured to serve a directory whose absolute path contains regex metacharacters, the generated directory listing may disclose the full server filesystem path instead of only the request-relative path.This can expose internal deployment details such as directory layout, usernames, mount points, or naming conventions that would otherwise not be visible to clients.
Mitigation
- Update to a patched version of Rack in which the root prefix is removed using an escaped regular expression.
- Avoid using
Rack::Directorywith a root path that contains regular expression metacharacters.
π¨ Rack's multipart parsing without Content-Length header allows unbounded chunked file uploads
Summary
Rack::Multipart::Parseronly wraps the request body in aBoundedIOwhenCONTENT_LENGTHis present. When amultipart/form-datarequest is sent without aContent-Lengthheader, such as with HTTP chunked transfer encoding, multipart parsing continues until end-of-stream with no total size limit.For file parts, the uploaded body is written directly to a temporary file on disk rather than being constrained by the buffered in-memory upload limit. An unauthenticated attacker can therefore stream an arbitrarily large multipart file upload and consume unbounded disk space.
This results in a denial of service condition for Rack applications that accept multipart form data.
Details
Rack::Multipart::Parser.parseappliesBoundedIOonly whencontent_lengthis notnil:io = BoundedIO.new(io, content_length) if content_lengthWhen
CONTENT_LENGTHis absent, the parser reads the multipart body until EOF without a global byte limit.Although Rack enforces
BUFFERED_UPLOAD_BYTESIZE_LIMITfor retained non-file parts, file uploads are handled differently. When a multipart part includes a filename, the body is streamed to aTempfile, and the retained-size accounting is not applied to that file content. As a result, file parts are not subject to the same upload size bound.An attacker can exploit this by sending a chunked
multipart/form-datarequest containing a file part and continuously streaming data without declaring aContent-Length. Rack will continue writing the uploaded data to disk until the client stops or the server exhausts available storage.Impact
Any Rack application that accepts
multipart/form-datauploads may be affected if no upstream component enforces a request body size limit.An unauthenticated attacker can send a large chunked file upload to consume disk space on the application host. This may cause request failures, application instability, or broader service disruption if the host runs out of available storage.
The practical impact depends on deployment architecture. Reverse proxies or application servers that enforce upload limits may reduce or eliminate exploitability, but Rack itself does not impose a total multipart upload limit in this code path when
CONTENT_LENGTHis absent.Mitigation
- Update to a patched version of Rack that enforces a total multipart upload size limit even when
CONTENT_LENGTHis absent.- Enforce request body size limits at the reverse proxy or application server.
- Isolate temporary upload storage and monitor disk consumption for multipart endpoints.
π¨ Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect
Summary
Rack::Sendfile#map_accel_pathinterpolates the value of theX-Accel-Mappingrequest header directly into a regular expression when rewriting file paths forX-Accel-Redirect. Because the header value is not escaped, an attacker who can supplyX-Accel-Mappingto the backend can inject regex metacharacters and control the generatedX-Accel-Redirectresponse header.In deployments using
Rack::Sendfilewithx-accel-redirect, this can allow an attacker to cause nginx to serve unintended files from configured internal locations.Details
Rack::Sendfile#map_accel_pathprocesses header-supplied mappings using logic equivalent to:mapping.split(',').map(&:strip).each do |m| internal, external = m.split('=', 2).map(&:strip) new_path = path.sub(/\A#{internal}/i, external) return new_path unless path == new_path endHere,
internalcomes from theHTTP_X_ACCEL_MAPPINGrequest header and is inserted directly into a regular expression without escaping. This gives the header value regex semantics rather than treating it as a literal prefix.As a result, an attacker can supply metacharacters such as
.*or capture groups to alter how the path substitution is performed. For example, a mapping such as:X-Accel-Mapping: .*=/protected/secret.txtcauses the entire source path to match and rewrites the redirect target to a clean attacker-chosen internal path.
This differs from the documented behavior of the header-based mapping path, which is described as a simple substitution. While application-supplied mappings may intentionally support regular expressions, header-supplied mappings should be treated as literal path prefixes.
The issue is only exploitable when untrusted
X-Accel-Mappingheaders can reach Rack. One realistic case is a reverse proxy configuration that intends to setX-Accel-Mappingitself, but fails to do so on some routes, allowing a client-supplied header to pass through unchanged.Impact
Applications using
Rack::Sendfilewithx-accel-redirectmay be affected if the backend accepts attacker-controlledX-Accel-Mappingheaders.In affected deployments, an attacker may be able to control the
X-Accel-Redirectresponse header and cause nginx to serve files from internal locations that were not intended to be reachable through the application. This can lead to unauthorized file disclosure.The practical impact depends on deployment architecture. If the proxy always strips or overwrites
X-Accel-Mapping, or if the application uses explicit configured mappings instead of the request header, exploitability may be eliminated.Mitigation
- Update to a patched version of Rack that treats header-supplied
X-Accel-Mappingvalues as literal strings rather than regular expressions.- Strip or overwrite inbound
X-Accel-Mappingheaders at the reverse proxy so client-supplied values never reach Rack.- Prefer explicit application-configured sendfile mappings instead of relying on request-header mappings.
- Review proxy sub-locations and inherited header settings to ensure
X-Accel-Mappingis consistently set on all backend routes.
π¨ Rack has Content-Length mismatch in Rack::Files error responses
Summary
Rack::Files#failsets theContent-Lengthresponse header usingString#sizeinstead ofString#bytesize. When the response body contains multibyte UTF-8 characters, the declaredContent-Lengthis smaller than the number of bytes actually sent on the wire.Because
Rack::Filesreflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters.This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect
Content-Lengthvalue.Details
Rack::Files#failconstructs error responses using logic equivalent to:def fail(status, body, headers = {}) body += "\n" [ status, { "content-type" => "text/plain", "content-length" => body.size.to_s, "x-cascade" => "pass" }.merge!(headers), [body] ] endHere,
body.sizereturns the number of characters, not the number of bytes. For multibyte UTF-8 strings, this produces an incorrectContent-Lengthvalue.
Rack::Filesincludes the decoded request path in 404 responses. A request containing percent-encoded UTF-8 path components therefore causes the response body to contain multibyte characters, while theContent-Lengthheader still reflects character count rather than byte count.As a result, the server can send more bytes than declared in the response headers.
This violates HTTP message framing requirements, which define
Content-Lengthas the number of octets in the message body.Impact
Applications using
Rack::Filesmay emit incorrectly framed error responses when handling requests for non-existent paths containing multibyte characters.In some deployment topologies, particularly with keep-alive connections and intermediaries that rely on
Content-Length, this mismatch may lead to response parsing inconsistencies or response desynchronization. The practical exploitability depends on the behavior of downstream proxies, clients, and connection reuse.Even where no secondary exploitation is possible, the response is malformed and may trigger protocol errors in strict components.
Mitigation
- Update to a patched version of Rack that computes
Content-LengthusingString#bytesize.- Avoid exposing
Rack::Filesdirectly to untrusted traffic until a fix is available, if operationally feasible.- Where possible, place Rack behind a proxy or server that normalizes or rejects malformed backend responses.
- Prefer closing backend connections on error paths if response framing anomalies are a concern.
π¨ Rack::Request accepts invalid Host characters, enabling host allowlist bypass
Summary
Rack::Requestparses theHostheader using anAUTHORITYregular expression that accepts characters not permitted in RFC-compliant hostnames, including/,?,#, and@. Becausereq.hostreturns the full parsed value, applications that validate hosts using naive prefix or suffix checks can be bypassed.For example, a check such as
req.host.start_with?("myapp.com")can be bypassed withHost: myapp.com@evil.com, and a check such asreq.host.end_with?("myapp.com")can be bypassed withHost: evil.com/myapp.com.This can lead to host header poisoning in applications that use
req.host,req.url, orreq.base_urlfor link generation, redirects, or origin validation.Details
Rack::Requestparses the authority component using logic equivalent to:AUTHORITY = / \A (?<host> \[(?<address>#{ipv6})\] | (?<address>[[[:graph:]&&[^\[\]]]]*?) ) (:(?<port>\d+))? \z /xThe character class used for non-IPv6 hosts accepts nearly all printable characters except
[and]. This includes reserved URI delimiters such as@,/,?, and#, which are not valid hostname characters under RFC 3986 host syntax.As a result, values such as the following are accepted and returned through
req.host:myapp.com@evil.com evil.com/myapp.com evil.com#myapp.comApplications that attempt to allowlist hosts using string prefix or suffix checks may therefore treat attacker-controlled hosts as trusted. For example:
req.host.start_with?("myapp.com")accepts:
myapp.com@evil.comand:
req.host.end_with?("myapp.com")accepts:
evil.com/myapp.comWhen those values are later used to build absolute URLs or enforce origin restrictions, the application may produce attacker-controlled results.
Impact
Applications that rely on
req.host,req.url, orreq.base_urlmay be affected if they perform naive host validation or assume Rack only returns RFC-valid hostnames.In affected deployments, an attacker may be able to bypass host allowlists and poison generated links, redirects, or origin-dependent security decisions. This can enable attacks such as password reset link poisoning or other host header injection issues.
The practical impact depends on application behavior. If the application or reverse proxy already enforces strict host validation, exploitability may be reduced or eliminated.
Mitigation
- Update to a patched version of Rack that rejects invalid authority characters in
Host.- Enforce strict
Hostheader validation at the reverse proxy or load balancer.- Do not rely on prefix or suffix string checks such as
start_with?orend_with?for host allowlisting.- Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.
π¨ Rack::Static prefix matching can expose unintended files under the static root
Summary
Rack::Staticdetermines whether a request should be served as a static file using a simple string prefix check. When configured with URL prefixes such as"/css", it matches any request path that begins with that string, including unrelated paths such as"/css-config.env"or"/css-backup.sql".As a result, files under the static root whose names merely share the configured prefix may be served unintentionally, leading to information disclosure.
Details
Rack::Static#route_fileperforms static-route matching using logic equivalent to:@urls.any? { |url| path.index(url) == 0 }This checks only whether the request path starts with the configured prefix string. It does not require a path segment boundary after the prefix.
For example, with:
use Rack::Static, urls: ["/css", "/js"], root: "public"the following path is matched as intended:
/css/style.cssbut these paths are also matched:
/css-config.env /css-backup.sql /csssecrets.ymlIf such files exist under the configured static root, Rack forwards the request to the file server and serves them as static content.
This means a configuration intended to expose only directory trees such as
/css/...and/js/...may also expose sibling files whose names begin with those same strings.Impact
An attacker can request files under the configured static root whose names share a configured URL prefix and obtain their contents.
In affected deployments, this may expose configuration files, secrets, backups, environment files, or other unintended static content located under the same root directory.
Mitigation
- Update to a patched version of Rack that enforces a path boundary when matching configured static URL prefixes.
- Match only paths that are either exactly equal to the configured prefix or begin with
prefix + "/".- Avoid placing sensitive files under the
Rack::Staticroot directory.- Prefer static URL mappings that cannot overlap with sensitive filenames.
π¨ Rack:: Static header_rules bypass via URL-encoded paths
Summary
Rack::Static#applicable_rulesevaluates severalheader_rulestypes against the raw URL-encodedPATH_INFO, while the underlying file-serving path is decoded before the file is served. As a result, a request for a URL-encoded variant of a static path can serve the same file without the headers thatheader_ruleswere intended to apply.In deployments that rely on
Rack::Staticto attach security-relevant response headers to static content, this can allow an attacker to bypass those headers by requesting an encoded form of the path.Details
Rack::Static#applicable_rulesmatches rule types such as:fonts,Array, andRegexpdirectly against the incomingPATH_INFO. For example:when :fonts /\.(?:ttf|otf|eot|woff2|woff|svg)\z/.match?(path) when Array /\.(#{rule.join('|')})\z/.match?(path) when Regexp rule.match?(path)These checks operate on the raw request path. If the request contains encoded characters such as
%2Ein place of., the rule may fail to match even though the file path is later decoded and served successfully by the static file server.For example, both of the following requests may resolve to the same file on disk:
/fonts/test.woff /fonts/test%2Ewoffbut only the unencoded form may receive the headers configured through
header_rules.This creates a canonicalization mismatch between the path used for header policy decisions and the path ultimately used for file serving.
Impact
Applications that rely on
Rack::Staticheader_rulesto apply security-relevant headers to static files may be affected.In affected deployments, an attacker can request an encoded variant of a static file path and receive the same file without the intended headers. Depending on how
header_rulesare used, this may bypass protections such as clickjacking defenses, content restrictions, or other response policies applied to static content.The practical impact depends on the configured rules and the types of files being served. If
header_rulesare only used for non-security purposes such as caching, the issue may have limited security significance.Mitigation
- Update to a patched version of Rack that applies
header_rulesto a decoded path consistently with static file resolution.- Do not rely solely on
Rack::Staticheader_rulesfor security-critical headers where encoded path variants may reach the application.- Prefer setting security headers at the reverse proxy or web server layer so they apply consistently to both encoded and unencoded path forms.
- Normalize or reject encoded path variants for static content at the edge, where feasible.
π¨ Rack's multipart byte range processing allows denial of service via excessive overlapping ranges
Summary
Rack::Utils.get_byte_rangesparses the HTTPRangeheader without limiting the number of individual byte ranges. Although the existing fix for CVE-2024-26141 rejects ranges whose total byte coverage exceeds the file size, it does not restrict the count of ranges. An attacker can supply many small overlapping ranges such as0-0,0-0,0-0,...to trigger disproportionate CPU, memory, I/O, and bandwidth consumption per request.This results in a denial of service condition in Rack file-serving paths that process multipart byte range responses.
Details
Rack::Utils.get_byte_rangesaccepts a comma-separated list of byte ranges and validates them based on their aggregate size, but does not impose a limit on how many individual ranges may be supplied.As a result, a request such as:
Range: bytes=0-0,0-0,0-0,0-0,...can contain thousands of overlapping one-byte ranges while still satisfying the total-size check added for CVE-2024-26141.
When such a header is processed by Rackβs file-serving code, each range causes additional work, including multipart response generation, per-range iteration, file seek and read operations, and temporary string allocation for response size calculation and output. This allows a relatively small request header to trigger disproportionately expensive processing and a much larger multipart response.
The issue is distinct from CVE-2024-26141. That fix prevents range sets whose total byte coverage exceeds the file size, but does not prevent a large number of overlapping ranges whose summed size remains within that limit.
Impact
Applications that expose file-serving paths with byte range support may be vulnerable to denial of service.
An unauthenticated attacker can send crafted
Rangeheaders containing many small overlapping ranges to consume excessive CPU time, memory, file I/O, and bandwidth. Repeated requests may reduce application availability and increase pressure on workers and garbage collection.Mitigation
- Update to a patched version of Rack that limits the number of accepted byte ranges.
- Reject or normalize multipart byte range requests containing excessive range counts.
- Consider disabling multipart range support where it is not required.
- Apply request filtering or header restrictions at the reverse proxy or application boundary to limit abusive
Rangeheaders.
π¨ Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters
Summary
Rack::Multipart::Parser#handle_mime_headparses quoted multipart parameters such asContent-Disposition: form-data; name="..."using repeatedString#indexsearches combined withString#slice!prefix deletion. For escape-heavy quoted values, this causes super-linear processing.An unauthenticated attacker can send a crafted
multipart/form-datarequest containing many parts with long backslash-escaped parameter values to trigger excessive CPU usage during multipart parsing.This results in a denial of service condition in Rack applications that accept multipart form data.
Details
Rack::Multipart::Parser#handle_mime_headparses quoted parameter values by repeatedly:
- Searching for the next quote or backslash,
- Copying the preceding substring into a new buffer, and
- Removing the processed prefix from the original string with
slice!.An attacker can exploit this by sending a multipart request with many parts whose
nameparameters contain long escape-heavy values such as:name="a\\a\\a\\a\\a\\..."Under default Rack limits, a request can contain up to 4095 parts. If many of those parts use long quoted values with dense escape characters, the parser performs disproportionately expensive CPU work while remaining within normal request size and part-count limits.
Impact
Any Rack application that accepts
multipart/form-datarequests may be affected, including file upload endpoints and standard HTML form handlers.An unauthenticated attacker can send crafted multipart requests that consume excessive CPU time during request parsing. Repeated requests can tie up application workers, reduce throughput, and degrade or deny service availability.
Mitigation
- Update to a patched version of Rack that parses quoted multipart parameters without repeated rescanning and destructive prefix deletion.
- Apply request throttling or rate limiting to multipart upload endpoints.
- Where operationally feasible, restrict or isolate multipart parsing on untrusted high-volume endpoints.
π¨ Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.
Summary
Rack::Multipart::Parserextracts theboundaryparameter frommultipart/form-datausing a greedy regular expression. When aContent-Typeheader contains multipleboundaryparameters, Rack selects the last one rather than the first.In deployments where an upstream proxy, WAF, or intermediary interprets the first
boundaryparameter, this mismatch can allow an attacker to smuggle multipart content past upstream inspection and have Rack parse a different body structure than the intermediary validated.Details
Rack identifies the multipart boundary using logic equivalent to:
MULTIPART = %r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|niBecause the expression is greedy, it matches the last
boundary=parameter in a header such as:Content-Type: multipart/form-data; boundary=safe; boundary=maliciousAs a result, Rack parses the request body using
malicious, while another component may interpret the same header usingsafe.This creates an interpretation conflict. If an upstream WAF or proxy inspects multipart parts using the first boundary and Rack later parses the body using the last boundary, a client may be able to place malicious form fields or uploaded content in parts that Rack accepts but the upstream component did not inspect as intended.
This issue is most relevant in layered deployments where security decisions are made before the request reaches Rack.
Impact
Applications that accept
multipart/form-datauploads behind an inspecting proxy or WAF may be affected.In such deployments, an attacker may be able to bypass upstream filtering of uploaded files or form fields by sending a request with multiple
boundaryparameters and relying on the intermediary and Rack to parse the request differently.The practical impact depends on deployment architecture. If no upstream component relies on a different multipart interpretation, this behavior may not provide meaningful additional attacker capability.
Mitigation
- Update to a patched version of Rack that rejects ambiguous multipart
Content-Typeheaders or parses duplicateboundaryparameters consistently.- Reject requests containing multiple
boundaryparameters.- Normalize or regenerate multipart metadata at the trusted edge before forwarding requests to Rack.
- Avoid relying on upstream inspection of malformed multipart requests unless duplicate parameter handling is explicitly consistent across components.
π¨ Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values
Summary
Rack::Multipart::Parserunfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such asfilenameornameinstead of removing the folded line break during unfolding.As a result, applications that later reuse those parsed values in HTTP response headers may be vulnerable to downstream header injection or response splitting.
Details
Rack::Multipart::Parseraccepts folded multipart header values and unfolds them during parsing. However, the unfolding behavior does not fully remove the embedded line break sequence from the parsed value.This means a multipart part header such as:
Content-Disposition: form-data; name="file"; filename="test\r\n foo.txt"can result in a parsed parameter value that still contains CRLF characters.
The issue is not that Rack creates a second multipart header field. Rather, the problem is that CRLF remains embedded in the parsed metadata value after unfolding. If an application later uses that value in a security-sensitive context, such as constructing an HTTP response header, the preserved CRLF may alter downstream header parsing.
Affected values may include multipart parameters such as
filename,name, or similar parsed header attributes.Impact
Applications that accept multipart form uploads may be affected if they later reuse parsed multipart metadata in HTTP headers or other header-sensitive contexts.
In affected deployments, an attacker may be able to supply a multipart parameter value containing folded line breaks and cause downstream header injection, response splitting, cache poisoning, or related response parsing issues.
The practical impact depends on application behavior. If parsed multipart metadata is not reused in HTTP headers, the issue may be limited to incorrect parsing behavior rather than a direct exploit path.
Mitigation
- Update to a patched version of Rack that removes CRLF correctly when unfolding folded multipart header values.
- Avoid copying upload metadata such as
filenamedirectly into HTTP response headers without sanitization.- Sanitize or reject carriage return and line feed characters in multipart-derived values before reusing them in response headers, logs, or downstream protocol contexts.
- Where feasible, normalize uploaded filenames before storing or reflecting them.
π¨ Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
Summary
Rack::Utils.forwarded_valuesparses the RFC 7239Forwardedheader by splitting on semicolons before handling quoted-string values. Because quoted values may legally contain semicolons, a header such as:Forwarded: for="127.0.0.1;host=evil.com;proto=https"can be interpreted by Rack as multiple
Forwardeddirectives rather than as a single quotedforvalue.In deployments where an upstream proxy, WAF, or intermediary validates or preserves quoted
Forwardedvalues differently, this discrepancy can allow an attacker to smugglehost,proto,for, orbyparameters through a single header value.Details
Rack::Utils.forwarded_valuesprocesses the header using logic equivalent to:forwarded_header.split(';').each_with_object({}) do |field, values| field.split(',').each do |pair| pair = pair.split('=').map(&:strip).join('=') return nil unless pair =~ /\A(by|for|host|proto)="?([^"]+)"?\Z/i (values[$1.downcase.to_sym] ||= []) << $2 end endThe method splits on
;before it parses individualname=valuepairs. This is inconsistent with RFC 7239, which permits quoted-string values, and quoted strings may contain semicolons as literal content.As a result, a header value such as:
Forwarded: for="127.0.0.1;host=evil.com;proto=https"is not treated as a single
forvalue. Instead, Rack may interpret it as if the client had supplied separatefor,host, andprotodirectives.This creates an interpretation conflict when another component in front of Rack treats the quoted value as valid literal content, while Rack reparses it as multiple forwarding parameters.
Impact
Applications that rely on
Forwardedto derive request metadata may observe attacker-controlled values forhost,proto,for, or related URL components.In affected deployments, this can lead to host or scheme spoofing in derived values such as
req.host,req.scheme,req.base_url, orreq.url. Applications that use those values for password reset links, redirects, absolute URL generation, logging, IP-based decisions, or backend requests may be vulnerable to downstream security impact.The practical security impact depends on deployment architecture. If clients can already supply arbitrary trusted
Forwardedparameters directly, this bug may not add meaningful attacker capability. The issue is most relevant where an upstream component and Rack interpret the sameForwardedheader differently.Mitigation
- Update to a patched version of Rack that parses
Forwardedquoted-string values before splitting on parameter delimiters.- Avoid trusting client-supplied
Forwardedheaders unless they are normalized or regenerated by a trusted reverse proxy.- Prefer stripping inbound
Forwardedheaders at the edge and reconstructing them from trusted proxy metadata.- Avoid using
req.host,req.scheme,req.base_url, orreq.urlfor security-sensitive operations unless the forwarding chain is explicitly trusted and validated.
π¨ Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header
Summary
Rack::Utils.select_best_encodingprocessesAccept-Encodingvalues with quadratic time complexity when the header contains many wildcard (*) entries. Because this method is used byRack::Deflaterto choose a response encoding, an unauthenticated attacker can send a single request with a craftedAccept-Encodingheader and cause disproportionate CPU consumption on the compression middleware path.This results in a denial of service condition for applications using
Rack::Deflater.Details
Rack::Utils.select_best_encodingexpands parsedAccept-Encodingvalues into a list of candidate encodings. When an entry is*, the method computes the set of concrete encodings by subtracting the encodings already present in the request:if m == "*" (available_encodings - accept_encoding.map(&:first)).each do |m2| expanded_accept_encoding << [m2, q, preference] end else expanded_accept_encoding << [m, q, preference] endBecause
accept_encoding.map(&:first)is evaluated inside the loop, it is recomputed for each wildcard entry. If the request containsNwildcard entries, this produces repeated scans over the full parsed header and causes quadratic behavior.After expansion, the method also performs additional work over
expanded_accept_encoding, including per-entry deletion, which further increases the cost for large inputs.
Rack::Deflaterinvokes this method for each request when the middleware is enabled:Utils.select_best_encoding(ENCODINGS, Utils.parse_encodings(accept_encoding))As a result, a client can trigger this expensive code path simply by sending a large
Accept-Encodingheader containing many repeated wildcard values.For example, a request with an approximately 8 KB
Accept-Encodingheader containing about 1,000*;q=0.5entries can cause roughly 170 ms of CPU time in a single request on theRack::Deflaterpath, compared to a negligible baseline for a normal header.This issue is distinct from CVE-2024-26146. That issue concerned regular expression denial of service during
Acceptheader parsing, whereas this issue arises later during encoding selection after the header has already been parsed.Impact
Any Rack application using
Rack::Deflatermay be affected.An unauthenticated attacker can send requests with crafted
Accept-Encodingheaders to trigger excessive CPU usage in the encoding selection logic. Repeated requests can consume worker time disproportionately and reduce application availability.The attack does not require invalid HTTP syntax or large payload bodies. A single header-sized request is sufficient to reach the vulnerable code path.
Mitigation
- Update to a patched version of Rack in which encoding selection does not repeatedly rescan the parsed header for wildcard entries.
- Avoid enabling
Rack::Deflateron untrusted traffic.- Apply request filtering or header size / format restrictions at the reverse proxy or application boundary to limit abusive
Accept-Encodingvalues.
π¨ Rack has a root directory disclosure via unescaped regex interpolation in Rack::Directory
Summary
Rack::Directoryinterpolates the configuredrootpath directly into a regular expression when deriving the displayed directory path. Ifrootcontains regex metacharacters such as+,*, or., the prefix stripping can fail and the generated directory listing may expose the full filesystem path in the HTML output.Details
Rack::Directory::DirectoryBody#eachcomputes the visible path using code equivalent to:show_path = Utils.escape_html(path.sub(/\A#{root}/, ''))Here,
rootis a developer-configured filesystem path. It is normalized earlier withFile.expand_path(root)and then inserted directly into a regular expression without escaping.Because the value is treated as regex syntax rather than as a literal string, metacharacters in the configured path can change how the prefix match behaves. When that happens, the expected root prefix is not removed from
path, and the absolute filesystem path is rendered into the HTML directory listing.Impact
If
Rack::Directoryis configured to serve a directory whose absolute path contains regex metacharacters, the generated directory listing may disclose the full server filesystem path instead of only the request-relative path.This can expose internal deployment details such as directory layout, usernames, mount points, or naming conventions that would otherwise not be visible to clients.
Mitigation
- Update to a patched version of Rack in which the root prefix is removed using an escaped regular expression.
- Avoid using
Rack::Directorywith a root path that contains regular expression metacharacters.
π¨ Rack's multipart parsing without Content-Length header allows unbounded chunked file uploads
Summary
Rack::Multipart::Parseronly wraps the request body in aBoundedIOwhenCONTENT_LENGTHis present. When amultipart/form-datarequest is sent without aContent-Lengthheader, such as with HTTP chunked transfer encoding, multipart parsing continues until end-of-stream with no total size limit.For file parts, the uploaded body is written directly to a temporary file on disk rather than being constrained by the buffered in-memory upload limit. An unauthenticated attacker can therefore stream an arbitrarily large multipart file upload and consume unbounded disk space.
This results in a denial of service condition for Rack applications that accept multipart form data.
Details
Rack::Multipart::Parser.parseappliesBoundedIOonly whencontent_lengthis notnil:io = BoundedIO.new(io, content_length) if content_lengthWhen
CONTENT_LENGTHis absent, the parser reads the multipart body until EOF without a global byte limit.Although Rack enforces
BUFFERED_UPLOAD_BYTESIZE_LIMITfor retained non-file parts, file uploads are handled differently. When a multipart part includes a filename, the body is streamed to aTempfile, and the retained-size accounting is not applied to that file content. As a result, file parts are not subject to the same upload size bound.An attacker can exploit this by sending a chunked
multipart/form-datarequest containing a file part and continuously streaming data without declaring aContent-Length. Rack will continue writing the uploaded data to disk until the client stops or the server exhausts available storage.Impact
Any Rack application that accepts
multipart/form-datauploads may be affected if no upstream component enforces a request body size limit.An unauthenticated attacker can send a large chunked file upload to consume disk space on the application host. This may cause request failures, application instability, or broader service disruption if the host runs out of available storage.
The practical impact depends on deployment architecture. Reverse proxies or application servers that enforce upload limits may reduce or eliminate exploitability, but Rack itself does not impose a total multipart upload limit in this code path when
CONTENT_LENGTHis absent.Mitigation
- Update to a patched version of Rack that enforces a total multipart upload size limit even when
CONTENT_LENGTHis absent.- Enforce request body size limits at the reverse proxy or application server.
- Isolate temporary upload storage and monitor disk consumption for multipart endpoints.
π¨ Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect
Summary
Rack::Sendfile#map_accel_pathinterpolates the value of theX-Accel-Mappingrequest header directly into a regular expression when rewriting file paths forX-Accel-Redirect. Because the header value is not escaped, an attacker who can supplyX-Accel-Mappingto the backend can inject regex metacharacters and control the generatedX-Accel-Redirectresponse header.In deployments using
Rack::Sendfilewithx-accel-redirect, this can allow an attacker to cause nginx to serve unintended files from configured internal locations.Details
Rack::Sendfile#map_accel_pathprocesses header-supplied mappings using logic equivalent to:mapping.split(',').map(&:strip).each do |m| internal, external = m.split('=', 2).map(&:strip) new_path = path.sub(/\A#{internal}/i, external) return new_path unless path == new_path endHere,
internalcomes from theHTTP_X_ACCEL_MAPPINGrequest header and is inserted directly into a regular expression without escaping. This gives the header value regex semantics rather than treating it as a literal prefix.As a result, an attacker can supply metacharacters such as
.*or capture groups to alter how the path substitution is performed. For example, a mapping such as:X-Accel-Mapping: .*=/protected/secret.txtcauses the entire source path to match and rewrites the redirect target to a clean attacker-chosen internal path.
This differs from the documented behavior of the header-based mapping path, which is described as a simple substitution. While application-supplied mappings may intentionally support regular expressions, header-supplied mappings should be treated as literal path prefixes.
The issue is only exploitable when untrusted
X-Accel-Mappingheaders can reach Rack. One realistic case is a reverse proxy configuration that intends to setX-Accel-Mappingitself, but fails to do so on some routes, allowing a client-supplied header to pass through unchanged.Impact
Applications using
Rack::Sendfilewithx-accel-redirectmay be affected if the backend accepts attacker-controlledX-Accel-Mappingheaders.In affected deployments, an attacker may be able to control the
X-Accel-Redirectresponse header and cause nginx to serve files from internal locations that were not intended to be reachable through the application. This can lead to unauthorized file disclosure.The practical impact depends on deployment architecture. If the proxy always strips or overwrites
X-Accel-Mapping, or if the application uses explicit configured mappings instead of the request header, exploitability may be eliminated.Mitigation
- Update to a patched version of Rack that treats header-supplied
X-Accel-Mappingvalues as literal strings rather than regular expressions.- Strip or overwrite inbound
X-Accel-Mappingheaders at the reverse proxy so client-supplied values never reach Rack.- Prefer explicit application-configured sendfile mappings instead of relying on request-header mappings.
- Review proxy sub-locations and inherited header settings to ensure
X-Accel-Mappingis consistently set on all backend routes.
π¨ Rack has Content-Length mismatch in Rack::Files error responses
Summary
Rack::Files#failsets theContent-Lengthresponse header usingString#sizeinstead ofString#bytesize. When the response body contains multibyte UTF-8 characters, the declaredContent-Lengthis smaller than the number of bytes actually sent on the wire.Because
Rack::Filesreflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters.This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect
Content-Lengthvalue.Details
Rack::Files#failconstructs error responses using logic equivalent to:def fail(status, body, headers = {}) body += "\n" [ status, { "content-type" => "text/plain", "content-length" => body.size.to_s, "x-cascade" => "pass" }.merge!(headers), [body] ] endHere,
body.sizereturns the number of characters, not the number of bytes. For multibyte UTF-8 strings, this produces an incorrectContent-Lengthvalue.
Rack::Filesincludes the decoded request path in 404 responses. A request containing percent-encoded UTF-8 path components therefore causes the response body to contain multibyte characters, while theContent-Lengthheader still reflects character count rather than byte count.As a result, the server can send more bytes than declared in the response headers.
This violates HTTP message framing requirements, which define
Content-Lengthas the number of octets in the message body.Impact
Applications using
Rack::Filesmay emit incorrectly framed error responses when handling requests for non-existent paths containing multibyte characters.In some deployment topologies, particularly with keep-alive connections and intermediaries that rely on
Content-Length, this mismatch may lead to response parsing inconsistencies or response desynchronization. The practical exploitability depends on the behavior of downstream proxies, clients, and connection reuse.Even where no secondary exploitation is possible, the response is malformed and may trigger protocol errors in strict components.
Mitigation
- Update to a patched version of Rack that computes
Content-LengthusingString#bytesize.- Avoid exposing
Rack::Filesdirectly to untrusted traffic until a fix is available, if operationally feasible.- Where possible, place Rack behind a proxy or server that normalizes or rejects malformed backend responses.
- Prefer closing backend connections on error paths if response framing anomalies are a concern.
π¨ Rack has a Directory Traversal via Rack:Directory
Summary
Rack::Directoryβs path check used a string prefix match on the expanded path. A request like/../root_example/can escape the configured root if the target path starts with the root string, allowing directory listing outside the intended root.Details
In
directory.rb,File.expand_path(File.join(root, path_info)).start_with?(root)does not enforce a path boundary. If the server root is/var/www/root, a path like/var/www/root_backuppasses the check because it shares the same prefix, soRack::Directorywill list that directory also.Impact
Information disclosure via directory listing outside the configured root when
Rack::Directoryis exposed to untrusted clients and a directory shares the root prefix (e.g.,public2,www_backup).Mitigation
- Update to a patched version of Rack that correctly checks the root prefix.
- Don't name directories with the same prefix as one which is exposed via
Rack::Directory.
π¨ Stored XSS in Rack::Directory via javascript: filenames rendered into anchor href
Summary
Rack::Directorygenerates an HTML directory index where each file entry is rendered as a clickable link. If a file exists on disk whose basename begins with thejavascript:scheme (e.g.javascript:alert(1)), the generated index includes an anchor whosehrefattribute is exactlyjavascript:alert(1). Clicking this entry executes arbitrary JavaScript in the context of the hosting application.This results in a client-side XSS condition in directory listings generated by
Rack::Directory.Details
Rack::Directoryrenders directory entries using an HTML row template similar to:<a href='%s'>%s</a>The
%splaceholder is populated directly with the fileβs basename. If the basename begins withjavascript:, the resulting HTML contains an executable JavaScript URL:<a href='javascript:alert(1)'>javascript:alert(1)</a>Because the value is inserted directly into the
hrefattribute without scheme validation or normalization, browsers interpret it as a JavaScript URI. When a user clicks the link, the JavaScript executes in the origin of the Rack application.Impact
If
Rack::Directoryis used to expose filesystem contents over HTTP, an attacker who can create or upload files within that directory may introduce a malicious filename beginning withjavascript:.When a user visits the directory listing and clicks the entry, arbitrary JavaScript executes in the application's origin. Exploitation requires user interaction (clicking the malicious entry).
Mitigation
- Update to a patched version of Rack in which
Rack::Directoryprefixes generated anchors with a relative path indicator (e.g../filename).- Avoid exposing user-controlled directories via
Rack::Directory.- Apply a strict Content Security Policy (CSP) to reduce impact of potential client-side execution issues.
- Where feasible, restrict or sanitize uploaded filenames to disallow dangerous URI scheme prefixes.
HackerOne profile:
https://hackerone.com/thesmartshadowGitHub account owner:
Ali Firas (@thesmartshadow)
π¨ Rack has a Directory Traversal via Rack:Directory
Summary
Rack::Directoryβs path check used a string prefix match on the expanded path. A request like/../root_example/can escape the configured root if the target path starts with the root string, allowing directory listing outside the intended root.Details
In
directory.rb,File.expand_path(File.join(root, path_info)).start_with?(root)does not enforce a path boundary. If the server root is/var/www/root, a path like/var/www/root_backuppasses the check because it shares the same prefix, soRack::Directorywill list that directory also.Impact
Information disclosure via directory listing outside the configured root when
Rack::Directoryis exposed to untrusted clients and a directory shares the root prefix (e.g.,public2,www_backup).Mitigation
- Update to a patched version of Rack that correctly checks the root prefix.
- Don't name directories with the same prefix as one which is exposed via
Rack::Directory.
π¨ Stored XSS in Rack::Directory via javascript: filenames rendered into anchor href
Summary
Rack::Directorygenerates an HTML directory index where each file entry is rendered as a clickable link. If a file exists on disk whose basename begins with thejavascript:scheme (e.g.javascript:alert(1)), the generated index includes an anchor whosehrefattribute is exactlyjavascript:alert(1). Clicking this entry executes arbitrary JavaScript in the context of the hosting application.This results in a client-side XSS condition in directory listings generated by
Rack::Directory.Details
Rack::Directoryrenders directory entries using an HTML row template similar to:<a href='%s'>%s</a>The
%splaceholder is populated directly with the fileβs basename. If the basename begins withjavascript:, the resulting HTML contains an executable JavaScript URL:<a href='javascript:alert(1)'>javascript:alert(1)</a>Because the value is inserted directly into the
hrefattribute without scheme validation or normalization, browsers interpret it as a JavaScript URI. When a user clicks the link, the JavaScript executes in the origin of the Rack application.Impact
If
Rack::Directoryis used to expose filesystem contents over HTTP, an attacker who can create or upload files within that directory may introduce a malicious filename beginning withjavascript:.When a user visits the directory listing and clicks the entry, arbitrary JavaScript executes in the application's origin. Exploitation requires user interaction (clicking the malicious entry).
Mitigation
- Update to a patched version of Rack in which
Rack::Directoryprefixes generated anchors with a relative path indicator (e.g../filename).- Avoid exposing user-controlled directories via
Rack::Directory.- Apply a strict Content Security Policy (CSP) to reduce impact of potential client-side execution issues.
- Where feasible, restrict or sanitize uploaded filenames to disallow dangerous URI scheme prefixes.
HackerOne profile:
https://hackerone.com/thesmartshadowGitHub account owner:
Ali Firas (@thesmartshadow)
π¨ Rack has a Possible Information Disclosure Vulnerability
Summary
A possible information disclosure vulnerability existed in
Rack::Sendfilewhen running behind a proxy that supportsx-sendfileheaders (such as Nginx). Specially crafted headers could causeRack::Sendfileto miscommunicate with the proxy and trigger unintended internal requests, potentially bypassing proxy-level access restrictions.Details
When
Rack::Sendfilereceived untrustedx-sendfile-typeorx-accel-mappingheaders from a client, it would interpret them as proxy configuration directives. This could cause the middleware to send a "redirect" response to the proxy, prompting it to reissue a new internal request that was not subject to the proxy's access controls.An attacker could exploit this by:
- Setting a crafted
x-sendfile-type: x-accel-redirectheader.- Setting a crafted
x-accel-mappingheader.- Requesting a path that qualifies for proxy-based acceleration.
Impact
Attackers could bypass proxy-enforced restrictions and access internal endpoints intended to be protected (such as administrative pages). The vulnerability did not allow arbitrary file reads but could expose sensitive application routes.
This issue only affected systems meeting all of the following conditions:
- The application used
Rack::Sendfilewith a proxy that supportsx-accel-redirect(e.g., Nginx).- The proxy did not always set or remove the
x-sendfile-typeandx-accel-mappingheaders.- The application exposed an endpoint that returned a body responding to
.to_path.Mitigation
Upgrade to a fixed version of Rack which requires explicit configuration to enable
x-accel-redirect:use Rack::Sendfile, "x-accel-redirect"Alternatively, configure the proxy to always set or strip the headers (you should be doing this!):
proxy_set_header x-sendfile-type x-accel-redirect; proxy_set_header x-accel-mapping /var/www/=/files/;Or in Rails applications, disable sendfile completely:
config.action_dispatch.x_sendfile_header = nil
π¨ Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing
Summary
Rack::Request#POSTreads the entire request body into memory forContent-Type: application/x-www-form-urlencoded, callingrack.input.read(nil)without enforcing a length or cap. Large request bodies can therefore be buffered completely into process memory before parsing, leading to denial of service (DoS) through memory exhaustion.Details
When handling non-multipart form submissions, Rackβs request parser performs:
form_vars = get_header(RACK_INPUT).readSince
readis called with no argument, the entire request body is loaded into a RubyString. This occurs before query parameter parsing or enforcement of anyparams_limit. As a result, Rack applications without an upstream body-size limit can experience unbounded memory allocation proportional to request size.Impact
Attackers can send large
application/x-www-form-urlencodedbodies to consume process memory, causing slowdowns or termination by the operating system (OOM). The effect scales linearly with request size and concurrency. Even with parsing limits configured, the issue occurs before those limits are enforced.Mitigation
- Update to a patched version of Rack that enforces form parameter limits using
query_parser.bytesize_limit, preventing unbounded reads ofapplication/x-www-form-urlencodedbodies.- Enforce strict maximum body size at the proxy or web server layer (e.g., Nginx
client_max_body_size, ApacheLimitRequestBody).
π¨ Rack has a Possible Information Disclosure Vulnerability
Summary
A possible information disclosure vulnerability existed in
Rack::Sendfilewhen running behind a proxy that supportsx-sendfileheaders (such as Nginx). Specially crafted headers could causeRack::Sendfileto miscommunicate with the proxy and trigger unintended internal requests, potentially bypassing proxy-level access restrictions.Details
When
Rack::Sendfilereceived untrustedx-sendfile-typeorx-accel-mappingheaders from a client, it would interpret them as proxy configuration directives. This could cause the middleware to send a "redirect" response to the proxy, prompting it to reissue a new internal request that was not subject to the proxy's access controls.An attacker could exploit this by:
- Setting a crafted
x-sendfile-type: x-accel-redirectheader.- Setting a crafted
x-accel-mappingheader.- Requesting a path that qualifies for proxy-based acceleration.
Impact
Attackers could bypass proxy-enforced restrictions and access internal endpoints intended to be protected (such as administrative pages). The vulnerability did not allow arbitrary file reads but could expose sensitive application routes.
This issue only affected systems meeting all of the following conditions:
- The application used
Rack::Sendfilewith a proxy that supportsx-accel-redirect(e.g., Nginx).- The proxy did not always set or remove the
x-sendfile-typeandx-accel-mappingheaders.- The application exposed an endpoint that returned a body responding to
.to_path.Mitigation
Upgrade to a fixed version of Rack which requires explicit configuration to enable
x-accel-redirect:use Rack::Sendfile, "x-accel-redirect"Alternatively, configure the proxy to always set or strip the headers (you should be doing this!):
proxy_set_header x-sendfile-type x-accel-redirect; proxy_set_header x-accel-mapping /var/www/=/files/;Or in Rails applications, disable sendfile completely:
config.action_dispatch.x_sendfile_header = nil
π¨ Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing
Summary
Rack::Request#POSTreads the entire request body into memory forContent-Type: application/x-www-form-urlencoded, callingrack.input.read(nil)without enforcing a length or cap. Large request bodies can therefore be buffered completely into process memory before parsing, leading to denial of service (DoS) through memory exhaustion.Details
When handling non-multipart form submissions, Rackβs request parser performs:
form_vars = get_header(RACK_INPUT).readSince
readis called with no argument, the entire request body is loaded into a RubyString. This occurs before query parameter parsing or enforcement of anyparams_limit. As a result, Rack applications without an upstream body-size limit can experience unbounded memory allocation proportional to request size.Impact
Attackers can send large
application/x-www-form-urlencodedbodies to consume process memory, causing slowdowns or termination by the operating system (OOM). The effect scales linearly with request size and concurrency. Even with parsing limits configured, the issue occurs before those limits are enforced.Mitigation
- Update to a patched version of Rack that enforces form parameter limits using
query_parser.bytesize_limit, preventing unbounded reads ofapplication/x-www-form-urlencodedbodies.- Enforce strict maximum body size at the proxy or web server layer (e.g., Nginx
client_max_body_size, ApacheLimitRequestBody).
π¨ Rack: Multipart parser buffers large nonβfile fields entirely in memory, enabling DoS (memory exhaustion)
Summary
Rack::Multipart::Parserstores non-file form fields (parts without afilename) entirely in memory as RubyStringobjects. A single large text field in a multipart/form-data request (hundreds of megabytes or more) can consume equivalent process memory, potentially leading to out-of-memory (OOM) conditions and denial of service (DoS).Details
During multipart parsing, file parts are streamed to temporary files, but non-file parts are buffered into memory:
body = String.new # non-file β in-RAM buffer @mime_parts[mime_index].body << contentThere is no size limit on these in-memory buffers. As a result, any large text fieldβwhile technically validβwill be loaded fully into process memory before being added to
params.Impact
Attackers can send large non-file fields to trigger excessive memory usage. Impact scales with request size and concurrency, potentially leading to worker crashes or severe garbage-collection overhead. All Rack applications processing multipart form submissions are affected.
Mitigation
- Upgrade: Use a patched version of Rack that enforces a reasonable size cap for non-file fields (e.g., 2 MiB).
- Workarounds:
- Restrict maximum request body size at the web-server or proxy layer (e.g., Nginx
client_max_body_size).- Validate and reject unusually large form fields at the application level.
π¨ Rack's multipart parser buffers unbounded per-part headers, enabling DoS (memory exhaustion)
Summary
Rack::Multipart::Parsercan accumulate unbounded data when a multipart partβs header block never terminates with the required blank line (CRLFCRLF). The parser keeps appending incoming bytes to memory without a size cap, allowing a remote attacker to exhaust memory and cause a denial of service (DoS).Details
While reading multipart headers, the parser waits for
CRLFCRLFusing:@sbuf.scan_until(/(.*?\r\n)\r\n/m)If the terminator never appears, it continues appending data (
@sbuf.concat(content)) indefinitely. There is no limit on accumulated header bytes, so a single malformed part can consume memory proportional to the request body size.Impact
Attackers can send incomplete multipart headers to trigger high memory use, leading to process termination (OOM) or severe slowdown. The effect scales with request size limits and concurrency. All applications handling multipart uploads may be affected.
Mitigation
- Upgrade to a patched Rack version that caps per-part header size (e.g., 64 KiB).
- Until then, restrict maximum request sizes at the proxy or web server layer (e.g., Nginx
client_max_body_size).
π¨ Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
Summary
Rack::Multipart::Parserbuffers the entire multipart preamble (bytes before the first boundary) in memory without any size limit. A client can send a large preamble followed by a valid boundary, causing significant memory use and potential process termination due to out-of-memory (OOM) conditions.Details
While searching for the first boundary, the parser appends incoming data into a shared buffer (
@sbuf.concat(content)) and scans for the boundary pattern:@sbuf.scan_until(@body_regex)If the boundary is not yet found, the parser continues buffering data indefinitely. There is no trimming or size cap on the preamble, allowing attackers to send arbitrary amounts of data before the first boundary.
Impact
Remote attackers can trigger large transient memory spikes by including a long preamble in multipart/form-data requests. The impact scales with allowed request sizes and concurrency, potentially causing worker crashes or severe slowdown due to garbage collection.
Mitigation
- Upgrade: Use a patched version of Rack that enforces a preamble size limit (e.g., 16 KiB) or discards preamble data entirely per RFC 2046 Β§ 5.1.1.
- Workarounds:
- Limit total request body size at the proxy or web server level.
- Monitor memory and set per-process limits to prevent OOM conditions.
π¨ Rack: Multipart parser buffers large nonβfile fields entirely in memory, enabling DoS (memory exhaustion)
Summary
Rack::Multipart::Parserstores non-file form fields (parts without afilename) entirely in memory as RubyStringobjects. A single large text field in a multipart/form-data request (hundreds of megabytes or more) can consume equivalent process memory, potentially leading to out-of-memory (OOM) conditions and denial of service (DoS).Details
During multipart parsing, file parts are streamed to temporary files, but non-file parts are buffered into memory:
body = String.new # non-file β in-RAM buffer @mime_parts[mime_index].body << contentThere is no size limit on these in-memory buffers. As a result, any large text fieldβwhile technically validβwill be loaded fully into process memory before being added to
params.Impact
Attackers can send large non-file fields to trigger excessive memory usage. Impact scales with request size and concurrency, potentially leading to worker crashes or severe garbage-collection overhead. All Rack applications processing multipart form submissions are affected.
Mitigation
- Upgrade: Use a patched version of Rack that enforces a reasonable size cap for non-file fields (e.g., 2 MiB).
- Workarounds:
- Restrict maximum request body size at the web-server or proxy layer (e.g., Nginx
client_max_body_size).- Validate and reject unusually large form fields at the application level.
π¨ Rack's multipart parser buffers unbounded per-part headers, enabling DoS (memory exhaustion)
Summary
Rack::Multipart::Parsercan accumulate unbounded data when a multipart partβs header block never terminates with the required blank line (CRLFCRLF). The parser keeps appending incoming bytes to memory without a size cap, allowing a remote attacker to exhaust memory and cause a denial of service (DoS).Details
While reading multipart headers, the parser waits for
CRLFCRLFusing:@sbuf.scan_until(/(.*?\r\n)\r\n/m)If the terminator never appears, it continues appending data (
@sbuf.concat(content)) indefinitely. There is no limit on accumulated header bytes, so a single malformed part can consume memory proportional to the request body size.Impact
Attackers can send incomplete multipart headers to trigger high memory use, leading to process termination (OOM) or severe slowdown. The effect scales with request size limits and concurrency. All applications handling multipart uploads may be affected.
Mitigation
- Upgrade to a patched Rack version that caps per-part header size (e.g., 64 KiB).
- Until then, restrict maximum request sizes at the proxy or web server layer (e.g., Nginx
client_max_body_size).
π¨ Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
Summary
Rack::Multipart::Parserbuffers the entire multipart preamble (bytes before the first boundary) in memory without any size limit. A client can send a large preamble followed by a valid boundary, causing significant memory use and potential process termination due to out-of-memory (OOM) conditions.Details
While searching for the first boundary, the parser appends incoming data into a shared buffer (
@sbuf.concat(content)) and scans for the boundary pattern:@sbuf.scan_until(@body_regex)If the boundary is not yet found, the parser continues buffering data indefinitely. There is no trimming or size cap on the preamble, allowing attackers to send arbitrary amounts of data before the first boundary.
Impact
Remote attackers can trigger large transient memory spikes by including a long preamble in multipart/form-data requests. The impact scales with allowed request sizes and concurrency, potentially causing worker crashes or severe slowdown due to garbage collection.
Mitigation
- Upgrade: Use a patched version of Rack that enforces a preamble size limit (e.g., 16 KiB) or discards preamble data entirely per RFC 2046 Β§ 5.1.1.
- Workarounds:
- Limit total request body size at the proxy or web server level.
- Monitor memory and set per-process limits to prevent OOM conditions.
π¨ ReDoS Vulnerability in Rack::Multipart handle_mime_head
Summary
There is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This is very similar to the previous security issue CVE-2022-44571.
Details
Carefully crafted input can cause Content-Disposition header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is used typically used in multipart parsing. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted.
Credits
Thanks to scyoon for reporting this to the Rails security team
π¨ Rack has an Unbounded-Parameter DoS in Rack::QueryParser
Summary
Rack::QueryParserparses query strings andapplication/x-www-form-urlencodedbodies into Ruby data structures without imposing any limit on the number of parameters, allowing attackers to send requests with extremely large numbers of parameters.Details
The vulnerability arises because
Rack::QueryParseriterates over each&-separated key-value pair and adds it to a Hash without enforcing an upper bound on the total number of parameters. This allows an attacker to send a single request containing hundreds of thousands (or more) of parameters, which consumes excessive memory and CPU during parsing.Impact
An attacker can trigger denial of service by sending specifically crafted HTTP requests, which can cause memory exhaustion or pin CPU resources, stalling or crashing the Rack server. This results in full service disruption until the affected worker is restarted.
Mitigation
- Update to a version of Rack that limits the number of parameters parsed, or
- Use middleware to enforce a maximum query string size or parameter count, or
- Employ a reverse proxy (such as Nginx) to limit request sizes and reject oversized query strings or bodies.
Limiting request body sizes and query string lengths at the web server or CDN level is an effective mitigation.
π¨ Rack has an Unbounded-Parameter DoS in Rack::QueryParser
Summary
Rack::QueryParserparses query strings andapplication/x-www-form-urlencodedbodies into Ruby data structures without imposing any limit on the number of parameters, allowing attackers to send requests with extremely large numbers of parameters.Details
The vulnerability arises because
Rack::QueryParseriterates over each&-separated key-value pair and adds it to a Hash without enforcing an upper bound on the total number of parameters. This allows an attacker to send a single request containing hundreds of thousands (or more) of parameters, which consumes excessive memory and CPU during parsing.Impact
An attacker can trigger denial of service by sending specifically crafted HTTP requests, which can cause memory exhaustion or pin CPU resources, stalling or crashing the Rack server. This results in full service disruption until the affected worker is restarted.
Mitigation
- Update to a version of Rack that limits the number of parameters parsed, or
- Use middleware to enforce a maximum query string size or parameter count, or
- Employ a reverse proxy (such as Nginx) to limit request sizes and reject oversized query strings or bodies.
Limiting request body sizes and query string lengths at the web server or CDN level is an effective mitigation.
π¨ Local File Inclusion in Rack::Static
Summary
Rack::Staticcan serve files under the specifiedroot:even ifurls:are provided, which may expose other files under the specifiedroot:unexpectedly.Details
The vulnerability occurs because
Rack::Staticdoes not properly sanitize user-supplied paths before serving files. Specifically, encoded path traversal sequences are not correctly validated, allowing attackers to access files outside the designated static file directory.Impact
By exploiting this vulnerability, an attacker can gain access to all files under the specified
root:directory, provided they are able to determine then path of the file.Mitigation
- Update to the latest version of Rack, or
- Remove usage of
Rack::Static, or- Ensure that
root:points at a directory path which only contains files which should be accessed publicly.It is likely that a CDN or similar static file server would also mitigate the issue.
π¨ Local File Inclusion in Rack::Static
Summary
Rack::Staticcan serve files under the specifiedroot:even ifurls:are provided, which may expose other files under the specifiedroot:unexpectedly.Details
The vulnerability occurs because
Rack::Staticdoes not properly sanitize user-supplied paths before serving files. Specifically, encoded path traversal sequences are not correctly validated, allowing attackers to access files outside the designated static file directory.Impact
By exploiting this vulnerability, an attacker can gain access to all files under the specified
root:directory, provided they are able to determine then path of the file.Mitigation
- Update to the latest version of Rack, or
- Remove usage of
Rack::Static, or- Ensure that
root:points at a directory path which only contains files which should be accessed publicly.It is likely that a CDN or similar static file server would also mitigate the issue.
π¨ Escape Sequence Injection vulnerability in Rack lead to Possible Log Injection
Summary
Rack::Sendfilecan be exploited by crafting input that includes newline characters to manipulate log entries.Details
The
Rack::Sendfilemiddleware logs unsanitized header values from theX-Sendfile-Typeheader. An attacker can exploit this by injecting escape sequences (such as newline characters) into the header, resulting in log injection.Impact
This vulnerability can distort log files, obscure attack traces, and complicate security auditing.
Mitigation
- Update to the latest version of Rack, or
- Remove usage of
Rack::Sendfile.
π¨ Escape Sequence Injection vulnerability in Rack lead to Possible Log Injection
Summary
Rack::Sendfilecan be exploited by crafting input that includes newline characters to manipulate log entries.Details
The
Rack::Sendfilemiddleware logs unsanitized header values from theX-Sendfile-Typeheader. An attacker can exploit this by injecting escape sequences (such as newline characters) into the header, resulting in log injection.Impact
This vulnerability can distort log files, obscure attack traces, and complicate security auditing.
Mitigation
- Update to the latest version of Rack, or
- Remove usage of
Rack::Sendfile.
π¨ Possible Log Injection in Rack::CommonLogger
Summary
Rack::CommonLoggercan be exploited by crafting input that includes newline characters to manipulate log entries. The supplied proof-of-concept demonstrates injecting malicious content into logs.Details
When a user provides the authorization credentials via
Rack::Auth::Basic, if success, the username will be put inenv['REMOTE_USER']and later be used byRack::CommonLoggerfor logging purposes.The issue occurs when a server intentionally or unintentionally allows a user creation with the username contain CRLF and white space characters, or the server just want to log every login attempts. If an attacker enters a username with CRLF character, the logger will log the malicious username with CRLF characters into the logfile.
Impact
Attackers can break log formats or insert fraudulent entries, potentially obscuring real activity or injecting malicious data into log files.
Mitigation
- Update to the latest version of Rack.
π¨ Rack ReDoS Vulnerability in HTTP Accept Headers Parsing
Summary
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the
Rack::Request::Helpersmodule when parsing HTTP Accept headers. This vulnerability can be exploited by an attacker sending specially craftedAccept-EncodingorAccept-Languageheaders, causing the server to spend excessive time processing the request and leading to a Denial of Service (DoS).Details
The fix for GHSA-54rr-7fvw-6x8f was not applied to the main branch and thus while the issue was fixed for the Rack v3.0 release series, it was not fixed in the v3.1 release series until v3.1.5.
π¨ Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)
Summary
module Rack class MediaType SPLIT_PATTERN = %r{\s*[;,]\s*}The above regexp is subject to ReDos. 50K blank characters as a prefix to the header will take over 10s to split.
PoC
A simple HTTP request with lots of blank characters in the content-type header:
request["Content-Type"] = (" " * 50_000) + "a,"Impact
It's a very easy to craft ReDoS. Like all ReDoS the impact is debatable.
π¨ Rack Header Parsing leads to Possible Denial of Service Vulnerability
Possible Denial of Service Vulnerability in Rack Header Parsing
There is a possible denial of service vulnerability in the header parsing
routines in Rack. This vulnerability has been assigned the CVE identifier
CVE-2024-26146.Versions Affected: All.
Not affected: None
Fixed Versions: 2.0.9.4, 2.1.4.4, 2.2.8.1, 3.0.9.1Impact
Carefully crafted headers can cause header parsing in Rack to take longer than
expected resulting in a possible denial of service issue. Accept and Forwarded
headers are impacted.Ruby 3.2 has mitigations for this problem, so Rack applications using Ruby 3.2
or newer are unaffected.Releases
The fixed releases are available at the normal locations.
Workarounds
There are no feasible workarounds for this issue.
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the two supported release series. They are in git-am format and consist of a
single changeset.
- 2-0-header-redos.patch - Patch for 2.0 series
- 2-1-header-redos.patch - Patch for 2.1 series
- 2-2-header-redos.patch - Patch for 2.2 series
- 3-0-header-redos.patch - Patch for 3.0 series
Credits
Thanks to svalkanov for reporting this and
providing patches!
π¨ Rack has possible DoS Vulnerability with Range Header
Possible DoS Vulnerability with Range Header in Rack
There is a possible DoS vulnerability relating to the Range request header in
Rack. This vulnerability has been assigned the CVE identifier CVE-2024-26141.Versions Affected: >= 1.3.0.
Not affected: < 1.3.0
Fixed Versions: 3.0.9.1, 2.2.8.1Impact
Carefully crafted Range headers can cause a server to respond with an
unexpectedly large response. Responding with such large responses could lead
to a denial of service issue.Vulnerable applications will use the
Rack::Filemiddleware or the
Rack::Utils.byte_rangesmethods (this includes Rails applications).Releases
The fixed releases are available at the normal locations.
Workarounds
There are no feasible workarounds for this issue.
Patches
To aid users who aren't able to upgrade immediately we have provided patches for
the two supported release series. They are in git-am format and consist of a
single changeset.
- 3-0-range.patch - Patch for 3.0 series
- 2-2-range.patch - Patch for 2.2 series
Credits
Thank you ooooooo_q for the report and
patch
π¨ Possible Denial of Service Vulnerability in Rack's header parsing
There is a denial of service vulnerability in the header parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2023-27539.
Versions Affected: >= 2.0.0 Not affected: None. Fixed Versions: 2.2.6.4, 3.0.6.1
Impact
Carefully crafted input can cause header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. Any applications that parse headers using Rack (virtually all Rails applications) are impacted.
Workarounds
Setting Regexp.timeout in Ruby 3.2 is a possible workaround.
π¨ Rack has possible DoS Vulnerability in Multipart MIME parsing
There is a possible DoS vulnerability in the Multipart MIME parsing code in Rack. This vulnerability has been assigned the CVE identifier CVE-2023-27530.
Versions Affected: All. Not affected: None Fixed Versions: 3.0.4.2, 2.2.6.3, 2.1.4.3, 2.0.9.3
Impact
The Multipart MIME parsing code in Rack limits the number of file parts, but does not limit the total number of parts that can be uploaded. Carefully crafted requests can abuse this and cause multipart parsing to take longer than expected.
All users running an affected release should either upgrade or use one of the workarounds immediately.
Workarounds
A proxy can be configured to limit the POST body size which will mitigate this issue.
π¨ Denial of Service Vulnerability in Rack Content-Disposition parsing
There is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44571.
Versions Affected: >= 2.0.0 Not affected: None. Fixed Versions: 2.0.9.2, 2.1.4.2, 2.2.6.1, 3.0.0.1
ImpactCarefully crafted input can cause Content-Disposition header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is used typically used in multipart parsing. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted.
ReleasesThe fixed releases are available at the normal locations.
WorkaroundsThere are no feasible workarounds for this issue.
PatchesTo aid users who arenβt able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
2-0-Fix-ReDoS-vulnerability-in-multipart-parser - Patch for 2.0 series 2-1-Fix-ReDoS-vulnerability-in-multipart-parser - Patch for 2.1 series 2-2-Fix-ReDoS-vulnerability-in-multipart-parser - Patch for 2.2 series 3-0-Fix-ReDoS-vulnerability-in-multipart-parser - Patch for 3.0 series
π¨ Denial of service via header parsing in Rack
There is a possible denial of service vulnerability in the Range header parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44570.
Versions Affected: >= 1.5.0 Not affected: None. Fixed Versions: 2.0.9.2, 2.1.4.2, 2.2.6.2, 3.0.0.1
ImpactCarefully crafted input can cause the Range header parsing component in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. Any applications that deal with Range requests (such as streaming applications, or applications that serve files) may be impacted.
ReleasesThe fixed releases are available at the normal locations.
WorkaroundsThere are no feasible workarounds for this issue.
PatchesTo aid users who arenβt able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
2-0-Fix-ReDoS-in-Rack-Utils.get_byte_ranges.patch - Patch for 2.0 series 2-1-Fix-ReDoS-in-Rack-Utils.get_byte_ranges.patch - Patch for 2.1 series 2-2-Fix-ReDoS-in-Rack-Utils.get_byte_ranges.patch - Patch for 2.2 series 3-0-Fix-ReDoS-in-Rack-Utils.get_byte_ranges.patch - Patch for 3.0 series
π¨ Denial of service via multipart parsing in Rack
There is a denial of service vulnerability in the multipart parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44572.
Versions Affected: >= 2.0.0 Not affected: None. Fixed Versions: 2.0.9.2, 2.1.4.2, 2.2.6.1, 3.0.0.1
ImpactCarefully crafted input can cause RFC2183 multipart boundary parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted.
ReleasesThe fixed releases are available at the normal locations.
WorkaroundsThere are no feasible workarounds for this issue.
PatchesTo aid users who arenβt able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.
2-0-Forbid-control-characters-in-attributes.patch - Patch for 2.0 series 2-1-Forbid-control-characters-in-attributes.patch - Patch for 2.1 series 2-2-Forbid-control-characters-in-attributes.patch - Patch for 2.2 series 3-0-Forbid-control-characters-in-attributes.patch - Patch for 3.0 series
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ rack-test (indirect, 2.2.0 β 2.3.0) Β· Repo Β· Changelog
Release Notes
2.3.0 (from changelog)
Bug fixes:
- Do not mutate arguments given to
Rack::Utils.build_multipart(Oskar Eichler #361)- Rewind
tempfileif there are errors when appending inUploadedFile#append_to(Oskar Eichler #363)- Preserve request method and params for 308 redirects (requires Rack 2+) (Oskar Eichler #364)
- Reuse
rack.inputin 307/308 redirect request if it is rewindable, fixing cases that use application/json and other content types (Oskar Eichler #367)- Don't use query string parameters from original request as request body parameters in 307/308 redirects (Jeremy Evans)
Minor enhancements:
- Add
Rack::Test::Session#default_input_content_typeand#convert_input_hash_to_stringprivate methods to allow for easier overriding of default behavior. (Haruki Kobayashi #359)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 33 commits:
Bump version to 2.3.0Add covering specs for some recent changesAdd name to CI configuration to simplify displayUpdate CI matrix to use one line per tested Ruby version and specific osFix Rack version guard in build_nested_query specAvoid cgi warning in the cookie object specDon't use query string parameters from original request as request body parameters in 307/308 redirectsReplay original request bodies across method-preserving redirectsUpdate History.mdAvoid discarded arrays while appending multipart partsMinor changes to 308 status supportPreserve the request method and params for HTTP 308 redirectsRewind uploaded files when appending raisesUse \z instead of \Z in anchorFix UploadedFile specNormalize mixed multipart arrays without mutating inputAdd note to switch UploadedFile#method_missing to ...Update coverage test code for simplecov 1.xUpdate History.mdAdd JRuby 10.1 to CIRefactor: Extract content-type and body conversion into overridable private methodsBump copyright yearUpdate to actions/checkout@v6Add Ruby 4.0 to CIFix a couple of typosAdd Rack::Test::Utils.override_build_nested_querySkip "removes local paths on garbage collection" on JRubyUse SimpleCov.add_filter block instead of stringAdd JRuby 10.0 to CIUpdate Rack::Lint example in READMEDocument Rack::Lint usageTry ubuntu-latest in CIAdd Ruby 3.4 to CI
βοΈ railties (indirect, 7.0.10 β 8.1.4.1) Β· Repo Β· Changelog
Release Notes
Too many releases to show here. View the full release notes.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ rake (indirect, 13.3.1 β 13.4.2) Β· Repo Β· Changelog
Release Notes
13.4.2
What's Changed
Full Changelog: v13.4.1...v13.4.2
13.4.1
What's Changed
Full Changelog: v13.4.0...v13.4.1
13.4.0
What's Changed
- refactor: fix ambiguous regexp / assertion in one of the tests by @pvdb in #667
- Fix RDoc formatting in doc/command_line_usage.rdoc by @hsbt in #693
- Document implicit file tasks by @hsbt in #692
- Show
chdiroption as a command by @nobu in #552- Verbose console by @kaiquekandykoga in #394
- Align example with text by @henrebotha in #632
- Allow accept multiple files to
TESTenv var by @Yegorov in #712- Replace Rake's Win32-specific logic with a 100% equivalent, pure-Ruby implementation by @pvdb in #669
- Add Options class and switch Application to use it instead of anonymous Struct by @hsbt in #694
- Accept Pathname object as rule's prerequisite by @gemmaro in #528
- Dedupe and simplify
standard_system_dirby @pvdb in #713New Contributors
- @kaiquekandykoga made their first contribution in #394
- @henrebotha made their first contribution in #632
- @Yegorov made their first contribution in #712
Full Changelog: v13.3.1...v13.4.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.
βοΈ thor (indirect, 1.4.0 β 1.5.0) Β· Repo Β· Changelog
Release Notes
1.5.0
What's Changed
- Add specs and linter documentation by @hlascelles in #907
- Add tree command by @hlascelles in #906
- feat: support
insert_into_fileerroring if the file is not changed, and addinsert_into_fileby @G-Rath in #908- support THOR_MERGE values with arguments by @rafaelfranca in #910
- Hidden commands should not make an invocation ambiguous by @deivid-rodriguez in #911
- Set frozen_string_literal: true in colors.rb by @tenderlove in #913
- fix encoding error when running a merge tool by @moritzschepp in #916
New Contributors
- @tenderlove made their first contribution in #913
- @dependabot[bot] made their first contribution in #912
- @moritzschepp made their first contribution in #916
Full Changelog: v1.4.0...v1.5.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 25 commits:
Prepare for 1.5.0Merge pull request #919 from rails/rmf-ciUnlock bundler development dependencyTest with Ruby 4.0Merge pull request #918 from rails/dependabot/github_actions/actions/checkout-6Merge pull request #916 from moritzschepp/ec-encodingBump actions/checkout from 5 to 6fix encoding error when running a merge toolRemove whatisthor.com referencesMerge pull request #912 from rails/dependabot/github_actions/actions/checkout-5Merge pull request #913 from rails/fsl-colorsSet frozen_string_literal: true in colors.rbBump actions/checkout from 4 to 5Merge pull request #911 from deivid-rodriguez/dont-suggest-hidden-commandsHidden commands should not make an invocation ambiguousMerge pull request #910 from rails/rm-fix-909Escape the diff tool as wellsupport THOR_MERGE values with argumentsMerge pull request #908 from G-Rath/new-inject-into-file-helperMerge pull request #906 from hlascelles/add-tree-flagfeat: add `insert_into_file!` and `inject_into_file!`Merge pull request #907 from hlascelles/add-local-test-documentationrefactor: move warningAdd tree flagAdd specs and linter documentation
βοΈ websocket-driver (indirect, 0.8.2 β 0.9.1) Β· Repo Β· Changelog
Release Notes
0.9.1 (from changelog)
- Stop buffering incoming data after a socket has failed or been closed
0.9.0 (from changelog)
- Add
allow_draftsoption to explicitly enable support fordraft75anddraft76protocols; these are now disabled by default- Forward the
max_lengthoption to any registered extensions- Fix bug in
draft75parser that could cause message corruption or crashes if the byte0xFFappears in a byte stream following a length prefix- Correctly handle cases where the
Sec-WebSocket-Key1orSec-WebSocket-Key2header produces an invalid value
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 9 commits:
Bump version to 0.9.1Stop buffering data after a socket has failed or been closedBump websocket-extensions dependencyExpose the validate_options methodBump version to 0.9.0Add allow_drafts option to explicitly enable draft protocol supportForward the max_length option to the Extensions containerFix draft75 parser confusion when 0xff appears in a length-prefixed blockCheck that value derived from draft76 Sec-WebSocket-Key{1,2} headers fits in 32 bits
βοΈ websocket-extensions (indirect, 0.1.5 β 0.3.0) Β· Repo Β· Changelog
Release Notes
0.3.0 (from changelog)
Refuse to serialize parameter values that do not conform to the
tokengrammar, c.f. RFC 6455:When using the quoted-string syntax variant, the value after quoted-string unescaping MUST conform to the 'token' ABNF.
0.2.0 (from changelog)
- Add an
optionsargument to theWebSocket::Extensions.newconstructor, to provide configuration parameters that should be passed on to individual extensions- Extend the header field parser to handle whitespace as required by the spec
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 16 commits:
Bump version to 0.3.0Refuse to serialize non-token parameter valuesTest on Ubuntu 24.04Expose the validate_options methodBump version to 0.2.0Add a defined set of options that the driver can pass in, to be foImplement correct LWS handling in the header parserTest on Ruby 3.3, 3.4, 4.0Run tests on some additional Ruby versionsTest on Ruby 3.1As of rspec-mocks v3.10.3, mock expectations need to use explicit hashes to avoid confusion with keyword argsSwitch from Travis CI to GitHub ActionsEnable Bundler caching for TravisUpdate Ruby versions on TravisMerge pull request #7 from timcraft/patch-1Test on ruby 3.0
βοΈ zeitwerk (indirect, 2.7.3 β 2.8.3) Β· Repo Β· Changelog
Release Notes
2.8.3 (from changelog)
- 2.8.0 introduced a regression: Collapsed directories that were also configured as eager load exclusions were eager loaded. The exclusion was not honored. This has been fixed.
2.8.1 (from changelog)
Replace anonymous block parameters with regular named ones.
Ruby 3.3.0 has a bug: it does not parse anonymous block parameters, which were introduced in Ruby 3.1.
While this is a Ruby bug and people could upgrade to 3.3.1, I prefer users just do not hit this. At the end of the day, it is cosmetic.
2.8.0 (from changelog)
Adds support for namespace files, nsfiles for short.
If a loader has an nsfile configured (
nilby default):loader.nsfile = 'ns.rb' # must be set before setupexplicit namespaces can be defined by such special file inside their directories:
my_component/ns.rb # MyComponent my_component/widget.rb # MyComponent::WidgetThis may be handy for self-contained units for which a
my_component.rbfile in the parent directory would feel unnatural.If an nsfile is set, you can still define explicit namespaces as always. Both styles can coexist in the project. However, it is an error condition to try to define the same namespace using both conventions.
For further details, please check the documentation for nsfiles.
When a file is shadowed because the constant path it maps to already exists, the location of said constant is included in the log message.
2.7.5 (from changelog)
If available, tree traversal is based on
Dir.scan, which saves syscalls in common platforms. This method is a recent addition to Ruby contributed by @byroot, so you need to be on Rubymasterto leverage this for now.Tree traversal is a tad more performant, regardless of the previous point. Gains are marginal when eager loading, because it is dominated by loading the code, but
Zeitwerk::Loader#all_expected_cpathswas 14% faster in some benchmarks, for example.README.md documents how to collect autoloaded constants using an
on_loadcallback.Internal maintenance.
2.7.4 (from changelog)
Loaders have to manage disjoint source trees. Therefore, when a root directory is configured Zeitwerk ensures it is not already managed by some other loader. The performance of this validation has been improved.
Thanks to @ngan for sharing some benchmarks that led to revise this logic.
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by more commits than we can show here.