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

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

EPSS score

0.253%
(65th percentile)

CVE ID

CVE-2022-23633

GHSA ID

GHSA-wh98-p28r-vrc9

Source code

Credits

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