Ruby/actionpack/5.2.5


Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.

https://rubygems.org/gems/actionpack
MIT

23 Security Vulnerabilities

Actionpack has possible cross-site scripting vulnerability via User Supplied Values to redirect_to

Published date: 2023-06-29T15:03:16Z
CVE: CVE-2023-28362
Links:

The redirect_to method in Rails allows provided values to contain characters which are not legal in an HTTP header value. This results in the potential for downstream services which enforce RFC compliance on HTTP response headers to remove the assigned Location header. This vulnerability has been assigned the CVE identifier CVE-2023-28362.

Versions Affected: All. Not affected: None Fixed Versions: 7.0.5.1, 6.1.7.4

Impact

This introduces the potential for a Cross-site-scripting (XSS) payload to be delivered on the now static redirection page. Note that this both requires user interaction and for a Rails app to be configured to allow redirects to external hosts (defaults to false in Rails >= 7.0.x).

Releases

The FIXED releases are available at the normal locations.

Workarounds

Avoid providing user supplied URLs with arbitrary schemes to the redirect_to method.

Affected versions: < 6.1.7.4 (439 affected versions) Show all vulnerable versions

Possible DoS Vulnerability in Action Controller Token Authentication

Published date: 2021-05-05T19:49:12Z
CVE: CVE-2021-22904
Links:

There is a possible DoS vulnerability in the Token Authentication logic in Action Controller.

Versions Affected: >= 4.0.0 Not affected: < 4.0.0 Fixed Versions: 6.1.3.2, 6.0.3.7, 5.2.4.6, 5.2.6

Impact

Impacted code uses authenticate_or_request_with_http_token or authenticate_with_http_token for request authentication. Impacted code will look something like this:

class PostsController < ApplicationController
  before_action :authenticate

  private

  def authenticate
    authenticate_or_request_with_http_token do |token, options|
      # ...
    end
  end
end

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

The following monkey patch placed in an initializer can be used to work around the issue:

module ActionController::HttpAuthentication::Token
  AUTHN_PAIR_DELIMITERS = /(?:,|;|\t)/
end

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.

  • 5-2-http-authentication-dos.patch - Patch for 5.2 series
  • 6-0-http-authentication-dos.patch - Patch for 6.0 series
  • 6-1-http-authentication-dos.patch - Patch for 6.1 series

Please note that only the 6.1.Z, 6.0.Z, and 5.2.Z series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits

Thank you to https://hackerone.com/wonda_tea_coffee for reporting this issue!

Affected versions: >= 6.0.0, <= 6.0.3.6 (194 affected versions) Show all vulnerable versions

ReDoS based DoS vulnerability in Action Dispatch

Published date: 2023-01-18T18:20:51Z
CVE: CVE-2023-22795
Links:

There is a possible regular expression based DoS vulnerability in Action Dispatch related to the If-None-Match header. This vulnerability has been assigned the CVE identifier CVE-2023-22795.

Versions Affected: All Not affected: None Fixed Versions: 5.2.8.15 (Rails LTS), 6.1.7.1, 7.0.4.1

Impact

A specially crafted HTTP If-None-Match header can cause the regular expression engine to enter a state of catastrophic backtracking, when on a version of Ruby below 3.2.0. This can cause the process to use large amounts of CPU and memory, leading to a possible DoS vulnerability 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

We recommend that all users upgrade to one of the FIXED versions. In the meantime, users can mitigate this vulnerability by using a load balancer or other device to filter out malicious If-None-Match headers before they reach the application.

Users on Ruby 3.2.0 or greater are not affected by this vulnerability. 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.

6-1-Avoid-regex-backtracking-on-If-None-Match-header.patch - Patch for 6.1 series
7-0-Avoid-regex-backtracking-on-If-None-Match-header.patch - Patch for 7.0 series

Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Affected versions: >= 7.0.0, < 7.0.4.1 (251 affected versions) Show all vulnerable versions

Cross-site Scripting in actionpack

Published date: 2022-10-27T12:00:27Z
CVE: CVE-2022-3704
Links:

actionpack from the Ruby on Rails project is vulnerable to Cross-site Scripting in the Route Error Page. This issue has been patched with this commit.

This vulnerability is disputed by the Rails security team. It requires that the developer is tricked into copy pasting a malicious javascript-containing string into a development-only error page accessible only via localhost.

Affected versions: <= 7.0.4 (447 affected versions) Show all vulnerable versions

Action Pack contains Information Disclosure / Unintended Method Execution vulnerability

Published date: 2021-05-05T19:49:02Z
CVE: CVE-2021-22885
Links:

Impact

There is a possible information disclosure / unintended method execution vulnerability in Action Pack when using the redirect_to or polymorphic_url helper with untrusted user input.

Vulnerable code will look like this.

redirect_to(params[:some_param])

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

To work around this problem, it is recommended to use an allow list for valid parameters passed from the user. For example,

private def check(param)
  case param
  when "valid"
    param
  else
    "/"
  end
end

def index
  redirect_to(check(params[:some_param]))
end

Or force the user input to be cast to a string like this,

def index
  redirect_to(params[:some_param].to_s)
end

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.

  • 5-2-information-disclosure.patch - Patch for 5.2 series
  • 6-0-information-disclosure.patch - Patch for 6.0 series
  • 6-1-information-disclosure.patch - Patch for 6.1 series

Please note that only the 5.2, 6.0, and 6.1 series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

Credits

Thanks to Benoit Côté-Jodoin from Shopify for reporting this.

Affected versions: >= 6.0.0, <= 6.0.3.6 (343 affected versions) Show all vulnerable versions

Cross-site Scripting Vulnerability in Action Pack

Published date: 2022-04-27T22:28:59Z
CVE: CVE-2022-22577
Links:

There is a possible XSS vulnerability in Rails / Action Pack. This vulnerability has been assigned the CVE identifier CVE-2022-22577.

Versions Affected: >= 5.2.0 Not affected: < 5.2.0 Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1

Impact

CSP headers were only sent along with responses that Rails considered as HTML responses. This left API requests without CSP headers, which could possibly expose users to XSS attacks.

Releases

The FIXED releases are available at the normal locations.

Workarounds

Set a CSP for your API responses manually.

Affected versions: >= 5.2.0, <= 5.2.7.0 (70 affected versions) Show all vulnerable versions

ReDoS based DoS vulnerability in Action Dispatch

Published date: 2023-01-18T18:23:34Z
CVE: CVE-2023-22792
Links:

There is a possible regular expression based DoS vulnerability in Action Dispatch. This vulnerability has been assigned the CVE identifier CVE-2023-22792.

Versions Affected: >= 3.0.0 Not affected: < 3.0.0 Fixed Versions: 5.2.8.15 (Rails LTS), 6.1.7.1, 7.0.4.1 Impact

Specially crafted cookies, in combination with a specially crafted XFORWARDEDHOST header can cause the regular expression engine to enter a state of catastrophic backtracking. This can cause the process to use large amounts of CPU and memory, leading to a possible DoS vulnerability 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

We recommend that all users upgrade to one of the FIXED versions. In the meantime, users can mitigate this vulnerability by using a load balancer or other device to filter out malicious XFORWARDEDHOST headers before they reach the application. 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.

6-1-Use-string-split-instead-of-regex-for-domain-parts.patch - Patch for 6.1 series
7-0-Use-string-split-instead-of-regex-for-domain-parts.patch - Patch for 7.0 series

Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases.

https://rubyonrails.org/2023/1/17/Rails-Versions-6-0-6-1-6-1-7-1-7-0-4-1-have-been-released

Affected versions: >= 3.0.0, < 5.2.8.15 (358 affected versions) Show all vulnerable versions

Possible ReDoS vulnerability in HTTP Token authentication in Action Controller

Published date: 2024-10-15T23:35:35Z
CVE: CVE-2024-47887
Links:

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_token or 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

Affected versions: >= 4.0.0, < 6.1.7.9 (281 affected versions) Show all vulnerable versions

Possible Content Security Policy bypass in Action Dispatch

Published date: 2024-12-10T22:42:27Z
CVE: CVE-2024-54133
Links:

There is a possible Cross Site Scripting (XSS) vulnerability in the content_security_policy helper 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!

Affected versions: >= 5.2.0, < 7.0.8.7 (142 affected versions) Show all vulnerable versions

Exposure of information in Action Pack

Published date: 2022-02-11T20:49:14Z
CVE: CVE-2022-23633
Links:

Impact

Under certain circumstances response bodies will not be closed, for example a bug in a webserver or a bug in a Rack middleware. In the event a response is not notified of a close, ActionDispatch::Executor will not know to reset thread local state for the next request. This can lead to data being leaked to subsequent requests, especially when interacting with ActiveSupport::CurrentAttributes.

Upgrading to the FIXED versions of Rails will ensure mitigation of this issue even in the context of a buggy webserver or middleware implementation.

Patches

This has been fixed in Rails 7.0.2.2, 6.1.4.6, 6.0.4.6, and 5.2.6.2.

Workarounds

Upgrading is highly recommended, but to work around this problem the following middleware can be used:

class GuardedExecutor < ActionDispatch::Executor
  def call(env)
    ensure_completed!
    super
  end

  private

    def ensure_completed!
      @executor.new.complete! if @executor.active?
    end
end

# Ensure the guard is inserted before ActionDispatch::Executor
Rails.application.configure do
  config.middleware.swap ActionDispatch::Executor, GuardedExecutor, executor
end

Affected versions: >= 5.0.0.0, <= 5.2.6.1 (102 affected versions) Show all vulnerable versions

Possible ReDoS vulnerability in query parameter filtering in Action Dispatch

Published date: 2024-10-15T23:35:33Z
CVE: CVE-2024-41128
Links:

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!

Affected versions: >= 3.1.0, < 6.1.7.9 (351 affected versions) Show all vulnerable versions

Possible XSS Vulnerability in Action Pack

Published date: 2022-04-27
Framework: rails
CVE: 2022-22577
CVSS V3: 6.1
Links:

There is a possible XSS vulnerability in Rails / Action Pack. This vulnerability has been assigned the CVE identifier CVE-2022-22577.

Versions Affected: >= 5.2.0 Not affected: < 5.2.0 Fixed Versions: 7.0.2.4, 6.1.5.1, 6.0.4.8, 5.2.7.1

Impact

CSP headers were only sent along with responses that Rails considered as HTML responses. This left API requests without CSP headers, which could possibly expose users to XSS attacks.

Releases

The FIXED releases are available at the normal locations.

Workarounds

Set a CSP for your API responses manually.

Affected versions: 82 affected versions Show all vulnerable versions

Possible exposure of information vulnerability in Action Pack

Published date: 2022-02-11
Framework: rails
CVE: 2022-23633
CVSS V3: 7.4
Links:

Impact

Under certain circumstances response bodies will not be closed, for example a bug in a webserver (https://github.com/puma/puma/pull/2812) or a bug in a Rack middleware. In the event a response is not notified of a close, ActionDispatch::Executor will not know to reset thread local state for the next request. This can lead to data being leaked to subsequent requests, especially when interacting with ActiveSupport::CurrentAttributes.

Upgrading to the FIXED versions of Rails will ensure mitigation if this issue even in the context of a buggy webserver or middleware implementation.

Patches

This has been fixed in Rails 7.0.2.2, 6.1.4.6, 6.0.4.6, and 5.2.6.2.

Workarounds

Upgrading is highly recommended, but to work around this problem the following middleware can be used:

class GuardedExecutor < ActionDispatch::Executor
  def call(env)
    ensure_completed!
    super
  end

  private

    def ensure_completed!
      @executor.new.complete! if @executor.active?
    end
end

# Ensure the guard is inserted before ActionDispatch::Executor
Rails.application.configure do
  config.middleware.swap ActionDispatch::Executor, GuardedExecutor, executor
end

Affected versions: 114 affected versions Show all vulnerable versions

Possible XSS via User Supplied Values to redirect_to

Published date: 2023-06-26
Framework: rails
CVE: 2023-28362
CVSS V3: 4.0
Links:

The redirect_to method in Rails allows provided values to contain characters which are not legal in an HTTP header value. This results in the potential for downstream services which enforce RFC compliance on HTTP response headers to remove the assigned Location header. This vulnerability has been assigned the CVE identifier CVE-2023-28362.

Versions Affected: All. Not affected: None Fixed Versions: 7.0.5.1, 6.1.7.4

Impact

This introduces the potential for a Cross-site-scripting (XSS) payload to be delivered on the now static redirection page. Note that this both requires user interaction and for a Rails app to be configured to allow redirects to external hosts (defaults to false in Rails >= 7.0.x).

Releases

The FIXED releases are available at the normal locations.

Workarounds

Avoid providing user supplied URLs with arbitrary schemes to the redirect_to method.

Affected versions: 441 affected versions Show all vulnerable versions

Possible ReDoS vulnerability in query parameter filtering in Action Dispatch

Published date: 2024-10-15
Framework: rails
CVE: 2024-41128
Links:

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!

Affected versions: 355 affected versions Show all vulnerable versions

Possible ReDoS vulnerability in HTTP Token authentication in Action Controller

Published date: 2024-10-15
Framework: rails
CVE: 2024-47887
Links:

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_token or 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

Affected versions: 285 affected versions Show all vulnerable versions

Possible Content Security Policy bypass in Action Dispatch

Published date: 2024-12-10
Framework: rails
CVE: 2024-54133
Links:

There is a possible Cross Site Scripting (XSS) vulnerability in the content_security_policy helper 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!

Affected versions: 152 affected versions Show all vulnerable versions

Possible restoration of destroyed sessions in Action Dispatch CacheStore

Published date: 2026-11-04
Framework: rails
CVSS V3: 4.2
Links:

Impact

ActionDispatch::Session::CacheStore writes 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, through reset_session on 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_store are affected, with any cache backend. ActionDispatch::Session::CookieStore is not affected, nor is ActionDispatch::Session::MemCacheStore with 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.

Affected versions: 520 affected versions Show all vulnerable versions

Missing SameSite attribute on session cookies from Action Pack session stores

Published date: 2026-11-04
Framework: rails
CVSS V3: 3.1
Links:

Impact

Action Pack session stores other than ActionDispatch::Session::CookieStore (CacheStore, MemCacheStore, and third-party stores built on AbstractStore, AbstractSecureStore or the session mixins) write the session cookie without a SameSite attribute, regardless of config.action_dispatch.cookies_same_site_protection, which defaults to :lax. Only CookieStore applies the configured policy. In browsers that do not treat a cookie without the attribute as SameSite=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 CookieStore and do not pass same_site: to config.session_store.

Details

In the fixed releases, every session store sets the session cookie's SameSite attribute from cookies_same_site_protection when its options have no :same_site key. An explicit same_site: option, including same_site: nil, and a :same_site value in a store's DEFAULT_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.patch

Credit

This issue was responsibly reported by HackerOne researcher tjvc.

Affected versions: 520 affected versions Show all vulnerable versions

Possible cache poisoning in Action Pack content negotiation

Published date: 2026-11-04
Framework: rails
CVSS V3: 4.8
Links:

Impact

Action Pack negotiates the format of a rendered response from the Accept, X-Requested-With and, for XHR requests without Accept, Content-Type request headers, but ActionController::Rendering#_set_vary_header adds Vary: Accept only when the request carries a usable Accept header and the response has no Vary header yet. A response to a request without Accept, or to an XHR request, therefore omits the headers that selected its representation, and a response whose Vary the application set before rendering (for example Vary: Accept-Language) never gains Accept. A shared cache that honours Vary could 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 with expires_in ..., public: true) behind a shared cache that honours Vary, such as Thruster or Rack::Cache, are affected.

Details

In the fixed releases, a rendered response whose format is not given by the URL lists Accept and X-Requested-With in Vary, and also Content-Type for an XHR request without Accept; when config.action_dispatch.ignore_accept_header is enabled, it lists only X-Requested-With. These fields are appended to an existing Vary value rather than skipped, and Vary: * 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-With on negotiated responses in the application, for example in an after_action, or do not mark negotiated responses public.

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).

Affected versions: 520 affected versions Show all vulnerable versions

Possible DoS vulnerability in Action Controller Live streaming

Published date: 2026-11-04
Framework: rails
CVSS V3: 5.9
Links:

Impact

ActionController::Live::Buffer#close pushes 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 its ActionController::Live thread, 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.patch

Credit

This issue was found by the Anthropic OSS Scanner (ANT-2026-LDFW5N2T).

Affected versions: 520 affected versions Show all vulnerable versions

Possible Strong Parameters bypass in Parameters#each_key in Action Pack

Published date: 2026-11-04
Framework: rails
CVSS V3: 7.5
Links:

Impact

ActionController::Parameters#each_key delegates to the internal ActiveSupport::HashWithIndifferentAccess that holds the request parameters, so when called with a block it returns that hash instead of the Parameters instance. The hash does not respond to permitted?, so Active Model mass assignment (new, assign_attributes, update) accepts it without raising ActiveModel::ForbiddenAttributesError. An application that passes the return value of each_key to 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_pair and each_value return the Parameters instance but left each_key delegated.

Details

The fixed releases define Parameters#each_key to yield each key and return the Parameters instance when given a block, as each, each_pair and each_value do, and to return an Enumerator without one. Code that used the return value of each_key as a hash now receives the Parameters instance, 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 permitted Parameters instance 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.

Affected versions: 520 affected versions Show all vulnerable versions

Possible sensitive session information leak in Active Storage proxy mode

Published date: 2026-11-04
Framework: rails
CVSS V3: 6.8
Links:

Impact

When ActionDispatch::Cookies reads a signed or encrypted cookie that was written under a rotated secret (config.action_dispatch.cookies_rotations) or in the format that a :hybrid cookie serializer migrates from, it writes the cookie back to the response in the current format, and that write ignores request.session_options[:skip]. ActiveStorage::DisableSession relies 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 in Set-Cookie on a cacheable response. A shared cache that stores such a response together with its Set-Cookie header 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 :hybrid serializer migration configured, and run behind a cache that stores Set-Cookie on 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.patch

Credit

This issue was responsibly reported by HackerOne researcher flashmyname.

Affected versions: 520 affected versions Show all vulnerable versions
Secure versions: [8.0.5.2, 8.1.4.1]
Recommendation: Update to version 8.1.4.1.

522 Other Versions

Version License Security Released
6.0.1.rc1 MIT 43 2019-10-31 - 20:05 about 7 years
6.0.0 MIT 43 2019-08-16 - 18:00 over 7 years
6.0.0.rc2 MIT 24 2019-07-22 - 21:10 over 7 years
6.0.0.rc1 MIT 24 2019-04-24 - 18:51 over 7 years
6.0.0.beta3 MIT 24 2019-03-13 - 17:02 over 7 years
6.0.0.beta2 MIT 24 2019-02-25 - 22:45 over 7 years
6.0.0.beta1 MIT 24 2019-01-18 - 20:46 almost 8 years
5.2.8.1 MIT 17 2022-07-12 - 17:26 over 4 years
5.2.8 MIT 17 2022-05-09 - 13:58 over 4 years
5.2.7.1 MIT 17 2022-04-26 - 19:23 over 4 years
5.2.7 MIT 19 2022-03-11 - 00:00 over 4 years
5.2.6.3 MIT 19 2022-03-08 - 17:45 over 4 years
5.2.6.2 MIT 19 2022-02-11 - 19:37 almost 5 years
5.2.6.1 MIT 21 2022-02-11 - 18:44 almost 5 years
5.2.6 MIT 21 2021-05-05 - 17:08 over 5 years
5.2.5 MIT 23 2021-03-26 - 17:19 over 5 years
5.2.4.6 MIT 21 2021-05-05 - 15:29 over 5 years
5.2.4.5 MIT 23 2021-02-10 - 20:35 almost 6 years
5.2.4.4 MIT 23 2020-09-09 - 18:36 about 6 years
5.2.4.3 MIT 23 2020-05-18 - 15:42 over 6 years
5.2.4.2 MIT 27 2020-03-19 - 16:37 over 6 years
5.2.4.1 MIT 27 2019-12-18 - 19:02 almost 7 years
5.2.4 MIT 27 2019-11-27 - 15:46 almost 7 years
5.2.4.rc1 MIT 27 2019-11-23 - 00:28 about 7 years
5.2.3 MIT 27 2019-03-28 - 03:02 over 7 years
5.2.3.rc1 MIT 27 2019-03-22 - 03:34 over 7 years
5.2.2.1 MIT 27 2019-03-13 - 16:47 over 7 years
5.2.2 MIT 27 2018-12-04 - 18:13 almost 8 years
5.2.2.rc1 MIT 27 2018-11-28 - 22:54 almost 8 years
5.2.1.1 MIT 27 2018-11-27 - 20:13 almost 8 years
5.2.1 MIT 27 2018-08-07 - 21:43 over 8 years
5.2.1.rc1 MIT 27 2018-07-30 - 20:20 over 8 years
5.2.0 MIT 27 2018-04-09 - 20:05 over 8 years
5.2.0.rc2 MIT 23 2018-03-20 - 17:53 over 8 years
5.2.0.rc1 MIT 23 2018-01-30 - 23:37 almost 9 years
5.2.0.beta2 MIT 23 2017-11-28 - 05:03 almost 9 years
5.2.0.beta1 MIT 23 2017-11-27 - 18:04 almost 9 years
5.1.7 MIT 27 2019-03-28 - 02:47 over 7 years
5.1.7.rc1 MIT 27 2019-03-22 - 04:12 over 7 years
5.1.6.2 MIT 27 2019-03-13 - 16:45 over 7 years
5.1.6.1 MIT 27 2018-11-27 - 20:11 almost 8 years
5.1.6 MIT 27 2018-03-29 - 18:28 over 8 years
5.1.5 MIT 27 2018-02-14 - 20:00 almost 9 years
5.1.5.rc1 MIT 27 2018-02-01 - 18:59 almost 9 years
5.1.4 MIT 27 2017-09-08 - 00:50 about 9 years
5.1.4.rc1 MIT 27 2017-08-24 - 19:36 about 9 years
5.1.3 MIT 27 2017-08-03 - 19:14 over 9 years
5.1.3.rc3 MIT 27 2017-07-31 - 19:11 over 9 years
5.1.3.rc2 MIT 27 2017-07-25 - 20:17 over 9 years
5.1.3.rc1 MIT 27 2017-07-19 - 19:37 over 9 years