CVE-2022-23634: Information Exposure when using Puma with Rails
Impact Prior to puma version 5.6.2, puma may not always call close on the response body. Rails, prior to version 7.0.2.2, depended on the response body being closed in order for its CurrentAttributes implementation to work correctly.
From Rails:
> Under certain circumstances response bodies will not be closed, for example a bug in a webserver[1] 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.
The combination of these two behaviors (Puma not closing the body + Rails' Executor implementation) causes information leakage.
Patches This problem is fixed in Puma versions 5.6.2 and 4.3.11.
This problem is fixed in Rails versions 7.02.2, 6.1.4.6, 6.0.4.6, and 5.2.6.2.
See: https://github.com/advisories/GHSA-wh98-p28r-vrc9 for details about the rails vulnerability
Upgrading to a patched Rails or Puma version fixes the vulnerability.
Workarounds
Upgrade to Rails versions 7.02.2, 6.1.4.6, 6.0.4.6, and 5.2.6.2.
The Rails CVE includes a middleware that can be used instead.
References
Rails CVE: CVE-2022-23633
For more information If you have any questions or comments about this advisory: Open an issue in puma See our security policy
Other sources
A flaw was found in Puma and Rails rubygems when response bodies were not closed under certain situations. This flaw allows an attacker, by iterating certain requests, to take advantage of this issue and affect CurrentAttributes, leading to leaked data.
Puma is a Ruby/Rack web server built for parallelism. Prior to puma version 5.6.2, puma may not always call close on the response body. Rails, prior to version 7.0.2.2, depended on the response body being closed in order for its CurrentAttributes implementation to work correctly. The combination of these two behaviors (Puma not closing the body + Rails' Executor implementation) causes information leakage. This problem is fixed in Puma versions 5.6.2 and 4.3.11. This problem is fixed in Rails versions 7.02.2, 6.1.4.6, 6.0.4.6, and 5.2.6.2. Upgrading to a patched Rails or Puma version fixes the vulnerability.
— Ubuntu
Puma may not always call close on the response body. Rails depended on the response body being closed in order for its CurrentAttributes implementation to work correctly.
References:
https://github.com/advisories/GHSA-rmj8-8hhh-gv5h https://github.com/advisories/GHSA-wh98-p28r-vrc9
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/tfm-rubygem-pumato a version that resolves this vulnerability.Fixed in 0:5.6.2-1.el7 - Upgrade
Upgrade
redhat/rubygem-pumato a version that resolves this vulnerability.Fixed in 0:5.6.2-1.el8 - Upgrade
Upgrade
rubygems/pumato a version that resolves this vulnerability.Fixed in 4.3.11 - Upgrade
Upgrade
rubygems/pumato a version that resolves this vulnerability.Fixed in 5.6.2 - Upgrade
Upgrade
redhat/rubygem-pumato a version that resolves this vulnerability.Fixed in 5.6.2 - Upgrade
Upgrade
redhat/rubygem-pumato a version that resolves this vulnerability.Fixed in 4.3.11 - Upgrade
Upgrade
redhat/rubygem-railsto a version that resolves this vulnerability.Fixed in 7.02.2 - Upgrade
Upgrade
redhat/rubygem-railsto a version that resolves this vulnerability.Fixed in 6.1.4.6 - Upgrade
Upgrade
redhat/rubygem-railsto a version that resolves this vulnerability.Fixed in 6.0.4.6 - Upgrade
Upgrade
redhat/rubygem-railsto a version that resolves this vulnerability.Fixed in 5.2.6.2 - Upgrade
Upgrade
debian/pumato a version that resolves this vulnerability.Fixed in 3.12.0-2+deb10u3Fixed in 4.3.8-1+deb11u2Fixed in 5.6.5-3Fixed in 6.4.2-4 - Upgrade
Upgrade
ubuntu/pumato a version that resolves this vulnerability.Fixed in 3.12.4-1ubuntu2+ - Upgrade
Upgrade
ubuntu/pumato a version that resolves this vulnerability.Fixed in 5.5.2-2ubuntu2+ - Upgrade
Upgrade
debian/pumato a version that resolves this vulnerability.Fixed in 3.12.0-2+deb10u3 - Upgrade
Upgrade
debian/pumato a version that resolves this vulnerability.Fixed in 4.3.8-1+deb11u2 - Upgrade
Upgrade
debian/pumato a version that resolves this vulnerability.Fixed in 5.6.5-3 - Upgrade
Upgrade
debian/pumato a version that resolves this vulnerability.Fixed in 6.4.2-4
Event History
Frequently Asked Questions
What is CVE-2022-23634?
CVE-2022-23634 is a vulnerability found in Puma and Rails rubygems that allows the response body to remain unclosed under certain situations.
What is the impact of CVE-2022-23634?
The vulnerability impacts Puma versions prior to 5.6.2 and Rails versions prior to 7.0.2.2, causing the response body to not be closed properly and affecting Rails' CurrentAttributes implementation.
How can I fix CVE-2022-23634?
To fix CVE-2022-23634, ensure that you are using Puma version 5.6.2 or later and Rails version 7.0.2.2 or later.
What is the severity of CVE-2022-23634?
CVE-2022-23634 has a severity rating of high.
Where can I find more information about CVE-2022-23634?
You can find more information about CVE-2022-23634 on CVE.org, NVD, GitHub, Red Hat Bugzilla, and Red Hat Access.