Skip to content

Exposure of information in Action Pack

High severity GitHub Reviewed Published Feb 11, 2022 in rails/rails • Updated Jan 28, 2024

Package

bundler actionpack (RubyGems)

Affected versions

>= 5.0.0.0, <= 5.2.6.1
>= 6.0.0.0, <= 6.0.4.5
>= 6.1.0.0, <= 6.1.4.5
>= 7.0.0.0, <= 7.0.2.1

Patched versions

5.2.6.2
6.0.4.6
6.1.4.6
7.0.2.2

Description

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

References

@tenderlove tenderlove published to rails/rails Feb 11, 2022
Published to the GitHub Advisory Database Feb 11, 2022
Reviewed Feb 11, 2022
Published by the National Vulnerability Database Feb 11, 2022
Last updated Jan 28, 2024

Severity

High
7.4
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

CVE ID

CVE-2022-23633

GHSA ID

GHSA-wh98-p28r-vrc9

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.