InfluxDB exporter: unbounded response buffering, up to 2 GiB per export
Description
OpenTelemetry.Exporter.InfluxDB does not configure an appropriate limit for HTTP response bodies received after writing metrics. In affected versions, the underlying HTTP client can buffer a response up to its default limit of approximately 2 GiB. Processing an error response can create additional copies of its contents as strings and exception messages.
An attacker who controls the configured InfluxDB server or its proxy, or who can modify responses on an unprotected network connection, can cause excessive memory consumption in the instrumented application. This can cause severe memory pressure and failed exports. In a memory-constrained deployment, the assessed worst-case consequence is denial of service to the host application.
The issue is fixed in OpenTelemetry.Exporter.InfluxDB 1.0.0-alpha.17.
Affected versions and configurations
- Package ecosystem: NuGet.
- Package:
OpenTelemetry.Exporter.InfluxDB. - Affected versions:
>= 1.0.0-alpha.1, < 1.0.0-alpha.17. - Patched version:
1.0.0-alpha.17. - Weakness: CWE-770, Allocation of Resources Without Limits or Throttling.
The application must use the InfluxDB metrics exporter and send at least one metric in a write request. Both supported metrics schemas use the affected HTTP client. The response is consumed during normal metric export; the default export interval in version 1.0.0-alpha.16 is 60 seconds.
The attacker must be able to supply the HTTP response to that write request. This requires control of the configured backend or a proxy, or a position on the network path where the connection's authentication and encryption do not prevent response modification. An on-path attacker cannot modify a correctly authenticated TLS connection merely by observing its traffic.
The attacker does not need credentials or code execution in the instrumented application. The application's InfluxDB write token authenticates the writer to the backend; it does not constrain the size of a response returned by the backend.
Security boundary and impact
The vulnerable system is the application process together with its in-process OpenTelemetry SDK and InfluxDB exporter. The attacker-controlled input is the body of an outbound write request's HTTP response. That input reaches memory allocation and error processing within the application process.
The security consequence is the responder's ability to impose excessive memory usage on the application. The sender can stream the response incrementally, while the application buffers it and may create additional string copies. Repeated exports can repeat the memory pressure. The demonstrated allocations are transient; there is no permanent memory leak.
This is an outbound-client response vulnerability. It does not depend on a properly authenticated client sending requests to an OpenTelemetry ingestion endpoint.
No confidentiality loss, modification of protected application data, or direct impact to a separate system has been demonstrated.
Technical details
In the last affected release, Exporter.InfluxDB-1.0.0-alpha.16, reviewed at commit b82f3c853bb16a241f1e1a34014b276f8d3c5c35:
AddInfluxDBMetricsExporterconstructsInfluxDBClientOptionsandInfluxDBClientwithout supplying a response-limitedHttpClient.InfluxDBMetricsExporter.Exportsends the metrics throughWriteApiAsync.WriteRecordsAsyncand waits for completion.- InfluxDB.Client 4.18.0 creates a RestSharp client whose write requests use buffered HTTP completion. RestSharp 112.0.0 passes the request to
HttpClient.SendAsync.
The body is buffered before the write's response status is processed. Both successful responses with content and error responses can therefore trigger the allocation. For an error response, decoding and exception-message handling can add to the memory already used by the response buffer.
The first exporter release, Exporter.InfluxDB-1.0.0-alpha.1, also constructs the client without a response limit. That release references InfluxDB.Client 4.12.0, whose RestSharp 110.1.0 dependency likewise uses HttpCompletionOption.ResponseContentRead for ordinary requests.
Existing limits
HttpClient.MaxResponseContentBufferSize has a default limit of approximately 2 GiB. This finite limit is much larger than the response required for a metrics write and can exceed the available memory of the application.
The default InfluxDB.Client request timeout in the reviewed dependency version is 10 seconds. It limits request duration, but a sufficiently fast response can consume substantial memory within that time. A constrained runtime heap limits the available memory, but can cause an allocation failure during export rather than preventing the attack.
Patches
Upgrade OpenTelemetry.Exporter.InfluxDB to 1.0.0-alpha.17 or later.
The fix configures a 1 MiB maximum buffered response size for InfluxDB writes. A response exceeding the limit causes the export to fail through the existing exporter error-handling path. It also ensures the supplied HTTP client is disposed with the exporter.
Implementation: opentelemetry-dotnet-contrib#5861.
Workarounds
Until the patched package is deployed:
- Use HTTPS with server certificate validation to protect responses against network modification, and restrict the configured backend and proxy to trusted infrastructure. These controls do not prevent oversized responses from a compromised or malfunctioning backend.
- Place a trusted intermediary between the exporter and backend that enforces an upstream response-body size limit before forwarding the response.
- Disable the InfluxDB exporter if the response source cannot be sufficiently protected or bounded.
Increasing application memory or shortening the export timeout does not impose a response-size limit.
CVSS v4.0
CVSS-B: 8.2 (High)
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N- AV:N: The response can arrive from a configured remote HTTP endpoint.
- AC:L: Once the attacker can supply the response, sending an oversized body requires no mitigation bypass or race condition.
- AT:P: The attacker must obtain the ability to supply a response from the configured backend or its proxy, or inject a response from an on-path position. This prerequisite is distinct from merely selecting a nondefault exporter configuration.
- PR:N: No privileges in the vulnerable application are needed to supply the malicious backend response.
- UI:N: Metric exports occur automatically; exploitation requires no action by another human user.
- VC:N: No loss of application confidentiality has been established.
- VI:N: No modification of protected application data has been established.
- VA:H: The assessed worst-case deployment is memory-constrained, and the induced allocations can deny service by the host application. Complete host unavailability is a severity-assessment assumption; the observed results and their limits are stated above.
- SC:N: No confidentiality impact outside the vulnerable application system has been established.
- SI:N: No integrity impact outside the vulnerable application system has been established.
- SA:N: No direct availability impact to a separate system has been established. The in-process SDK and exporter are included in the vulnerable system, together with the application.
References and credit
- Reported by Anthropic's OSS Scanner as ANT-2026-CEMWJRGP.
- Fix PR.
- HttpClient response buffer limit.
- OpenTelemetry security response guidelines.
- CVSS v4.0 specification.