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 marekszlagor@gmail.com

Severity

Moderate
5.4
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
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