Skip to content

Internal redirect crash for requests with body/trailers

High
mattklein123 published GHSA-rm2p-qvf6-pvr6 Jun 9, 2022

Package

Envoy (Envoy)

Affected versions

< 1.22.1

Patched versions

1.22.1

Description

Attack type

Remote

Impact

Denial of Service (crash)

Affected component(s)

HTTP processing, when internal redirects are configured.

Attack vector(s)

Remote

Discoverer(s)/Credits

Artur Molchanov arturmolchanov@gmail.com

Description (brief; included in CVE)

Envoy internal redirects for requests with bodies or trailers are not safe if the redirect prompts an Envoy-generated local reply.

Example exploit or proof-of-concept

An example of when Envoy would send a local reply for internal redirects: if a client sends a non-headers-only request which results in a redirect, and the request redirects to a route configured for local replies, Envoy will send the local reply on processing the redirect headers. Due to a bug in the redirect logic, on sending that local reply, Envoy will attempt to reset the (completed, and deleted) downstream stream.

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

If Envoy attempts to send an internal redirect of an HTTP request consisting of more than HTTP headers, there’s a lifetime bug which can be triggered. If while replaying the request Envoy sends a local reply when the redirect headers are processed, the downstream state indicates that the downstream stream is not complete. On sending the local reply, Envoy will attempt to reset the upstream stream, but as it is actually complete, and deleted, this result in a use-after-free.

Mitigation

Disable internal redirects if crashes are observed.

Detection

Crashes with recreateStream in the call stack

Severity

High

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

CVE ID

CVE-2022-29227

Weaknesses