Impact In all Envoy Gateway versions prior to 1.2.7 and 1.3.1 a default Envoy Proxy access log configuration is used. This format is vulnerable to log injection attacks.
If the attacker uses a specially crafted user-agent which performs json injection, then he could add and overwrite fields to the access log.
Examples of attacks include:
- Using following string as user agent : HELLO-WORLD", "evil-ip": "1.1.1.1", "x-forwarded-for": "1.1.1.1 would lead to setting of new access log properties and overwrite of existing properties. Existing properties such as the value of the X-Forwarded-For header may have importance for security analysis of access logs, and their overwrite can be used to hide malicious activity.
- Using the following string as user-agent : " which renders an invalid json document. The invalid document may fail to be processed by observability solutions, which would allow attacker to hide malicious activity.
Patches 1.3.1, 1.2.7
Fix Using JSON format as the default format for access logs. The logged document will contain the same key and values as before. Only the order of properties is different inside the logged document.
Workaround One can overwrite the old text based default format with JSON formatter by setting the following property: "EnvoyProxy.spec.telemetry.accessLog" to
settings: - format: type: JSON json: starttime: '%STARTTIME%' method: '%REQ(:METHOD)%' x-envoy-origin-path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%' protocol: '%PROTOCOL%' responsecode: '%RESPONSECODE%' responseflags: '%RESPONSEFLAGS%' responsecodedetails: '%RESPONSECODEDETAILS%' connectionterminationdetails: '%CONNECTIONTERMINATIONDETAILS%' upstreamtransportfailurereason: '%UPSTREAMTRANSPORTFAILUREREASON%' bytesreceived: '%BYTESRECEIVED%' bytessent: '%BYTESSENT%' duration: '%DURATION%' x-envoy-upstream-service-time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%' x-forwarded-for: '%REQ(X-FORWARDED-FOR)%' user-agent: '%REQ(USER-AGENT)%' x-request-id: '%REQ(X-REQUEST-ID)%' :authority: '%REQ(:AUTHORITY)%' upstreamhost: '%UPSTREAMHOST%' upstreamcluster: '%UPSTREAMCLUSTER%' upstreamlocaladdress: '%UPSTREAMLOCALADDRESS%' downstreamlocaladdress: '%DOWNSTREAMLOCALADDRESS%' downstreamremoteaddress: '%DOWNSTREAMREMOTEADDRESS%' requestedservername: '%REQUESTEDSERVERNAME%' routename: '%ROUTENAME%' see API definition here
References Are there any links users can visit to find out more?
Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway. Prior to 1.5.7 and 1.6.2, EnvoyExtensionPolicy Lua scripts executed by Envoy proxy can be used to leak the proxy's credentials. These credentials can then be used to communicate with the control plane and gain access to all secrets that are used by Envoy proxy, e.g. TLS private keys and credentials used for downstream and upstream communication. This vulnerability is fixed in 1.5.7 and 1.6.2.