Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit cab110e

Browse files
Disable HTTP/2 by Default for Webhooks to Mitigate CVE Risks (#484)
Ensure HTTP/2 is disabled by default for webhooks. Disabling HTTP/2 mitigates vulnerabilities associated with: - HTTP/2 Stream Cancellation (GHSA-qppj-fm5r-hxr3) - HTTP/2 Rapid Reset (GHSA-4374-p667-p6c8) While CVE fixes exist, they remain insufficient; disabling HTTP/2 helps reduce risks. For details, see: kubernetes/kubernetes#121197
1 parent 4590ca5 commit cab110e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cmd/manager/main.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,22 @@ func main() {
159159
log.Fatalf("Failed to initialize certificate watcher: %v", err)
160160
}
161161

162+
tlsOpts := func(config *tls.Config) {
163+
config.GetCertificate = cw.GetCertificate
164+
// Ensure HTTP/2 is disabled by default for webhooks. Disabling HTTP/2 mitigates vulnerabilities associated with:
165+
// - HTTP/2 Stream Cancellation (GHSA-qppj-fm5r-hxr3)
166+
// - HTTP/2 Rapid Reset (GHSA-4374-p667-p6c8)
167+
// While CVE fixes exist, they remain insufficient; disabling HTTP/2 helps reduce risks.
168+
// For details, see: https://github.com/kubernetes/kubernetes/issues/121197
169+
setupLog.Info("disabling http/2")
170+
config.NextProtos = []string{"http/1.1"}
171+
}
172+
162173
// Create webhook server and configure TLS
163174
webhookServer := crwebhook.NewServer(crwebhook.Options{
164175
Port: webhookPort,
165176
TLSOpts: []func(*tls.Config){
166-
func(cfg *tls.Config) {
167-
cfg.GetCertificate = cw.GetCertificate
168-
},
177+
tlsOpts,
169178
},
170179
})
171180

0 commit comments

Comments
 (0)