CVE-2021-21378
JSON

8.2high

JWT authentication bypass with unknown issuer token

Severity
8.2high CVSS:3.1 by GitHub_M
Exploit likelihood
1.71% (higher than 78% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
BIT-ENVOY-2021-21378GHSA-4996-m8hf-hj27

Description

Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing.

Affected

Product or packageVersionsReported by
envoyproxy envoy= 1.17.0, 1.17.0CVE List, NVD
envoy (Bitnami)from 1.17.0 before 1.17.1Bitnami Vulnerability Database

All scores

GitHub_M8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
NVD8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
NVD6.4medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:N
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

Envoy is a cloud-native high-performance edge/middle/service proxy. In Envoy version 1.17.0 an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list when Envoy's JWT Authentication filter is configured with the `allow_missing` requirement under `requires_any` due to a mistake in implementation. Envoy's JWT Authentication filter can be configured with the `allow_missing` requirement that will be satisfied if JWT is missing (JwtMissed error) and fail if JWT is presented or invalid. Due to a mistake in implementation, a JwtUnknownIssuer error was mistakenly converted to JwtMissed when `requires_any` was configured. So if `allow_missing` was configured under `requires_any`, an attacker can bypass authentication by presenting a JWT token with an issuer that is not in the provider list. Integrity may be impacted depending on configuration if the JWT token is used to protect against writes or modifications. This regression was introduced on 2020/11/12 in PR 13839 which fixed handling `allow_missing` under RequiresAny in a JwtRequirement (see issue 13458). The AnyVerifier aggregates the children verifiers' results into a final status where JwtMissing is the default error. However, a JwtUnknownIssuer was mistakenly treated the same as a JwtMissing error and the resulting final aggregation was the default JwtMissing. As a result, `allow_missing` would allow a JWT token with an unknown issuer status. This is fixed in version 1.17.1 by PR 15194. The fix works by preferring JwtUnknownIssuer over a JwtMissing error, fixing the accidental conversion and bypass with `allow_missing`. A user could detect whether a bypass occurred if they have Envoy logs enabled with debug verbosity. Users can enable component level debug logs for JWT. The JWT filter logs will indicate that there is a request with a JWT token and a failure that the JWT token is missing.

NVD (es)

Envoy es un proxy edge/middle/service de servicio de alto rendimiento nativo de la nube. En versión 1.17.0 de Envoy, un atacante puede omitir la autenticación presentando un token JWT con un emisor que no está en la lista de proveedores cuando el filtro de autenticación JWT de Envoy está configurado con el requisito "allow_missing" en "require_any" debido a un error en la implementación. El filtro de autenticación JWT de Envoy puede ser configurado con el requisito "allow_missing" que se cumplirá si falta JWT (error JwtMissed) y presentará un fallo si JWT existe o no es válido. Debido a un error en la implementación, un error de JwtUnknownIssuer se convirtió por error a JwtMissed cuando se configuró "require_any". Entonces, si se configuró "allow_missing" en "require_any", un atacante puede omitir la autenticación al presentar un token JWT con un emisor que no está en la lista de proveedores. La integridad puede ser impactada según la configuración si el token JWT se usa para proteger contra escrituras o modificaciones. Esta regresión fue introducida el 12/11/2020 en PR 13839, que corrigió el manejo de "allow_missing" en RequireAny en un JwtRequirement (consulte el problema 13458). AnyVerifier agrega los resultados de los comprobadores secundarios a un estado final donde JwtMissing es el error predeterminado. Sin embargo, un JwtUnknownIssuer se trató por error igual que un error JwtMissing y la agregación final resultante fue el JwtMissing predeterminado. Como resultado, "allow_missing" permitiría un token JWT con un estado de emisor desconocido. Esto es corregido en versión 1.17.1 por PR 15194. La corrección funciona al preferir JwtUnknownIssuer sobre un error de JwtMissing, corrigiendo la conversión accidental y omitiendo con "allow_missing". Un usuario podría detectar si se produjo una omisión si posee los registros de Envoy habilitados con verbosidad de depuración Los usuarios pueden habilitar registros de depuración a nivel de componente para JWT. Los registros del filtro JWT indicarán que se presenta una petición con un token JWT y un fallo de que falta el token JWT

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21378 changed 2024-08-03CVE Terms of Use
NVDCVE-2021-21378 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-ENVOY-2021-21378 changed 2026-09-08Apache-2.0