HexBrain

Browse / CVEs / CVE-2021-44528

CVE-2021-44528· rubyonrails / rails· CWE-601

Open Redirect in Host Authorization Middleware

mediumseverity
6.1CVSS score
4.4%likelihood of exploitation, next 30 days
91%of all CVEs are less likely
Readycheck to confirm it

Specially crafted X-Forwarded-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.

Impact

This vulnerability can lead to phishing attacks, where users are tricked into visiting malicious websites and disclosing sensitive information.

Fix

Apply the latest security patches or updates provided by the vendor to fix the Open Redirect vulnerability in the Host Authorization Middleware.

How to confirm it

Send: GET /
Positive when: regex("(?i)location:\\s*(?:https?://|//)[^\\s]*interact\\.sh", header) and regex("(?i)(?:set-cookie:.*_[\\w-]+_session=|x-runtime:)", header) and status_code == 301 || status_code == 302 || status_co…

Run it with nuclei: nuclei -id CVE-2021-44528 -u <target>

The full check
id: CVE-2021-44528

info:
  name: Open Redirect in Host Authorization Middleware
  author: geeknik,jakxx
  severity: medium
  description: |
    Specially crafted X-Forwarded-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.
  impact: |
    This vulnerability can lead to phishing attacks, where users are tricked into visiting malicious websites and disclosing sensitive information.
  remediation: |
    Apply the latest security patches or updates provided by the vendor to fix the Open Redirect vulnerability in the Host Authorization Middleware.
  reference:
    - https://seclists.org/oss-sec/2021/q4/att-160/7-0-host-authorzation-open-redirect.patch
    - https://github.com/rails/rails/commit/0fccfb9a3097a9c4260c791f1a40b128517e7815
    - https://www.debian.org/security/2023/dsa-5372
    - https://security.netapp.com/advisory/ntap-20240208-0003/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-44528
  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-44528
    epss-score: 0.04421
    epss-percentile: 0.91436
    cwe-id: CWE-601
  metadata:
    verified: true
    max-request: 1
    vendor: rubyonrails
    product: rails
    shodan-query: cpe:"cpe:2.3:a:rubyonrails:rails"
  tags: cve,cve2021,redirect,rubyonrails

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        X-Forwarded-Host: //interact.sh

    matchers:
      - type: dsl
        dsl:
          - 'regex("(?i)location:\\s*(?:https?://|//)[^\\s]*interact\\.sh", header)'
          - 'regex("(?i)(?:set-cookie:.*_[\\w-]+_session=|x-runtime:)", header)'
          - 'status_code == 301 || status_code == 302 || status_code == 307 || status_code == 308'
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from