Skip to content

JWT filter crash in the clear route cache with remote JWKs

Moderate
phlax published GHSA-wqr5-qmq7-3qw3 Sep 19, 2024

Package

Envoy

Affected versions

> 1.29

Patched versions

1.31.2, 1.30.6, 1.29.9

Description

Summary

JWT filter will lead to an Envoy crash when clear route cache with remote JWKs.

Details and PoC

Fix an issue in JWT filter in the following case:

  • remote JWKs are used, which requires async header processing;
  • clear_route_cache is enabled on the provider;
  • header operations are enabled in JWT filter, e.g. header to claims feature;
  • the routing table is configured in a way that the JWT header operations modify requests to not match any route.

When these conditions are met, a crash is triggered in the upstream code due to nullptr reference conversion from route().

The root cause is the ordering of continueDecoding and clearRouteCache.

When the above conditions are met, the following incorrect sequence occurs:

  • JWT filter pauses and then continues header decoding.
  • router filter picks a route and starts the upstream request.
  • JWT filter clears the route cache.
  • upstream request gets pool ready notifications and checks the route again for a setting, but the route is now missing.

Impact

Envoy crashes when JWT filter is used

Reporter

Andreas Moregård (Andreas.Moregard@nordnet.se)

Severity

Moderate

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
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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:H/PR:N/UI:R/S:U/C:N/I:N/A:H

CVE ID

CVE-2024-45809

Weaknesses

No CWEs

Credits