CVE-2023-28362: XSS
The redirectto 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 redirectto method.
Other sources
The redirectto 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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rubygems/actionpackto a version that resolves this vulnerability.Fixed in 7.0.5.1 - Upgrade
Upgrade
rubygems/actionpackto a version that resolves this vulnerability.Fixed in 6.1.7.4 - Upgrade
Upgrade
redhat/rubygem-actionpackto a version that resolves this vulnerability.Fixed in 6.1.7.4 - Upgrade
Upgrade
redhat/rubygem-actionpackto a version that resolves this vulnerability.Fixed in 7.0.5.1 - Upgrade
Upgrade
debian/railsto a version that resolves this vulnerability.Fixed in 2:6.1.7.10+dfsg-1~deb12u2Fixed in 2:6.1.7.10+dfsg-1~deb12u3Fixed in 2:7.2.2.2+dfsg-2~deb13u1Fixed in 2:7.2.2.2+dfsg-2~deb13u2Fixed in 2:7.2.4+dfsg-2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.0.5.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.1.7.4 - Configuration
Avoid providing user-supplied URLs with arbitrary schemes to the redirect_to method; ensure the Rails app is configured to allow redirects to external hosts is false (defaults to false in Rails >= 7.0.x).
Rails redirect_to allow_redirects_to_external_hosts = false - Compensating control
If downstream services enforce RFC compliance on HTTP response headers, be aware the Location header may be removed; validate redirect behavior after upgrading and test downstream interactions.
Event History
Frequently Asked Questions
What is the severity of CVE-2023-28362?
CVE-2023-28362 is a medium severity vulnerability due to improper handling of characters in HTTP headers.
How do I fix CVE-2023-28362?
To mitigate CVE-2023-28362, upgrade the `rubygem-actionpack` package to version 6.1.7.4 or 7.0.5.1.
What type of vulnerability is CVE-2023-28362?
CVE-2023-28362 is an HTTP header injection vulnerability affecting the `redirect_to` method in Rails.
Which versions of actionpack are affected by CVE-2023-28362?
CVE-2023-28362 affects actionpack versions below 6.1.7.4 and 7.0.5.1.
What impact does CVE-2023-28362 have on my application?
CVE-2023-28362 may cause downstream services to remove the assigned Location header, potentially leading to redirect issues.