SecurityContext

CVE-2021-22881: Ruby on Rails - Open Redirect via Host Header Injection

  • Template: CVE-2021-22881
  • Name: Ruby on Rails - Open Redirect via Host Header Injection
  • Description: Ruby on Rails action pack before 6.1.2.1, 6.0.3.5 contains an open redirect caused by special crafted Host headers in combination with allowed host formats, letting attackers redirect users to malicious websites, exploit requires attacker to control Host headers.
  • 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.
  • Severity: medium
  • Authors: theamanrawat
  • Tags: cve, cve2021, ruby, rails, host-header, redirect, vuln
  • References: https://hackerone.com/reports/1047447, https://nvd.nist.gov/vuln/detail/CVE-2021-22881
  • Cves: CVE-2021-22881
  • Max requests: 1
  • Directory: http/cves
  • Path: http/cves/2021/CVE-2021-22881.yaml
  • Digest: 4a0a0047304502205653ed05bcbf5c29dd7aeb71b2df2e53a09412b18e58281cca327f2c02c7b2fb022100ec53e5b20413b9c7ae24282e6949c4db581cdc789d7e5677892d267834c99a8f
  • Created at: 2026-01-21T08:33:45Z
  • Updated at: 2026-11-21T02:03:58Z
  • Age in days: 307
  • Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-22881.yaml
  • Checked, none or zero: verified, products

Classification

  • Cwe: CWE-601
  • Cvss score: 6.1
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Epss score: 0.87301
  • Epss percentile: 0.99758
  • Not known: cpe

Metadata

  • Max-request: 1
  • Checked, none or zero: verified

Labels

  • Name: Action Pack - Open Redirect
  • 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.
  • Vulnerability type: open_redirect
  • Requirement type: none
  • Labels source: projectdiscovery
  • From cve: CVE-2021-22881
  • Checked, none or zero: vulnerability impact
  • Not known: requirements

```yaml

id: CVE-2021-22881

info:

name: Ruby on Rails - Open Redirect via Host Header Injection

author: theamanrawat

severity: medium

description: |

Ruby on Rails action pack before 6.1.2.1, 6.0.3.5 contains an open redirect caused by special crafted Host headers in combination with allowed host formats, letting attackers redirect users to malicious websites, exploit requires attacker to control Host headers.

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.

reference:

- https://hackerone.com/reports/1047447

- https://nvd.nist.gov/vuln/detail/CVE-2021-22881

classification:

cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

cvss-score: 6.1

cve-id: CVE-2021-22881

epss-score: 0.87301

epss-percentile: 0.99758

cwe-id: CWE-601

metadata:

verified: false

max-request: 1

tags: cve,cve2021,ruby,rails,host-header,redirect,vuln

http:

- raw:

- |

GET / HTTP/1.1

Host: interact.sh#{{randstr}}.{{Hostname}}

matchers-condition: and

matchers:

- type: regex

part: header

regex:

- '(?m)^(?:Location\s*?:\s*?)(?:https?://|//)?(?:[a-zA-Z0-9\-_\.@]*)interact\.sh.*$'

- type: status

condition: or

status:

- 302

- 301

digest: 4a0a0047304502205653ed05bcbf5c29dd7aeb71b2df2e53a09412b18e58281cca327f2c02c7b2fb022100ec53e5b20413b9c7ae24282e6949c4db581cdc789d7e5677892d267834c99a8f:922c64590222798bb761d5b6d8e72950

```