GHSA-wh98-p28r-vrc9 CVE-2022-23633
Exposure of information in Action Pack
- Severity
- 7.4 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 2.22%
- Chance of exploitation in the next 30 days. Higher than 82.65% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
- CWE-212 Improper Removal of Sensitive Information Before Storage or Transfer
- Fix
5.2.6.2- Upgrade actionpack to this version or later
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
Affected versions
RubyGems
| Package | Vulnerable | Fixed in |
|---|---|---|
| actionpack | >= 5.0.0.0, < 5.2.6.2 |
5.2.6.2 |
| actionpack | >= 6.0.0.0, < 6.0.4.6 |
6.0.4.6 |
| actionpack | >= 6.1.0.0, < 6.1.4.6 |
6.1.4.6 |
| actionpack | >= 7.0.0.0, < 7.0.2.2 |
7.0.2.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
actionpack RubyGems → 5.2.6.2
- bundler
bundle update actionpack # Gemfile: gem "actionpack", ">= 5.2.6.2"
Severity breakdown
CVSS 3.1 7.4
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Weakness
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer
The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.
How to prevent it
- Requirements: Clearly specify which information should be regarded as private or sensitive, and require that the product offers functionality that allows the user to cleanse the sensitive information from the resource before it is published or exported to other parties.
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- Implementation, Operation: Some tools can automatically analyze documents to redact, strip, or "sanitize" private information, although some human review might be necessary. Tools may vary in terms of which document formats can be processed. When calling an external program to automatically generate or convert documents, invoke the program with any available options that avoid generating sensitive metadata. Some formats have well-defined fields that could contain private data, such as Exchangeable image file format (Exif), which can contain potentially sensitive metadata such as geolocation, date, and time [REF-1515] [REF-1516].
- Implementation: Use naming conventions and strong types to make it easier to spot when sensitive data is being used. When creating structures, objects, or other complex entities, separate the sensitive and non-sensitive data as much as possible.
- Implementation: Avoid errors related to improper resource shutdown or release (CWE-404), which may leave the sensitive data within the resource if it is in an incomplete state.
References
Advisories
Packages
Other links
- github.com/rails/rails/security/advisories/GHSA-wh98-p28r-vrc9
- github.com/rails/rails/commit/f9a2ad03943d5c2ba54e1d45f155442b519c75da
- discuss.rubyonrails.org/t/cve-2022-23633-possible-exposure-of-information-vulnerability-in-a…
- github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2022-23633.yml
- groups.google.com/g/ruby-security-ann/c/FkTM-_7zSNA/m/K2RiMJBlBAAJ
- lists.debian.org/debian-lts-announce/2022/09/msg00002.html
- rubyonrails.org/2022/2/11/Rails-7-0-2-2-6-1-4-6-6-0-4-6-and-5-2-6-2-have-been-released
- security.netapp.com/advisory/ntap-20240119-0013
- debian.org/security/2023/dsa-5372
- openwall.com/lists/oss-security/2022/02/11/5
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-rmj8-8hhh-gv5h Puma used with Rails may lead to Information Exposure | High | Linked by the source |
| GHSA-6x85-j5j2-27jx actionpack Path Traversal vulnerability | High Known exploited | Also affects actionpack |
| GHSA-xrr4-p6fq-hjg7 Directory traversal vulnerability in Action View in Ruby on Rails | High Known exploited | Also affects actionpack |
| GHSA-pgm4-439c-5jp6 Rails has a possible XSS vulnerability in its Action Pack debug exceptions | Medium | Also affects actionpack |
| GHSA-vfm5-rmrh-j26v Possible Content Security Policy bypass in Action Dispatch | Low | Also affects actionpack |
| GHSA-vfg9-r3fq-jvx4 Possible ReDoS vulnerability in HTTP Token authentication in Action Controller | Medium | Also affects actionpack |
| GHSA-x76w-6vjr-8xgj Possible ReDoS vulnerability in query parameter filtering in Action Dispatch | Medium | Also affects actionpack |
| GHSA-fwhr-88qx-h9g7 Missing security headers in Action Pack on non-HTML responses | Critical | Also affects actionpack |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor