# CVE-2021-22881: Actionpack Open Redirect Vulnerability

- Severity: Medium 6.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 87.3%, higher than 99% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-02-11T16:12:34.000Z
- Modified: 2026-06-17T03:37:56.390Z
- Also known as: GHSA-8877-prq4-9xfw
- Weaknesses: CWE-601
- Assigned by: hackerone

## 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.

(As written by CVE List.)

## Affected

- https://github.com/rails/rails: Fixed in 6.1.2.1, 6.0.3.5
- actionpack (RubyGems): from 6.0.0 before 6.0.3.5; from 6.1.0 before 6.1.2.1
- rubyonrails rails: from 6.0.0 before 6.0.3.5; from 6.1.0 before 6.1.2.1
- fedoraproject fedora: 33

## Every score

- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 5.8 Medium `AV:N/AC:M/Au:N/C:P/I:P/A:N`

## References

- <https://hackerone.com/reports/1047447> (exploit, patch, third-party-advisory, web)
- <http://www.openwall.com/lists/oss-security/2021/12/14/5> (exploit, mailing-list, patch, web)
- <https://discuss.rubyonrails.org/t/cve-2021-22881-possible-open-redirect-in-host-authorization-middleware/77130> (mitigation, patch, vendor-advisory, web)
- <https://benjamin-bouchet.com/cve-2021-22881-faille-de-securite-dans-le-middleware-hostauthorization/> (patch, third-party-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3/> (vendor-advisory)
- <http://www.openwall.com/lists/oss-security/2021/05/05/2> (mailing-list, mitigation, third-party-advisory, web)
- <http://www.openwall.com/lists/oss-security/2021/08/20/1> (mailing-list, mitigation, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-22881> (advisory)
- <https://github.com/rails/rails/commit/b5de7b3a4787d8a55aaad39f477c16e3af65e444> (web)
- <https://benjamin-bouchet.com/cve-2021-22881-faille-de-securite-dans-le-middleware-hostauthorization> (web)
- <https://github.com/rails/rails> (web)
- <https://github.com/rails/rails/blob/v6.1.2.1/actionpack/CHANGELOG.md> (web)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2021-22881.yml> (web)
- <https://groups.google.com/g/rubyonrails-security/c/zN_3qA26l6E> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3> (web)
- <https://rubygems.org/gems/actionpack> (web)

## Sources

- CVE List: [CVE-2021-22881](https://www.cve.org/CVERecord?id=CVE-2021-22881), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-8877-prq4-9xfw](https://github.com/advisories/GHSA-8877-prq4-9xfw), CC-BY-4.0, modified 2024-02-20
- NVD: [CVE-2021-22881](https://nvd.nist.gov/vuln/detail/CVE-2021-22881), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-22881 · Whole record: https://cve.day/CVE-2021-22881.json · Rebuilt by cve.day 2026-11-25T22:57:59.907Z
