CVE-2023-45142
📋 TL;DR
OpenTelemetry-Go Contrib's otelhttp.NewHandler wrapper has unbound cardinality for HTTP method and User-Agent attributes, allowing attackers to send requests with random/long values to cause memory exhaustion. Affects programs using otelhttp.NewHandler without filtering unknown HTTP methods or User-Agents at CDN/LB/middleware levels.
💻 Affected Systems
- OpenTelemetry-Go Contrib
📦 What is this software?
Opentelemetry by Opentelemetry
⚠️ Risk & Real-World Impact
Worst Case
Complete server memory exhaustion leading to denial of service and potential system crash
Likely Case
Degraded performance and memory pressure from high-cardinality attribute collection
If Mitigated
Minimal impact with proper filtering or patched versions
🎯 Exploit Status
Simple HTTP request manipulation required, no authentication needed
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.44.0 and later
Vendor Advisory: https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh
Restart Required: Yes
Instructions:
1. Update OpenTelemetry-Go Contrib to version 0.44.0 or later
2. Update go.mod to require patched version
3. Rebuild and redeploy application
4. Restart affected services
🔧 Temporary Workarounds
Use otelhttp.WithFilter()
allManually configure filtering to restrict HTTP methods and User-Agents
// Example: otelhttp.NewHandler(handler, "handler-name", otelhttp.WithFilter(filterFunc))
🧯 If You Can't Patch
- Implement CDN/Load Balancer filtering for unknown HTTP methods and User-Agents
- Add middleware to sanitize or reject requests with suspicious User-Agent headers
🔍 How to Verify
Check if Vulnerable:
Check if using OpenTelemetry-Go Contrib <0.44.0 and otelhttp.NewHandler
Check Version:
go list -m go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
Verify Fix Applied:
Verify version is ≥0.44.0 and check that http.request.method uses restricted values
📡 Detection & Monitoring
Log Indicators:
- Unusual high memory usage patterns
- Multiple requests with random/long User-Agent strings
- HTTP methods outside standard set (GET, POST, PUT, etc.)
Network Indicators:
- High volume of requests with varying User-Agent headers
- Requests with non-standard HTTP methods
SIEM Query:
source="application_logs" AND ("http.user_agent" OR "http.method") AND (cardinality > threshold)
🔗 References
- https://github.com/advisories/GHSA-cg3q-j54f-5p7p
- https://github.com/open-telemetry/opentelemetry-go-contrib/blob/5f7e6ad5a49b45df45f61a1deb29d7f1158032df/instrumentation/net/http/otelhttp/handler.go#L63-L65
- https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4277
- https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.19.0
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-rcjv-mgp8-qvmr
- https://github.com/open-telemetry/opentelemetry-go/blob/38e1b499c3da3107694ad2660b3888eee9c8b896/semconv/internal/v2/http.go#L223
- https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2UTRJ54INZG3OC2FTAN6AFB2RYNY2GAD/
- https://github.com/advisories/GHSA-cg3q-j54f-5p7p
- https://github.com/open-telemetry/opentelemetry-go-contrib/blob/5f7e6ad5a49b45df45f61a1deb29d7f1158032df/instrumentation/net/http/otelhttp/handler.go#L63-L65
- https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4277
- https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.19.0
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-5r5m-65gx-7vrh
- https://github.com/open-telemetry/opentelemetry-go-contrib/security/advisories/GHSA-rcjv-mgp8-qvmr
- https://github.com/open-telemetry/opentelemetry-go/blob/38e1b499c3da3107694ad2660b3888eee9c8b896/semconv/internal/v2/http.go#L223
- https://github.com/open-telemetry/opentelemetry-go/blob/v1.12.0/semconv/internal/v2/http.go#L159
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2UTRJ54INZG3OC2FTAN6AFB2RYNY2GAD/