Skip to content

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Oct 5, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 -> v0.44.0 age adoption passing confidence

Memory exhaustion in go.opentelemetry.io/contrib/instrumentation

CGA-h2vq-f2rf-jwrq / CVE-2023-45142 / GHSA-rcjv-mgp8-qvmr / GO-2023-2113

More information

Details

Memory exhaustion in go.opentelemetry.io/contrib/instrumentation

Severity

Unknown

References

This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).


OpenTelemetry-Go Contrib vulnerable to denial of service in otelhttp due to unbound cardinality metrics

CGA-h2vq-f2rf-jwrq / CVE-2023-45142 / GHSA-rcjv-mgp8-qvmr / GO-2023-2113

More information

Details

Summary

This handler wrapper https://github.com/open-telemetry/opentelemetry-go-contrib/blob/5f7e6ad5a49b45df45f61a1deb29d7f1158032df/instrumentation/net/http/otelhttp/handler.go#L63-L65
out of the box adds labels

  • http.user_agent
  • http.method

that have unbound cardinality. It leads to the server's potential memory exhaustion when many malicious requests are sent to it.

Details

HTTP header User-Agent or HTTP method for requests can be easily set by an attacker to be random and long. The library internally uses httpconv.ServerRequest that records every value for HTTP method and User-Agent.

PoC

Send many requests with long randomly generated HTTP methods or/and User agents (e.g. a million) and observe how memory consumption increases during it.

Impact

In order to be affected, the program has to configure a metrics pipeline, use otelhttp.NewHandler wrapper, and does not filter any unknown HTTP methods or User agents on the level of CDN, LB, previous middleware, etc.

Others

It is similar to already reported vulnerabilities

Workaround for affected versions

As a workaround to stop being affected otelhttp.WithFilter() can be used, but it requires manual careful configuration to not log certain requests entirely.

For convenience and safe usage of this library, it should by default mark with the label unknown non-standard HTTP methods and User agents to show that such requests were made but do not increase cardinality. In case someone wants to stay with the current behavior, library API should allow to enable it.

The other possibility is to disable HTTP metrics instrumentation by passing otelhttp.WithMeterProvider option with noop.NewMeterProvider.

Solution provided by upgrading

In PR https://github.com/open-telemetry/opentelemetry-go-contrib/pull/4277, released with package version 0.44.0, the values collected for attribute http.request.method were changed to be restricted to a set of well-known values and other high cardinality attributes were removed.

References

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

renovate bot and others added 2 commits October 5, 2024 23:30
* Add renovate.json

* Update renovate.json

Signed-off-by: Ying WANG <[email protected]>

* Rename renovate.json to renovate.json5

Signed-off-by: Ying WANG <[email protected]>

* Update renovate.json5

Signed-off-by: Ying WANG <[email protected]>

* Update renovate.json5

Signed-off-by: Ying WANG <[email protected]>

---------

Signed-off-by: Ying WANG <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
Copy link
Author

renovate bot commented Oct 5, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: tutorials/whatsup/go.sum
Command failed: go get -d -t ./...
go: -d flag is deprecated. -d=true is a no-op
go: downloading github.com/prometheus/client_golang v1.20.5
go: downloading github.com/bwplotka/tracing-go v0.0.0-20230421061608-abdf862ceccd
go: downloading github.com/efficientgo/core v1.0.0-rc.3
go: downloading github.com/oklog/run v1.1.0
go: downloading github.com/prometheus/common v0.61.0
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/efficientgo/e2e v0.14.1-0.20230421070206-d72d43f3b937
go: downloading github.com/efficientgo/tools/core v0.0.0-20220225185207-fe763185946b
go: downloading github.com/pkg/errors v0.9.1
go: downloading go.opentelemetry.io/otel v1.18.0
go: downloading go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.6.3
go: downloading go.opentelemetry.io/otel/sdk v1.6.3
go: downloading go.opentelemetry.io/otel/trace v1.18.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.6.3
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.6.3
go: downloading google.golang.org/grpc v1.56.3
go: downloading github.com/felixge/httpsnoop v1.0.3
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0
go: downloading github.com/json-iterator/go v1.1.12
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/client_model v0.6.1
go: downloading github.com/prometheus/procfs v0.15.1
go: downloading golang.org/x/sys v0.28.0
go: downloading google.golang.org/protobuf v1.35.2
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/klauspost/compress v1.17.9
go: downloading go.opentelemetry.io/proto/otlp v0.15.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3
go: downloading google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
go: downloading golang.org/x/net v0.32.0
go: downloading github.com/golang/protobuf v1.5.3
go: downloading go.opentelemetry.io/otel/metric v1.18.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
go: downloading github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
go: downloading golang.org/x/oauth2 v0.24.0
go: downloading github.com/go-logr/logr v1.2.4
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading github.com/cenkalti/backoff/v4 v4.1.2
go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0
go: downloading github.com/jpillora/backoff v1.0.0
go: downloading golang.org/x/text v0.21.0
go: downloading go.opentelemetry.io v0.1.0
go: downloading go.opentelemetry.io/otel/exporters/otlp v0.20.1
go: downloading go.opentelemetry.io/otel v1.35.0
go: github.com/prometheus/client_golang/tutorials/whatsup imports
	github.com/bwplotka/tracing-go/tracing/exporters/otlp imports
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc imports
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig imports
	go.opentelemetry.io/otel/exporters/otlp/internal: cannot find module providing package go.opentelemetry.io/otel/exporters/otlp/internal
go: github.com/prometheus/client_golang/tutorials/whatsup imports
	github.com/bwplotka/tracing-go/tracing/exporters/otlp imports
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc imports
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig imports
	go.opentelemetry.io/otel/exporters/otlp/internal/envconfig: cannot find module providing package go.opentelemetry.io/otel/exporters/otlp/internal/envconfig

@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from b89cb9a to 7eb464f Compare October 5, 2024 21:46
Signed-off-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
Signed-off-by: Ying WANG <[email protected]>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 7eb464f to bee1bb7 Compare October 5, 2024 22:07
Signed-off-by: Ying WANG <[email protected]>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from bee1bb7 to d5f1318 Compare October 5, 2024 22:10
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from d5f1318 to 78e0558 Compare October 17, 2024 05:50
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 78e0558 to 88c4bf7 Compare October 17, 2024 09:38
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 88c4bf7 to 95fd342 Compare October 17, 2024 14:45
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 95fd342 to d2e64f9 Compare October 21, 2024 04:07
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from d2e64f9 to 2be2f6b Compare October 21, 2024 07:24
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 2be2f6b to 96b1f87 Compare October 21, 2024 09:30
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 96b1f87 to 7a1d835 Compare October 28, 2024 04:07
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 7a1d835 to 8e17add Compare December 9, 2024 04:03
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 8e17add to 85e3578 Compare December 9, 2024 06:06
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 85e3578 to 8407e5e Compare December 9, 2024 09:45
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 8407e5e to 9b47656 Compare December 23, 2024 04:23
@renovate renovate bot changed the title chore(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to v0.44.0 [security] (main) chore(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to v0.44.0 [security] (main) - autoclosed Dec 27, 2024
@renovate renovate bot closed this Dec 27, 2024
@renovate renovate bot deleted the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch December 27, 2024 12:22
@renovate renovate bot changed the title chore(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to v0.44.0 [security] (main) - autoclosed chore(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to v0.44.0 [security] (main) Dec 27, 2024
@renovate renovate bot reopened this Dec 27, 2024
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from d6f0905 to 9b47656 Compare December 27, 2024 16:25
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 9b47656 to 79af8ba Compare December 30, 2024 03:56
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 79af8ba to 21f3136 Compare March 10, 2025 05:44
renovate bot added 2 commits March 10, 2025 10:59
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the deps-update/main-go-go.opentelemetry.io-contrib-instrumentation-net-http-otelhttp-vulnerability branch from 21f3136 to 0773d47 Compare March 10, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant