CVE-2021-44528: actionpack Open Redirect in Host Authorization Middleware
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.96111%
CWE
Published
12/14/2021
Updated
2/18/2024
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
actionpack | rubygems | >= 6.0.0, <= 6.0.4.1 | 6.0.4.2 |
actionpack | rubygems | >= 6.1.0, <= 6.1.4.1 | 6.1.4.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key functions: 1) The regex in sanitize_string (original pattern /\A(.+.)?...) allowed invalid domain characters when hosts were configured with leading dots. 2) The authorized? method's use of slice(VALID_FORWARDED_HOST) didn't properly handle multi-value headers or invalid host formats. The patch fixes these by restricting the regex to [a-z0-9-] characters and splitting X-Forwarded-Host values properly. The test cases added in the commit demonstrate exploitation scenarios involving malformed hosts and multiple forwarded hosts.