{"id":"CVE-2026-41173","aliases":["CVE-2026-41173","GHSA-28xm-prxc-5866"],"related":[],"kind":"vulnerability","state":"published","title":"Unbounded HTTP response body read in OpenTelemetry.Sampler.AWS","summary":"The AWS X-Ray Remote Sampler package provides a sampler which can get sampling configurations from AWS X-Ray. Prior to 0.1.0-alpha.8, OpenTelemetry.Sampler.AWS reads unbounded HTTP response bodies from a configured AWS X-Ray remote sampling endpoint into memory.  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. This vulnerability is fixed in 0.1.0-alpha.8.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The AWS X-Ray Remote Sampler package provides a sampler which can get sampling configurations from AWS X-Ray. Prior to 0.1.0-alpha.8, OpenTelemetry.Sampler.AWS reads unbounded HTTP response bodies from a configured AWS X-Ray remote sampling endpoint into memory.  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. This vulnerability is fixed in 0.1.0-alpha.8.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`OpenTelemetry.Sampler.AWS` reads unbounded HTTP response bodies from a configured AWS X-Ray remote sampling endpoint into memory.\n\n`OpenTelemetry.Resources.AWS` reads unbounded HTTP response bodies from a configured AWS EC2/ECS/EKS remote instance metadata service endpoint into memory.\n\nBoth 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)).\n\n### Details\n\n#### OpenTelemetry.Sampler.AWS\n\n`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`).\n\nAn 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.\n\n#### OpenTelemetry.Resources.AWS\n\nThe [`AWSEC2Detector`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/171c6b81f88831641b56b470e6f92862e605013d/src/OpenTelemetry.Resources.AWS/AWSEC2Detector.cs), [`AWSECSDetector`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/171c6b81f88831641b56b470e6f92862e605013d/src/OpenTelemetry.Resources.AWS/AWSECSDetector.cs) and [`AWSEKSDetector`](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/171c6b81f88831641b56b470e6f92862e605013d/src/OpenTelemetry.Resources.AWS/AWSEKSDetector.cs) 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.\n\nAn 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.\n\n### Impact\n\nDenial 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.\n\n### Mitigating Factors\n\n- The default X-Ray sampling endpoint is `http://localhost:2000`, which limits remote exposure in default configurations.\n- Risk increases materially when operators configure the sampler to point at a remote or untrusted endpoint.\n\n### Patches\n\nFixed in `OpenTelemetry.Sampler.AWS` version `0.1.0-alpha.8` and `OpenTelemetry.Resources.AWS` version `1.15.1`.\n\nThe fixes (#4100, #4122) introduce changes that introduce limits to `HttpClient` requests so that the response body is streamed rather than buffered entirely in memory.\n\n### Workarounds\n\n- Ensure the X-Ray sampling endpoint (`http://localhost:2000` by default) is not accessible to untrusted parties.\n- Use network-level controls (firewall rules, mTLS, service mesh) to prevent Man-in-the-Middle (MitM) attacks on the sampling endpoint and/or EC2/ECS/EKS connection.\n- If using a remote endpoint, place it behind a reverse proxy that enforces a response body size limit.","format":"markdown","source":"ghsa"},{"lang":"es","text":"El paquete AWS X-Ray Remote Sampler proporciona un muestreador que puede obtener configuraciones de muestreo de AWS X-Ray. Antes de la versión 0.1.0-alpha.8, OpenTelemetry.Sampler.AWS lee cuerpos de respuesta HTTP ilimitados de un punto final de muestreo remoto de AWS X-Ray configurado en la memoria. AWSXRaySamplerClient.DoRequestAsync llamaba a HttpClient.SendAsync seguido de ReadAsStringAsync(), lo que materializa el cuerpo completo de la respuesta HTTP en una única cadena en memoria sin límite de tamaño. El punto final de muestreo es configurable a través de AWSXRayRemoteSamplerBuilder.SetEndpoint (predeterminado: http://localhost:2000). Un atacante que controla el punto final configurado, o que puede interceptar el tráfico hacia él (MitM), puede devolver un cuerpo de respuesta arbitrariamente grande. Esto causa una asignación de pila ilimitada en el proceso consumidor, lo que lleva a una alta presión de memoria transitoria, bloqueos de la recolección de basura o una OutOfMemoryException que termina el proceso. Esta vulnerabilidad se corrige en la versión 0.1.0-alpha.8.","source":"nvd"}],"published":"2026-04-23T18:22:31.771Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 0.1.0-alpha.8","status":"affected"}],"vendor":"open-telemetry","product":"opentelemetry-dotnet-contrib","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.0-alpha.8"}],"ecosystem":"NuGet","package":"OpenTelemetry.Sampler.AWS","purl":"pkg:nuget/OpenTelemetry.Sampler.AWS","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.1"}],"ecosystem":"NuGet","package":"OpenTelemetry.Resources.AWS","purl":"pkg:nuget/OpenTelemetry.Resources.AWS","source":"ghsa"}],"references":[{"url":"https://github.com/open-telemetry/opentelemetry-dotnet-contrib/security/advisories/GHSA-28xm-prxc-5866","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4100","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41173","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4122","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/open-telemetry/opentelemetry-dotnet-contrib","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-23T19:11:43.914Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41173","url":"https://www.cve.org/CVERecord?id=CVE-2026-41173","licence":"CVE Terms of Use","modified":"2026-04-23T19:16:04.096Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-28xm-prxc-5866","url":"https://github.com/advisories/GHSA-28xm-prxc-5866","licence":"CC-BY-4.0","modified":"2026-04-23T22:11:25.407Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41173","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41173","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:19.406Z","epss":{"score":0.00313,"percentile":0.26128,"date":"2026-12-01T12:00:22.000Z"}}