|
| 1 | +From 201f31cfd144c43a8bc5a88ab25892ab7363c788 Mon Sep 17 00:00:00 2001 |
| 2 | +From: "Nicholas S. Husin" <nsh@golang.org> |
| 3 | +Date: Tue, 31 Mar 2026 15:15:30 -0400 |
| 4 | +Subject: [PATCH] http2: prevent hanging Transport due to bad SETTINGS frame |
| 5 | + |
| 6 | +This CL backports https://go.dev/cl/761581 to x/net. |
| 7 | + |
| 8 | +Fixes golang/go#78476 |
| 9 | +Fixes CVE-2026-33814 |
| 10 | + |
| 11 | +Change-Id: Ied435a51fdd8664d41dae14d082c39c76a6a6964 |
| 12 | +Reviewed-on: https://go-review.googlesource.com/c/net/+/761640 |
| 13 | +LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> |
| 14 | +Reviewed-by: Nicholas Husin <husin@google.com> |
| 15 | +Reviewed-by: Damien Neil <dneil@google.com> |
| 16 | +Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> |
| 17 | +Upstream-reference: https://github.com/golang/net/commit/1e71bd86e4a302b4e731bc06da6eb51679c7bd49.patch |
| 18 | +--- |
| 19 | + src/runtime/vendor/golang.org/x/net/http2/transport.go | 6 +++--- |
| 20 | + 1 file changed, 3 insertions(+), 3 deletions(-) |
| 21 | + |
| 22 | +diff --git a/src/runtime/vendor/golang.org/x/net/http2/transport.go b/src/runtime/vendor/golang.org/x/net/http2/transport.go |
| 23 | +index f26356b9..a401b27b 100644 |
| 24 | +--- a/src/runtime/vendor/golang.org/x/net/http2/transport.go |
| 25 | ++++ b/src/runtime/vendor/golang.org/x/net/http2/transport.go |
| 26 | +@@ -2858,6 +2858,9 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { |
| 27 | + |
| 28 | + var seenMaxConcurrentStreams bool |
| 29 | + err := f.ForeachSetting(func(s Setting) error { |
| 30 | ++ if err := s.Valid(); err != nil { |
| 31 | ++ return err |
| 32 | ++ } |
| 33 | + switch s.ID { |
| 34 | + case SettingMaxFrameSize: |
| 35 | + cc.maxFrameSize = s.Val |
| 36 | +@@ -2889,9 +2892,6 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { |
| 37 | + cc.henc.SetMaxDynamicTableSize(s.Val) |
| 38 | + cc.peerMaxHeaderTableSize = s.Val |
| 39 | + case SettingEnableConnectProtocol: |
| 40 | +- if err := s.Valid(); err != nil { |
| 41 | +- return err |
| 42 | +- } |
| 43 | + // If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL, |
| 44 | + // we require that it do so in the first SETTINGS frame. |
| 45 | + // |
| 46 | +-- |
| 47 | +2.45.4 |
| 48 | + |
0 commit comments