diff options
author | Praveen Kumar <praveen.kumar@windriver.com> | 2025-06-25 11:27:52 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-06-27 08:09:27 -0700 |
commit | 696457962724a51e786dc87cb1bf13f5a3bd0d3a (patch) | |
tree | ba2e7a7944aea8f11de9fbeacd8dc359e6b8ce04 | |
parent | 9bc0069f8b3968250c4245c8a81b65fdacabfba5 (diff) | |
download | poky-696457962724a51e786dc87cb1bf13f5a3bd0d3a.tar.gz |
go: fix CVE-2025-4673
Proxy-Authorization and Proxy-Authenticate headers persisted on
cross-origin redirects potentially leaking sensitive information.
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2025-4673
Upstream-patch:
https://github.com/golang/go/commit/b897e97c36cb62629a458bc681723ca733404e32
(From OE-Core rev: c07547c19e5372ed5eaac8530b2dd651302542a8)
Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-devtools/go/go-1.17.13.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-1.21/CVE-2025-4673.patch | 70 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.17.13.inc b/meta/recipes-devtools/go/go-1.17.13.inc index e54205d48c..033f770f64 100644 --- a/meta/recipes-devtools/go/go-1.17.13.inc +++ b/meta/recipes-devtools/go/go-1.17.13.inc | |||
@@ -63,6 +63,7 @@ SRC_URI += "\ | |||
63 | file://CVE-2024-34158.patch \ | 63 | file://CVE-2024-34158.patch \ |
64 | file://CVE-2024-45336.patch \ | 64 | file://CVE-2024-45336.patch \ |
65 | file://CVE-2025-22871.patch \ | 65 | file://CVE-2025-22871.patch \ |
66 | file://CVE-2025-4673.patch \ | ||
66 | " | 67 | " |
67 | SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd" | 68 | SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd" |
68 | 69 | ||
diff --git a/meta/recipes-devtools/go/go-1.21/CVE-2025-4673.patch b/meta/recipes-devtools/go/go-1.21/CVE-2025-4673.patch new file mode 100644 index 0000000000..62864f44ee --- /dev/null +++ b/meta/recipes-devtools/go/go-1.21/CVE-2025-4673.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From b897e97c36cb62629a458bc681723ca733404e32 Mon Sep 17 00:00:00 2001 | ||
2 | From: Neal Patel <nealpatel@google.com> | ||
3 | Date: Wed, 21 May 2025 14:11:44 -0400 | ||
4 | Subject: [PATCH] net/http: strip sensitive proxy headers from redirect | ||
5 | requests | ||
6 | |||
7 | Similarly to Authentication entries, Proxy-Authentication entries should be stripped to ensure sensitive information is not leaked on redirects outside of the original domain. | ||
8 | |||
9 | https://fetch.spec.whatwg.org/#authentication-entries | ||
10 | |||
11 | Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue. | ||
12 | |||
13 | Updates golang/go#73816 | ||
14 | Fixes golang/go#73905 | ||
15 | Fixes CVE-2025-4673 | ||
16 | |||
17 | Change-Id: I1615f31977a2fd014fbc12aae43f82692315a6d0 | ||
18 | Reviewed-on: https://go-review.googlesource.com/c/go/+/679255 | ||
19 | LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> | ||
20 | Reviewed-by: Michael Knyszek <mknyszek@google.com> | ||
21 | |||
22 | CVE: CVE-2025-4673 | ||
23 | |||
24 | Upstream-Status: Backport [https://github.com/golang/go/commit/b897e97c36cb62629a458bc681723ca733404e32] | ||
25 | |||
26 | Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com> | ||
27 | --- | ||
28 | src/net/http/client.go | 3 ++- | ||
29 | src/net/http/client_test.go | 5 ++++- | ||
30 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
31 | |||
32 | diff --git a/src/net/http/client.go b/src/net/http/client.go | ||
33 | index 13b6152..d1c9407 100644 | ||
34 | --- a/src/net/http/client.go | ||
35 | +++ b/src/net/http/client.go | ||
36 | @@ -806,7 +806,8 @@ func (c *Client) makeHeadersCopier(ireq *Request) func(req *Request, stripSensit | ||
37 | for k, vv := range ireqhdr { | ||
38 | sensitive := false | ||
39 | switch CanonicalHeaderKey(k) { | ||
40 | - case "Authorization", "Www-Authenticate", "Cookie", "Cookie2": | ||
41 | + case "Authorization", "Www-Authenticate", "Cookie", "Cookie2", | ||
42 | + "Proxy-Authorization", "Proxy-Authenticate": | ||
43 | sensitive = true | ||
44 | } | ||
45 | if !(sensitive && stripSensitiveHeaders) { | ||
46 | diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go | ||
47 | index 8bf1808..66ad370 100644 | ||
48 | --- a/src/net/http/client_test.go | ||
49 | +++ b/src/net/http/client_test.go | ||
50 | @@ -1562,7 +1562,9 @@ func testClientStripHeadersOnRepeatedRedirect(t *testing.T, mode testMode) { | ||
51 | if r.Host+r.URL.Path != "a.example.com/" { | ||
52 | if h := r.Header.Get("Authorization"); h != "" { | ||
53 | t.Errorf("on request to %v%v, Authorization=%q, want no header", r.Host, r.URL.Path, h) | ||
54 | - } | ||
55 | + } else if h := r.Header.Get("Proxy-Authorization"); h != "" { | ||
56 | + t.Errorf("on request to %v%v, Proxy-Authorization=%q, want no header", r.Host, r.URL.Path, h) | ||
57 | + } | ||
58 | } | ||
59 | // Follow a chain of redirects from a to b and back to a. | ||
60 | // The Authorization header is stripped on the first redirect to b, | ||
61 | @@ -1590,6 +1592,7 @@ func testClientStripHeadersOnRepeatedRedirect(t *testing.T, mode testMode) { | ||
62 | req, _ := NewRequest("GET", proto+"://a.example.com/", nil) | ||
63 | req.Header.Add("Cookie", "foo=bar") | ||
64 | req.Header.Add("Authorization", "secretpassword") | ||
65 | + req.Header.Add("Proxy-Authorization", "secretpassword") | ||
66 | res, err := c.Do(req) | ||
67 | if err != nil { | ||
68 | t.Fatal(err) | ||
69 | -- | ||
70 | 2.40.0 | ||