GHSA-gpwf-4h98-v82q: High severity rust/datadog-opentelemetry vulnerability
Impact Datadog tracing libraries that implement W3C Trace Context (tracecontext) propagation parse the incoming tracestate header without enforcing a size cap on the Datadog vendor entry (dd=...). The dd= value contains semicolon-separated key:value pairs, and the parser allocates a hash-map entry for each pair. A remote, unauthenticated attacker can send a tracestate header whose dd= member is arbitrarily large (or contains an arbitrarily large number of pairs), forcing unbounded CPU and memory consumption per request and enabling a remote Denial of Service. tracecontext extraction is enabled by default in affected tracers, so any internet-facing service instrumented with an affected version is exposed unless tracecontext has been explicitly removed from the propagation style configuration.
Patches This is resolved in version 0.3.3 and later of the dd-trace-rs library.
Workarounds If you cannot upgrade immediately: 1. Disable tracecontext extraction by setting DDTRACEPROPAGATIONSTYLEEXTRACT to a value that does not include tracecontext (for example, datadog). 2. Cap the maximum HTTP request header size at an upstream proxy or web server.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/datadog-opentelemetryto a version that resolves this vulnerability.Fixed in 0.3.3 - Upgrade
Upgrade
dd-trace-rsto a version that resolves this vulnerability.Fixed in 0.3.3 - Configuration
Disable `tracecontext` extraction by setting `DD_TRACE_PROPAGATION_STYLE_EXTRACT` to a value that does not include `tracecontext` so the `tracestate` header is not parsed.
Datadog tracing libraries (W3C Trace Context propagation) DD_TRACE_PROPAGATION_STYLE_EXTRACT = A value that does not include `tracecontext` (e.g., `datadog`) - Compensating control
Cap the maximum HTTP request header size at an upstream proxy or web server to limit how large the incoming `tracestate` header can be.
- Compensating control
Ensure that `tracecontext` has been explicitly removed from the propagation style configuration for any internet-facing service instrumented with an affected Datadog tracer, since `tracecontext` extraction is enabled by default in affected tracers.
Event History
Frequently Asked Questions
Which deployments are exposed by default?
Internet-facing services instrumented with an affected tracer are exposed by default because tracecontext extraction is enabled unless it has been explicitly removed from the propagation style configuration.
What does an attacker need to exploit this issue?
An attacker only needs network access to send requests containing a crafted tracestate header. No authentication, privileges, or user interaction are required.
What can be done if upgrading is not immediately possible?
Remove tracecontext from DD_TRACE_PROPAGATION_STYLE_EXTRACT, for example by setting it to datadog. Also enforce a maximum HTTP request-header size at an upstream proxy or web server.
What version contains the fix?
The issue is resolved in dd-trace-rs version 0.3.3 and later.