Skip to content

Commit 7c64a3d

Browse files
upgrade to latest dependencies (#811)
bumping knative.dev/pkg bd99f2f...56bfe0d: > 56bfe0d [release-1.11] [CVE-2023-44487] Disable http2 for webhooks (# 2875) Signed-off-by: Knative Automation <[email protected]>
1 parent da993e5 commit 7c64a3d

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
1313
knative.dev/hack v0.0.0-20230712131415-ddae80293c43
1414
knative.dev/hack/schema v0.0.0-20230712131415-ddae80293c43
15-
knative.dev/pkg v0.0.0-20231011193800-bd99f2f98be7
15+
knative.dev/pkg v0.0.0-20231023150739-56bfe0dd9626
1616
)
1717

1818
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ knative.dev/hack v0.0.0-20230712131415-ddae80293c43 h1:3SE06uNfSFGm/5XS+0trbyCUp
683683
knative.dev/hack v0.0.0-20230712131415-ddae80293c43/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
684684
knative.dev/hack/schema v0.0.0-20230712131415-ddae80293c43 h1:FqKKg9cUKc2I9bw27fbGkmTtI3CUiqrnMdbuXm+yPUc=
685685
knative.dev/hack/schema v0.0.0-20230712131415-ddae80293c43/go.mod h1:GeIb+PLd5mllawcpHEGF5J5fYTQrvgEO5liao8lUKUs=
686-
knative.dev/pkg v0.0.0-20231011193800-bd99f2f98be7 h1:y3qbfYX1SuSr/1ysXvKfpV8q/kCwWLWieCUgAhBUHmQ=
687-
knative.dev/pkg v0.0.0-20231011193800-bd99f2f98be7/go.mod h1:g+UCgSKQ2f15kHYu/V3CPtoKo5F1x/2Y1ot0NSK7gA0=
686+
knative.dev/pkg v0.0.0-20231023150739-56bfe0dd9626 h1:qFE+UDBRg6cpF5LbA0sv1XK4XZ36Z7aTRCa+HcuxnNQ=
687+
knative.dev/pkg v0.0.0-20231023150739-56bfe0dd9626/go.mod h1:g+UCgSKQ2f15kHYu/V3CPtoKo5F1x/2Y1ot0NSK7gA0=
688688
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
689689
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
690690
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

vendor/knative.dev/pkg/webhook/webhook.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ type Options struct {
7474
// ControllerOptions encapsulates options for creating a new controller,
7575
// including throttling and stats behavior.
7676
ControllerOptions *controller.ControllerOptions
77+
78+
// EnableHTTP2 enables HTTP2 for webhooks.
79+
// Mitigate CVE-2023-44487 by disabling HTTP2 by default until the Go
80+
// standard library and golang.org/x/net are fully fixed.
81+
// Right now, it is possible for authenticated and unauthenticated users to
82+
// hold open HTTP2 connections and consume huge amounts of memory.
83+
// See:
84+
// * https://github.com/kubernetes/kubernetes/pull/121120
85+
// * https://github.com/kubernetes/kubernetes/issues/121197
86+
// * https://github.com/golang/go/issues/63417#issuecomment-1758858612
87+
EnableHTTP2 bool
7788
}
7889

7990
// Operation is the verb being operated on
@@ -237,12 +248,19 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
237248
QuietPeriod: wh.Options.GracePeriod,
238249
}
239250

251+
// If TLSNextProto is not nil, HTTP/2 support is not enabled automatically.
252+
nextProto := map[string]func(*http.Server, *tls.Conn, http.Handler){}
253+
if wh.Options.EnableHTTP2 {
254+
nextProto = nil
255+
}
256+
240257
server := &http.Server{
241258
ErrorLog: log.New(&zapWrapper{logger}, "", 0),
242259
Handler: drainer,
243260
Addr: fmt.Sprint(":", wh.Options.Port),
244261
TLSConfig: wh.tlsConfig,
245262
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
263+
TLSNextProto: nextProto,
246264
}
247265

248266
var serve = server.ListenAndServe

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ knative.dev/hack/schema/commands
822822
knative.dev/hack/schema/docs
823823
knative.dev/hack/schema/registry
824824
knative.dev/hack/schema/schema
825-
# knative.dev/pkg v0.0.0-20231011193800-bd99f2f98be7
825+
# knative.dev/pkg v0.0.0-20231023150739-56bfe0dd9626
826826
## explicit; go 1.18
827827
knative.dev/pkg/apis
828828
knative.dev/pkg/apis/duck

0 commit comments

Comments
 (0)