CVE-2021-32701

Possible bypass of token claim validation when OAuth2 Introspection caching is enabled

7.5 high EPSS 1.63%

Published 22 Jun 2021 Updated 3 Aug 2024 CNA: GitHub_M

Check your servers for CVE-2021-32701

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-32701 affects oathkeeper, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

ORY Oathkeeper is an Identity & Access Proxy (IAP) and Access Control Decision API that authorizes HTTP requests based on sets of Access Rules. When you make a request to an endpoint that requires the scope `foo` using an access token granted with that `foo` scope, introspection will be valid and that token will be cached. The problem comes when a second requests to an endpoint that requires the scope `bar` is made before the cache has expired. Whether the token is granted or not to the `bar` scope, introspection will be valid. A patch will be released with `v0.38.12-beta.1`. Per default, caching is disabled for the `oauth2_introspection` authenticator. When caching is disabled, this vulnerability does not exist. The cache is checked in [`func (a *AuthenticatorOAuth2Introspection) Authenticate(...)`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L152). From [`tokenFromCache()`](https://github.com/ory/oathkeeper/blob/6a31df1c3779425e05db1c2a381166b087cb29a4/pipeline/authn/authenticator_oauth2_introspection.go#L97) it seems that it only validates the token expiration date, but ignores whether the token has or not the proper scopes. The vulnerability was introduced in PR #424. During review, we failed to require appropriate test coverage by the submitter which is the primary reason that the vulnerability passed the review process.

Severity (CVSS)

7.5 high CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
low: an attack works without special conditions
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity none, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 1.63%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 76.9% of all scored CVEs. Scores of 1 Dec 2026.

Weakness

Affected products

As the CNA lists them.

ProductVersions
oathkeeper
affected >=v0.38.0-beta.2, < v0.38.12-beta.1

Is my server affected?

Find the installed version of oathkeeper and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i oathkeeper
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-32701 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-32701

RHEL, Rocky, Alma, Fedora

rpm -q oathkeeper
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-32701

Alpine

apk list --installed | grep -i oathkeeper

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2021-32701
trivy image --scanners vuln IMAGE | grep CVE-2021-32701

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2021-32701 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.