CVE-2021-22903Rubyonrails Rails
Medium 6.1 No auth needed
Follow: this CVE · Rubyonrails · Rubyonrails Rails We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- 1.2% probability of exploitation in 30 days · percentile 69
- Auth required
- No
- Published
- Jun 11, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-601
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
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`.
What to do
- Apply the vendor's security update for Rails.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| RubyGems | actionpack |
≥ 6.1.0.rc2 < 6.1.3.2 |
6.1.3.2 |
gem "actionpack", ">= 6.1.3.2" |
Per OSV / GitHub Advisories (GHSA-5hq2-xf89-9jxq). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| rubyonrails | rails | ≥ 6.1.1 < 6.1.3.2 |
| rubyonrails | rails | 6.1.0 |
Official sources
References
Links published by the sources. Open them with care.
- discuss.rubyonrails.org Mitigation Patch Vendor Advisory
- hackerone.com Permissions Required Third Party Advisory