Skip to content

Commit 2659cc3

Browse files
upgrade to latest dependencies (#14555)
bumping knative.dev/pkg 283df0b...29775d7: > 29775d7 [release-1.12] [CVE-2023-44487] Disable http2 for webhooks (# 2876) > d6ab729 upgrade to latest dependencies (# 2870) bumping knative.dev/hack fc76874...2c938d4: > 2c938d4 Update community files (# 337) bumping knative.dev/networking c086340...2a7676e: > 2a7676e upgrade to latest dependencies (# 883) > b6cd712 upgrade to latest dependencies (# 882) > 64434a8 upgrade to latest dependencies (# 881) > fa72cb5 Update community files (# 880) bumping knative.dev/caching 8551914...54d0758: > 54d0758 upgrade to latest dependencies (# 802) > 104a7ba upgrade to latest dependencies (# 801) > 31d2498 upgrade to latest dependencies (# 800) > debd68e Update community files (# 799) Signed-off-by: Knative Automation <[email protected]> Co-authored-by: Dave Protasowski <[email protected]>
1 parent 2a46d0d commit 2659cc3

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
knative.dev/caching v0.0.0-20231017130712-54d0758671ef
3636
knative.dev/hack v0.0.0-20231016131700-2c938d4918da
3737
knative.dev/networking v0.0.0-20231017124814-2a7676e912b7
38-
knative.dev/pkg v0.0.0-20231017113806-d6ab72900ea5
38+
knative.dev/pkg v0.0.0-20231023151236-29775d7c9e5c
3939
sigs.k8s.io/yaml v1.3.0
4040
)
4141

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,8 @@ knative.dev/hack v0.0.0-20231016131700-2c938d4918da h1:xy+fvuz2LDOMsZ5UwXRaMF70N
931931
knative.dev/hack v0.0.0-20231016131700-2c938d4918da/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
932932
knative.dev/networking v0.0.0-20231017124814-2a7676e912b7 h1:6+1icZuxiZO1paFZ4d/ysKWVG2M4WB7OxNJNyLG0P/E=
933933
knative.dev/networking v0.0.0-20231017124814-2a7676e912b7/go.mod h1:1gcHoIVG47ekQWjkddqRq+/7tWRh+CB9W4k/NAcdRbk=
934-
knative.dev/pkg v0.0.0-20231017113806-d6ab72900ea5 h1:9AvFZdEtuwKWDcTV1VSwmrgrRR9f38wbIAm+sNwLivQ=
935-
knative.dev/pkg v0.0.0-20231017113806-d6ab72900ea5/go.mod h1:HHRXEd7ZlFpthgE+rwAZ6MUVnuJOAeolnaFSthXloUQ=
934+
knative.dev/pkg v0.0.0-20231023151236-29775d7c9e5c h1:xyPoEToTWeBdn6tinhLxXfnhJhTNQt5WzHiTNiFphRw=
935+
knative.dev/pkg v0.0.0-20231023151236-29775d7c9e5c/go.mod h1:HHRXEd7ZlFpthgE+rwAZ6MUVnuJOAeolnaFSthXloUQ=
936936
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
937937
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
938938
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=

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

+18
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ type Options struct {
8181
// ControllerOptions encapsulates options for creating a new controller,
8282
// including throttling and stats behavior.
8383
ControllerOptions *controller.ControllerOptions
84+
85+
// EnableHTTP2 enables HTTP2 for webhooks.
86+
// Mitigate CVE-2023-44487 by disabling HTTP2 by default until the Go
87+
// standard library and golang.org/x/net are fully fixed.
88+
// Right now, it is possible for authenticated and unauthenticated users to
89+
// hold open HTTP2 connections and consume huge amounts of memory.
90+
// See:
91+
// * https://github.com/kubernetes/kubernetes/pull/121120
92+
// * https://github.com/kubernetes/kubernetes/issues/121197
93+
// * https://github.com/golang/go/issues/63417#issuecomment-1758858612
94+
EnableHTTP2 bool
8495
}
8596

8697
// Operation is the verb being operated on
@@ -245,12 +256,19 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
245256
QuietPeriod: wh.Options.GracePeriod,
246257
}
247258

259+
// If TLSNextProto is not nil, HTTP/2 support is not enabled automatically.
260+
nextProto := map[string]func(*http.Server, *tls.Conn, http.Handler){}
261+
if wh.Options.EnableHTTP2 {
262+
nextProto = nil
263+
}
264+
248265
server := &http.Server{
249266
ErrorLog: log.New(&zapWrapper{logger}, "", 0),
250267
Handler: drainer,
251268
Addr: fmt.Sprint(":", wh.Options.Port),
252269
TLSConfig: wh.tlsConfig,
253270
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
271+
TLSNextProto: nextProto,
254272
}
255273

256274
var serve = server.ListenAndServe

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ knative.dev/networking/pkg/http/stats
13401340
knative.dev/networking/pkg/ingress
13411341
knative.dev/networking/pkg/k8s
13421342
knative.dev/networking/pkg/prober
1343-
# knative.dev/pkg v0.0.0-20231017113806-d6ab72900ea5
1343+
# knative.dev/pkg v0.0.0-20231023151236-29775d7c9e5c
13441344
## explicit; go 1.18
13451345
knative.dev/pkg/apiextensions/storageversion
13461346
knative.dev/pkg/apiextensions/storageversion/cmd/migrate

0 commit comments

Comments
 (0)