Summary
CORS filter will segfault and crash Envoy when the origin
header is removed and deleted between decodeHeaders
and encodeHeaders
.
Affected components
HTTP CORS filter
Details
In the CORS filter's decodeHeaders
method, a pointer to the origin
header is captured. If the origin
header is configured to be removed, a segfault crash will occur when the pointer is used again in encodeHeaders
since it has been dereferenced.
PoC
Impact
There will be a segfault crash in the CORS filter
Mitigation
Not removing the origin
header in Envoy configuration
Detection
Crashes in CORS filter.
Summary
CORS filter will segfault and crash Envoy when the
origin
header is removed and deleted betweendecodeHeaders
andencodeHeaders
.Affected components
HTTP CORS filter
Details
In the CORS filter's
decodeHeaders
method, a pointer to theorigin
header is captured. If theorigin
header is configured to be removed, a segfault crash will occur when the pointer is used again inencodeHeaders
since it has been dereferenced.PoC
origin
header is configured to be removed withrequest_headers_to_remove: origin
,https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route.proto
decodeHeaders
stores the pointer oforigin
, and then the header is removed.encodeHeader
in CORS filter.Impact
There will be a segfault crash in the CORS filter
Mitigation
Not removing the
origin
header in Envoy configurationDetection
Crashes in CORS filter.