Description
The Host Authorization middleware in Action Pack before 6.1.2.1, 6.0.3.5 suffers from an open redirect vulnerability. Specially crafted `Host` headers in combination with certain "allowed host" formats can cause the Host Authorization middleware in Action Pack to redirect users to a malicious website. Impacted applications will have allowed hosts with a leading dot. When an allowed host contains a leading dot, a specially crafted `Host` header can be used to redirect to a malicious website.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| — | https://github.com/rails/rails | Fixed in 6.1.2.1, 6.0.3.5 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | rails | 2:6.0.3.5+dfsg-1 | — |
| Debian 13 | rails | 2:6.0.3.5+dfsg-1 | — |
| Debian 12 | rails | 2:6.0.3.5+dfsg-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | rails | No fix yet | — |
| Ubuntu 26.04 LTS | rails | No fix yet | — |
| Ubuntu 25.10 | rails | No fix yet | — |
| Ubuntu 24.04 LTS | rails | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | rails | No fix yet | — |
| Ubuntu Pro 20.04 LTS | rails | No fix yet | — |
| Ubuntu Pro 18.04 LTS | rails | No fix yet | — |
| Ubuntu Pro 16.04 LTS | rails | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | rubygem-actionpack-6.0 | 6.0.4.4-1.1 | openSUSE-SU-2024:11821-1 |
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- Ruby on Rails - Open Redirect via Host Header Injection http/cves/2021/CVE-2021-22881.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | actionpack | >= 6.0.0, < 6.0.3.5 | 6.0.3.5 | GHSA-8877-prq4-9xfw |
| RubyGems | actionpack | >= 6.1.0, < 6.1.2.1 | 6.1.2.1 | GHSA-8877-prq4-9xfw |
Advisories 1
- openSUSE-SU-2024:11821-1 ruby3.1-rubygem-actionpack-6.0-6.0.4.4-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://hackerone.com/reports/1047447
- https://discuss.rubyonrails.org/t/cve-2021-22881-possible-open-redirect-in-host-authorization-middleware/77130
- https://benjamin-bouchet.com/cve-2021-22881-faille-de-securite-dans-le-middleware-hostauthorization/
- FEDORA-2021-b571fca1b8 vendor-advisory
- [oss-security] 20210505 [CVE-2021-22903] Possible Open Redirect Vulnerability in Action Pack mailing-list
- [oss-security] 20210819 [CVE-2021-22942] Possible Open Redirect in Host Authorization Middleware mailing-list
- [oss-security] 20211214 [CVE-2021-44528] Possible Open Redirect in Host Authorization Middleware mailing-list