Skip to content

Envoy Gateway Log Injection Vulnerability

Moderate severity GitHub Reviewed Published Mar 6, 2025 in envoyproxy/gateway • Updated Mar 6, 2025

Package

gomod github.com/envoyproxy/gateway (Go)

Affected versions

< 1.2.7
>= 1.3.0-rc.1, < 1.3.1

Patched versions

1.2.7
1.3.1

Description

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:
      start_time: '%START_TIME%'
      method: '%REQ(:METHOD)%'
      x-envoy-origin-path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%'
      protocol: '%PROTOCOL%'
      response_code: '%RESPONSE_CODE%'
      response_flags: '%RESPONSE_FLAGS%'
      response_code_details: '%RESPONSE_CODE_DETAILS%'
      connection_termination_details: '%CONNECTION_TERMINATION_DETAILS%'
      upstream_transport_failure_reason: '%UPSTREAM_TRANSPORT_FAILURE_REASON%'
      bytes_received: '%BYTES_RECEIVED%'
      bytes_sent: '%BYTES_SENT%'
      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)%'
      upstream_host: '%UPSTREAM_HOST%'
      upstream_cluster: '%UPSTREAM_CLUSTER%'
      upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%'
      downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%'
      downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%'
      requested_server_name: '%REQUESTED_SERVER_NAME%'
      route_name: '%ROUTE_NAME%'

see API definition here

References

Are there any links users can visit to find out more?

References

@guydc guydc published to envoyproxy/gateway Mar 6, 2025
Published to the GitHub Advisory Database Mar 6, 2025
Reviewed Mar 6, 2025
Published by the National Vulnerability Database Mar 6, 2025
Last updated Mar 6, 2025

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
None
Scope
Unchanged
Confidentiality
None
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:N/S:U/C:N/I:L/A:N

EPSS score

Weaknesses

CVE ID

CVE-2025-25294

GHSA ID

GHSA-mf24-chxh-hmvj

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.