Skip to content

oauth filter allows trivial bypass

Critical
mattklein123 published GHSA-h45c-2f94-prxh Jun 9, 2022

Package

Envoy (Envoy)

Affected versions

< 1.22.1

Patched versions

1.22.1

Description

Attack type

Remote

Impact

Unauthorized access to endpoints protected by oauth.

Affected component(s)

Oauth protected endpoints.

Attack vector(s)

Any endpoint that’s supposed to be protected by the oauth filter.

Discoverer(s)/Credits

Weiqiu Wen [email protected]

Description (brief; included in CVE)

The OAuth filter implementation does not include a mechanism for validating access tokens, so by design when the HMAC signed cookie is missing a full authentication flow should be triggered. However, the current implementation assumes that access tokens are always validated thus allowing access in the presence of any access token attached to the request.

Example exploit or proof-of-concept

curl -v -H 'Authorization:Bearer asdfasdfasdfasd' https://<my-service>

Description (full; not included in CVE but will be published on GitHub later and linked)

The OAuth specification allows for authorization flows to be skipped as long as a valid token is present. However, validating the token is implementation specific and no such process is included within the Envoy’s open source implementation (private implementations do indeed validate the access token). This means that access tokens should be ignored and only the HMAC signed cookie should be used for authentication.

Mitigation

None.

Detection

Improper access in the access logs.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

CVE ID

CVE-2022-29226

Weaknesses