OpenTelemetry.Sampler.AWS reads unbounded HTTP response bodies from a configured AWS X-Ray remote sampling endpoint into memory.
OpenTelemetry.Resources.AWS reads unbounded HTTP response bodies from a configured AWS EC2/ECS/EKS remote instance metadata service endpoint into memory.
Both of these would allow an attacker-controlled endpoint or be acting as a Man-in-the-Middle (MitM) to cause excessive memory allocation and possible process termination (via Out of Memory (OOM)).
AWSXRaySamplerClient.DoRequestAsync called HttpClient.SendAsync followed by ReadAsStringAsync(), which materializes the entire HTTP response body into a single in-memory string with no size limit. The sampling endpoint is configurable via AWSXRayRemoteSamplerBuilder.SetEndpoint (default: http://localhost:2000).
An attacker who controls the configured endpoint, or who can intercept traffic to it (MitM), can return an arbitrarily large response body. This causes unbounded heap allocation in the consuming process, leading to high transient memory pressure, garbage-collection stalls, or an OutOfMemoryException that terminates the process.
The AWSEC2Detector, AWSECSDetector and AWSEKSDetector classes all make HTTP requests to the relevant AWS metadata service (http://169.254.169.254, ECS_CONTAINER_METADATA_URI/ECS_CONTAINER_METADATA_URI_V4 or https://kubernetes.default.svc respectively) to obtain metadata about the running process and its infrastructure.
An attacker who controls the configured endpoint(s), or who can intercept traffic to them (MiTM), can return an arbitrarily large response body. This causes unbounded heap allocation in the consuming process, leading to high transient memory pressure, garbage-collection stalls, or an OutOfMemoryException that terminates the process.
Denial of Service (DoS). An attacker can destabilize or crash the application by forcing unbounded memory allocation through the X-Ray sampling and/or EC2/ECS/EKS HTTP response paths.
http://localhost:2000, which limits remote exposure in default configurations.Fixed in OpenTelemetry.Sampler.AWS version 0.1.0-alpha.8 and OpenTelemetry.Resources.AWS version 1.15.1.
The fixes (#4100, #4122) introduce changes that introduce limits to HttpClient requests so that the response body is streamed rather than buffered entirely in memory.
http://localhost:2000 by default) is not accessible to untrusted parties.{
"github_reviewed": true,
"github_reviewed_at": "2026-04-23T21:44:31Z",
"cwe_ids": [
"CWE-770"
],
"severity": "MODERATE",
"nvd_published_at": "2026-04-23T19:17:29Z"
}