summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraveen Kumar <praveen.kumar@windriver.com>2025-06-25 11:27:52 +0530
committerSteve Sakoman <steve@sakoman.com>2025-06-27 08:09:27 -0700
commit696457962724a51e786dc87cb1bf13f5a3bd0d3a (patch)
treeba2e7a7944aea8f11de9fbeacd8dc359e6b8ce04
parent9bc0069f8b3968250c4245c8a81b65fdacabfba5 (diff)
downloadpoky-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.inc1
-rw-r--r--meta/recipes-devtools/go/go-1.21/CVE-2025-4673.patch70
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"
67SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd" 68SRC_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 @@
1From b897e97c36cb62629a458bc681723ca733404e32 Mon Sep 17 00:00:00 2001
2From: Neal Patel <nealpatel@google.com>
3Date: Wed, 21 May 2025 14:11:44 -0400
4Subject: [PATCH] net/http: strip sensitive proxy headers from redirect
5 requests
6
7Similarly to Authentication entries, Proxy-Authentication entries should be stripped to ensure sensitive information is not leaked on redirects outside of the original domain.
8
9https://fetch.spec.whatwg.org/#authentication-entries
10
11Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue.
12
13Updates golang/go#73816
14Fixes golang/go#73905
15Fixes CVE-2025-4673
16
17Change-Id: I1615f31977a2fd014fbc12aae43f82692315a6d0
18Reviewed-on: https://go-review.googlesource.com/c/go/+/679255
19LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
20Reviewed-by: Michael Knyszek <mknyszek@google.com>
21
22CVE: CVE-2025-4673
23
24Upstream-Status: Backport [https://github.com/golang/go/commit/b897e97c36cb62629a458bc681723ca733404e32]
25
26Signed-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
32diff --git a/src/net/http/client.go b/src/net/http/client.go
33index 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) {
46diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go
47index 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--
702.40.0