Go SDK for CloudEvents's use of WithRoundTripper to create a Client leaks credentials
Description
Go SDK for CloudEvents is the official CloudEvents SDK to integrate applications with CloudEvents. Prior to version 2.15.2, using cloudevents.WithRoundTripper to create a cloudevents.Client with an authenticated http.RoundTripper causes the go-sdk to leak credentials to arbitrary endpoints. When the transport is populated with an authenticated transport, then http.DefaultClient is modified with the authenticated transport and will start to send Authorization tokens to any endpoint it is used to contact. Version 2.15.2 patches this issue.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
CloudEvents Go SDK versions before 2.15.2 leak authentication credentials to arbitrary endpoints when using WithRoundTripper.
Vulnerability
The CloudEvents Go SDK prior to version 2.15.2 contained a credential leakage vulnerability when using cloudevents.WithRoundTripper to create a client with an authenticated http.RoundTripper. The root cause lies in the code at [2] where if p.Client is nil, it is set to http.DefaultClient. If a round tripper is provided, it modifies the transport of http.DefaultClient, causing the credentials to be used for all requests made by the default client [3].
Exploitation
An attacker can exploit this by tricking the application into making a request to an attacker-controlled endpoint using http.DefaultClient after the authenticated transport has been set. Since the default client is shared globally, any subsequent HTTP request using the default client will include the authorization credentials [3].
Impact
Successful exploitation leads to leakage of authentication tokens (e.g., OAuth2 tokens) to arbitrary endpoints. This could allow an attacker to access protected resources as the victim application, potentially compromising cloud services or other APIs [3].
Mitigation
The vulnerability is fixed in version 2.15.2 of the Go SDK, where the client creation was changed to use a new http.Client{} instead of http.DefaultClient [4]. Users are advised to update immediately. No workarounds are available except avoiding the use of WithRoundTripper with authenticated transports [3].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/cloudevents/sdk-go/v2Go | < 2.15.2 | 2.15.2 |
Affected products
49- osv-coords48 versionspkg:apk/chainguard/falcosidekickpkg:apk/chainguard/falcosidekick-fipspkg:apk/chainguard/guacpkg:apk/chainguard/guaccsubpkg:apk/chainguard/guacgqlpkg:apk/chainguard/guacingestpkg:apk/chainguard/guaconepkg:apk/chainguard/kedapkg:apk/chainguard/keda-adapterpkg:apk/chainguard/keda-adapter-fipspkg:apk/chainguard/keda-admission-webhookspkg:apk/chainguard/keda-admission-webhooks-fipspkg:apk/chainguard/keda-compatpkg:apk/chainguard/keda-fipspkg:apk/chainguard/keda-metrics-apiserver-fipspkg:apk/chainguard/tekton-pipelinespkg:apk/chainguard/tekton-pipelines-entrypointpkg:apk/chainguard/tekton-pipelines-eventspkg:apk/chainguard/tekton-pipelines-noppkg:apk/chainguard/tekton-pipelines-resolverspkg:apk/chainguard/tekton-pipelines-sidecarlogresultspkg:apk/chainguard/tekton-pipelines-webhookpkg:apk/chainguard/tekton-pipelines-workingdirinitpkg:apk/chainguard/telegraf-1.27pkg:apk/chainguard/telegraf-1.28pkg:apk/chainguard/telegraf-1.29pkg:apk/wolfi/falcosidekickpkg:apk/wolfi/guacpkg:apk/wolfi/guaccsubpkg:apk/wolfi/guacgqlpkg:apk/wolfi/guacingestpkg:apk/wolfi/guaconepkg:apk/wolfi/kedapkg:apk/wolfi/keda-adapterpkg:apk/wolfi/keda-admission-webhookspkg:apk/wolfi/keda-compatpkg:apk/wolfi/tekton-pipelinespkg:apk/wolfi/tekton-pipelines-entrypointpkg:apk/wolfi/tekton-pipelines-eventspkg:apk/wolfi/tekton-pipelines-noppkg:apk/wolfi/tekton-pipelines-resolverspkg:apk/wolfi/tekton-pipelines-sidecarlogresultspkg:apk/wolfi/tekton-pipelines-webhookpkg:apk/wolfi/tekton-pipelines-workingdirinitpkg:apk/wolfi/telegraf-1.27pkg:apk/wolfi/telegraf-1.28pkg:apk/wolfi/telegraf-1.29pkg:golang/github.com/cloudevents/sdk-go/v2
< 2.28.0-r2+ 47 more
- (no CPE)range: < 2.28.0-r2
- (no CPE)range: < 2.28.0-r2
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.16.1-r8
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.16.1-r8
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.16.1-r8
- (no CPE)range: < 2.16.1-r8
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 1.27.4-r13
- (no CPE)range: < 1.28.5-r6
- (no CPE)range: < 1.29.5-r2
- (no CPE)range: < 2.28.0-r2
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 0.5.1-r0
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 2.13.1-r1
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 0.57.0-r0
- (no CPE)range: < 1.27.4-r13
- (no CPE)range: < 1.28.5-r6
- (no CPE)range: < 1.29.5-r2
- (no CPE)range: < 2.15.2
- cloudevents/sdk-gov5Range: < 2.15.2
Patches
1de2f28370b0dMerge pull request from GHSA-5pf6-2qwx-pxm2
1 file changed · +4 −1
v2/protocol/http/protocol.go+4 −1 modified@@ -102,7 +102,10 @@ func New(opts ...Option) (*Protocol, error) { } if p.Client == nil { - p.Client = http.DefaultClient + // This is how http.DefaultClient is initialized. We do not just use + // that because when WithRoundTripper is used, it will change the client's + // transport, which would cause that transport to be used process-wide. + p.Client = &http.Client{} } if p.roundTripper != nil {
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-5pf6-2qwx-pxm2ghsaADVISORY
- github.com/cloudevents/sdk-go/blob/67e389964131d55d65cd14b4eb32d57a47312695/v2/protocol/http/protocol.goghsax_refsource_MISCWEB
- github.com/cloudevents/sdk-go/commit/de2f28370b0d2a0f64f92c0c6139fa4b8a7c3851ghsax_refsource_MISCWEB
- github.com/cloudevents/sdk-go/security/advisories/GHSA-5pf6-2qwx-pxm2ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.