# CVE-2021-22903: Possible Open Redirect Vulnerability in Action Pack

- 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): 1.23%, higher than 69% of CVEs (2026-12-01)
- Published: 2021-05-05T19:48:29.000Z
- Modified: 2026-06-17T03:37:59.600Z
- Also known as: GHSA-5hq2-xf89-9jxq
- Weaknesses: CWE-601
- Assigned by: hackerone

## Description

The actionpack ruby gem before 6.1.3.2 suffers from a possible 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. This is similar to CVE-2021-22881. Strings in config.hosts that do not have a leading dot are converted to regular expressions without proper escaping. This causes, for example, `config.hosts << "sub.example.com"` to permit a request with a Host header value of `sub-example.com`.

(As written by CVE List.)

## Affected

- https://github.com/rails/rails: Fixed in 6.1.3.2
- actionpack (RubyGems): from 6.1.0.rc2 before 6.1.3.2
- rubyonrails rails: from 6.1.1 before 6.1.3.2; 6.1.0

## 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/1148025> (permissions-required, third-party-advisory, web)
- <https://discuss.rubyonrails.org/t/cve-2021-22903-possible-open-redirect-vulnerability-in-action-pack/77867> (mitigation, patch, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-22903> (advisory)
- <https://github.com/rails/rails/releases/tag/v6.1.3.2> (web)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2021-22903.yml> (web)
- <https://groups.google.com/g/rubyonrails-security/c/8TxqXEtgSF0> (web)

## Sources

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

---

Page: https://cve.day/CVE-2021-22903 · Whole record: https://cve.day/CVE-2021-22903.json · Rebuilt by cve.day 2026-11-25T22:58:01.811Z
