Skip to content

Envoy Heap Buffer Overflow in TcpStatsdSink

Moderate
nezdolik published GHSA-7q3f-gwg7-j8g4 Jun 23, 2026

Package

github.com/envoyproxy/envoy (Envoy Proxy)

Affected versions

>=v1.34,<1.39

Patched versions

1.35.13 1.36.9 1.37.5 1.38.3

Description

Impact

Vulnerability Type: Heap Out-of-Bounds Write / Memory Corruption

Severity: High

Description: A vulnerability exists in Envoy's TCP StatsD sink (TcpStatsdSink), where the thread-local flusher buffer can be overflowed by exceptionally long statistic names (e.g., >16KiB).

During formatting, TcpStatsdSink reserves a single contiguous memory slice of 16KiB (FLUSH_SLICE_SIZE_BYTES). If formatting a single metric exceeds the remaining capacity, the flusher initiates a buffer rotation but incorrectly continues to allocate another fixed 16KiB slice.

If an attacker can trigger a statistic name longer than 16KiB—for example, by sending an HTTP or gRPC request with an extremely long request path (:path) that is recorded by the grpc_stats filter configured with stats_for_all_methods: true—the flusher will attempt to copy the metric name using memcpy operations beyond the allocated heap buffer boundaries. This leads to a heap write overflow, which can cause immediate denial-of-service (process crash) or potential remote code execution (RCE).

Who is Impacted?: Any Envoy deployment is vulnerable if it:

Configures a TCP-based StatsD sink (envoy.stat_sinks.statsd).
Emits dynamic statistics whose names can be influenced or controlled by downstream clients (e.g., enabling grpc_stats with stats_for_all_methods: true).

Patches

The problem exists in Envoy latest main and all supported release branches.

Workarounds

Users can mitigate this vulnerability through any of the following operations:

Switch to UDP StatsD: Configure envoy.stat_sinks.statsd to use UDP instead of TCP. The UDP statsd flusher path utilizes safe, dynamic buffer appending and is not vulnerable to this heap buffer overflow.

Disable Method Cardinality Stats: Disable stats_for_all_methods on grpc_stats and avoid dynamic path-based or client-controlled metrics generation in your configuration.

References

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

CVE ID

CVE-2026-48706

Weaknesses

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. Learn more on MITRE.

Credits