Skip to content

gRPC client produces invalid protobuf when an HTTP header with non-UTF8 value is received.

Moderate
phlax published GHSA-9g5w-hqr3-w2ph Apr 4, 2023

Package

Envoy (Envoy)

Affected versions

< 1.26.0

Patched versions

1.25.3, 1.24.4, 1.23.6, 1.22.9

Description

Impact

Escalation of Privileges when failure_mode_allow: true is configured for ext_authz filter. For affected components that are used for logging and/or visibility, requests may not be logged by the receiving service.

Affected components

ext_authz, ext_proc, tap, ratelimit filters and gRPC access log service.

Attack vector/s

The attacker can use this vulnerability to bypass auth checks when ext_authz is used.

Description

When Envoy was configured to use ext_authz, ext_proc, tap, ratelimit filters, and grpc access log service and an http header with non-UTF-8 data was received, Envoy would generate an invalid protobuf message and send it to the configured service. The receiving service would typically generate an error when decoding the protobuf message.

For ext_authz that was configured with failure_mode_allow: true, the request would have been allowed in this case.

For the other services, this could have resulted in other unforseen errors such as a lack of visibility into requests (eg request not logged).

Envoy will now by default sanitize the values sent in gRPC service calls to be valid UTF-8, replacing data that is not valid UTF-8 with a ! character.
This behavioral change can be temporarily reverted by setting runtime guard envoy.reloadable_features.service_sanitize_non_utf8_strings to false.

Example exploit or proof-of-concept

Sending a request with non-UTF-8 header values will reproduce this issue when an gRPC upstream is configured.

Mitigation

Setting failure_mode_allow: false for ext_authz.

Discoverer/credits

Marek Szlagor [email protected]

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
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
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:R/S:U/C:L/I:L/A:N

CVE ID

CVE-2023-27488

Weaknesses

Credits