CVE-2021-22881
JSON

6.1medium

Actionpack Open Redirect Vulnerability

Severity
6.1medium CVSS:3.1 by NVD
Exploit likelihood
87.3% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
hackerone
Also known as
GHSA-8877-prq4-9xfw

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

Product or packageVersionsReported by
https://github.com/rails/railsFixed in 6.1.2.1, 6.0.3.5CVE List
actionpack (RubyGems)from 6.0.0 before 6.0.3.5, from 6.1.0 before 6.1.2.1GitHub Advisory Database
rubyonrails railsfrom 6.0.0 before 6.0.3.5, from 6.1.0 before 6.1.2.1NVD
fedoraproject fedora33NVD

All scores

GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD5.8medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:P/A:N

Classification

What each source says

CVE List

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.

GitHub Advisory Database

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.

NVD (es)

El middleware de Autorización de Host en Action Pack versiones anteriores a 6.1.2.1, 6.0.3.5 sufre una vulnerabilidad de redireccionamiento abierto. Los encabezados "Host" especialmente diseñados en combinación con determinados formatos "allowed host" pueden causar que el middleware de Autorización del Host en Action Pack redireccione a los usuarios a un sitio web malicioso. Las aplicaciones afectadas habrán permitido hosts con un punto inicial. Cuando un host permitido contiene un punto inicial, un encabezado "Host" especialmente diseñado puede ser usado para redireccionar hacia un sitio web malicioso

References

https://hackerone.com/reports/1047447exploit, patch, third-party-advisory, web
https://discuss.rubyonrails.org/t/cve-2021-22881-possible-open-redirect-in-host-authorization-middleware/77130mitigation, patch, vendor-advisory, web
https://benjamin-bouchet.com/cve-2021-22881-faille-de-securite-dans-le-middleware-hostauthorization/patch, third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XQ3NS4IBYE2I3MVMGAHFZBZBIZGHXHT3/vendor-advisory
http://www.openwall.com/lists/oss-security/2021/05/05/2mailing-list, mitigation, third-party-advisory, web
http://www.openwall.com/lists/oss-security/2021/08/20/1mailing-list, mitigation, third-party-advisory, web
http://www.openwall.com/lists/oss-security/2021/12/14/5exploit, mailing-list, patch, web
https://nvd.nist.gov/vuln/detail/CVE-2021-22881advisory
https://github.com/rails/rails/commit/b5de7b3a4787d8a55aaad39f477c16e3af65e444web
https://benjamin-bouchet.com/cve-2021-22881-faille-de-securite-dans-le-middleware-hostauthorizationweb
https://github.com/rails/railsweb
https://github.com/rails/rails/blob/v6.1.2.1/actionpack/CHANGELOG.mdweb

Sources

SourceRecordLicence
CVE ListCVE-2021-22881 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-8877-prq4-9xfw changed 2024-02-20CC-BY-4.0
NVDCVE-2021-22881 changed 2026-06-17Public domain