Skip to content

Commit f3d8dd9

Browse files
upgrade to latest dependencies (#812)
bumping knative.dev/pkg df28fea...0c39ce4: > 0c39ce4 Allow to disable http2 for the webhook (# 2877) Signed-off-by: Knative Automation <[email protected]>
1 parent bae7bf0 commit f3d8dd9

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-20220803162953-67bda5d908f1
1313
knative.dev/hack v0.0.0-20230417170854-f591fea109b3
1414
knative.dev/hack/schema v0.0.0-20230417170854-f591fea109b3
15-
knative.dev/pkg v0.0.0-20231011201526-df28feae6d34
15+
knative.dev/pkg v0.0.0-20231023160942-0c39ce4b3a7f
1616
)
1717

1818
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,8 @@ knative.dev/hack v0.0.0-20230417170854-f591fea109b3 h1:+W4WBOq83tfGXKhtv8OB/uJeY
816816
knative.dev/hack v0.0.0-20230417170854-f591fea109b3/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
817817
knative.dev/hack/schema v0.0.0-20230417170854-f591fea109b3 h1:TUHxKhNDLCX/XaqNaX9PY+247jEYD5aerg1woAhmEzw=
818818
knative.dev/hack/schema v0.0.0-20230417170854-f591fea109b3/go.mod h1:GeIb+PLd5mllawcpHEGF5J5fYTQrvgEO5liao8lUKUs=
819-
knative.dev/pkg v0.0.0-20231011201526-df28feae6d34 h1:H+K37bEBZ2STSWMjCgrdilj38KKZGVxBbob22K99Y50=
820-
knative.dev/pkg v0.0.0-20231011201526-df28feae6d34/go.mod h1:ZRgzFBFmdBsARm6+Pkr9WRG8bXys8rYq64ELfLG6+9w=
819+
knative.dev/pkg v0.0.0-20231023160942-0c39ce4b3a7f h1:XCH1qZqW1riR8cjhMGjewxQXlWPrfgxeUorBjpC6lE4=
820+
knative.dev/pkg v0.0.0-20231023160942-0c39ce4b3a7f/go.mod h1:ZRgzFBFmdBsARm6+Pkr9WRG8bXys8rYq64ELfLG6+9w=
821821
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
822822
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
823823
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
@@ -67,6 +67,17 @@ type Options struct {
6767
// GracePeriod is how long to wait after failing readiness probes
6868
// before shutting down.
6969
GracePeriod time.Duration
70+
71+
// EnableHTTP2 enables HTTP2 for webhooks.
72+
// Mitigate CVE-2023-44487 by disabling HTTP2 by default until the Go
73+
// standard library and golang.org/x/net are fully fixed.
74+
// Right now, it is possible for authenticated and unauthenticated users to
75+
// hold open HTTP2 connections and consume huge amounts of memory.
76+
// See:
77+
// * https://github.com/kubernetes/kubernetes/pull/121120
78+
// * https://github.com/kubernetes/kubernetes/issues/121197
79+
// * https://github.com/golang/go/issues/63417#issuecomment-1758858612
80+
EnableHTTP2 bool
7081
}
7182

7283
// Operation is the verb being operated on
@@ -219,11 +230,18 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
219230
QuietPeriod: wh.Options.GracePeriod,
220231
}
221232

233+
// If TLSNextProto is not nil, HTTP/2 support is not enabled automatically.
234+
nextProto := map[string]func(*http.Server, *tls.Conn, http.Handler){}
235+
if wh.Options.EnableHTTP2 {
236+
nextProto = nil
237+
}
238+
222239
server := &http.Server{
223240
Handler: drainer,
224241
Addr: fmt.Sprint(":", wh.Options.Port),
225242
TLSConfig: wh.tlsConfig,
226243
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
244+
TLSNextProto: nextProto,
227245
}
228246

229247
eg, ctx := errgroup.WithContext(ctx)

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ knative.dev/hack/schema/commands
823823
knative.dev/hack/schema/docs
824824
knative.dev/hack/schema/registry
825825
knative.dev/hack/schema/schema
826-
# knative.dev/pkg v0.0.0-20231011201526-df28feae6d34
826+
# knative.dev/pkg v0.0.0-20231023160942-0c39ce4b3a7f
827827
## explicit; go 1.18
828828
knative.dev/pkg/apis
829829
knative.dev/pkg/apis/duck

0 commit comments

Comments
 (0)