Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
💎
💎 RubyGems
Not in CISA KEV
MEDIUM severity

CVE-2021-22881 — actionpack

MEDIUMFix: rails/rails@b5de7b3

CVE-2021-22881 is a medium-severity (CVSS 6.1) Open Redirect vulnerability in actionpack. 2 public exploit references exist, so weaponization risk is real. A fix is available for actionpack — see the affected versions and patch details below.

Actionpack Open Redirect Vulnerability

Also known asGHSA-8877-prq4-9xfw
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
2 known
Exploitation data as of Oct 12, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
87.3%probability of exploitation in next 30 days
Very High Risk0.00%
Lower risk than most CVEs100th percentile — riskier than 100% of all scored CVEsHighest risk
0.00%33.3%66.7%100.0%15.5%87.3%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-22881 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,987 CVEs with a current EPSS score, this one falls in the 50–90% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

2 pkgs affected
💎actionpack💎actionpack

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.

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 Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
💎RubyGemsactionpack≥ 6.0.0&&< 6.0.3.56.0.3.5bundle update actionpack --conservative
💎RubyGemsactionpack≥ 6.1.0&&< 6.1.2.16.1.2.1bundle update actionpack --conservative

Affected Products

2 products · 3 configurations
OS
fedorafedoraproject
1 version
33
Application
railsrubyonrails
≥ 6.1.0 && < 6.1.2.1
range
Exploits & PoCs
2

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for actionpack, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update actionpack to 6.0.3.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-22881 is resolved across your whole dependency graph.

  3. Workarounds

    Stop reflecting attacker-controlled destinations: resolve every redirect target against an allowlist of paths or hosts you own, prefer a server-side key over a full URL in the request, and reject absolute URLs entirely where the flow only ever needs a relative one.

How to detect CVE-2021-22881

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id cve-2021-22881 -u https://target
Template
Ruby on Rails - Open Redirect via Host Header Injection
Severity
medium
Impact
Attackers can redirect users to malicious sites, potentially leading to phishing or malware distribution.
Remediation
Update to version 6.1.2.1, 6.0.3.5 or later versions.

Template by ProjectDiscovery nuclei-templates (theamanrawat), MIT licensed. View the full template. Scan only systems you are authorised to test.

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2021-22881 in your dependencies?

Find it across RubyGems, including transitive dependencies.

CVE-2021-22881: actionpack — Fixed in 6.0.3.5