Skip to content

Commit d0914ed

Browse files
authored
January 2025 2.0 release merge (#11663)
2 parents 68eabe7 + d2731c4 commit d0914ed

28 files changed

+3383
-48
lines changed
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
https://github.com/golang/crypto/commit/b4f1988a35dee11ec3e05d6bf3e90b695fbd8909.patch
2+
3+
From b4f1988a35dee11ec3e05d6bf3e90b695fbd8909 Mon Sep 17 00:00:00 2001
4+
From: Roland Shoemaker <[email protected]>
5+
Date: Tue, 3 Dec 2024 09:03:03 -0800
6+
Subject: [PATCH] ssh: make the public key cache a 1-entry FIFO cache
7+
8+
Users of the the ssh package seem to extremely commonly misuse the
9+
PublicKeyCallback API, assuming that the key passed in the last call
10+
before a connection is established is the key used for authentication.
11+
Some users then make authorization decisions based on this key. This
12+
property is not documented, and may not be correct, due to the caching
13+
behavior of the package, resulting in users making incorrect
14+
authorization decisions about the connection.
15+
16+
This change makes the cache a one entry FIFO cache, making the assumed
17+
property, that the last call to PublicKeyCallback represents the key
18+
actually used for authentication, actually hold.
19+
20+
Thanks to Damien Tournoud, Patrick Dawkins, Vince Parker, and
21+
Jules Duvivier from the Platform.sh / Upsun engineering team
22+
for reporting this issue.
23+
24+
Fixes golang/go#70779
25+
Fixes CVE-2024-45337
26+
27+
Change-Id: Ife7c7b4045d8b6bcd7e3a417bdfae370c709797f
28+
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/635315
29+
Reviewed-by: Roland Shoemaker <[email protected]>
30+
Auto-Submit: Gopher Robot <[email protected]>
31+
Reviewed-by: Damien Neil <[email protected]>
32+
Reviewed-by: Nicola Murino <[email protected]>
33+
LUCI-TryBot-Result: Go LUCI <[email protected]>
34+
---
35+
vendor/golang.org/x/crypto/ssh/server.go | 15 ++++++++++----
36+
37+
diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go
38+
index c0d1c29e6f..5b5ccd96f4 100644
39+
--- a/vendor/golang.org/x/crypto/ssh/server.go
40+
+++ b/vendor/golang.org/x/crypto/ssh/server.go
41+
@@ -149,7 +149,7 @@ func (s *ServerConfig) AddHostKey(key Signer) {
42+
}
43+
44+
// cachedPubKey contains the results of querying whether a public key is
45+
-// acceptable for a user.
46+
+// acceptable for a user. This is a FIFO cache.
47+
type cachedPubKey struct {
48+
user string
49+
pubKeyData []byte
50+
@@ -157,7 +157,13 @@ type cachedPubKey struct {
51+
perms *Permissions
52+
}
53+
54+
-const maxCachedPubKeys = 16
55+
+// maxCachedPubKeys is the number of cache entries we store.
56+
+//
57+
+// Due to consistent misuse of the PublicKeyCallback API, we have reduced this
58+
+// to 1, such that the only key in the cache is the most recently seen one. This
59+
+// forces the behavior that the last call to PublicKeyCallback will always be
60+
+// with the key that is used for authentication.
61+
+const maxCachedPubKeys = 1
62+
63+
// pubKeyCache caches tests for public keys. Since SSH clients
64+
// will query whether a public key is acceptable before attempting to
65+
@@ -179,9 +185,10 @@ func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) {
66+
67+
// add adds the given tuple to the cache.
68+
func (c *pubKeyCache) add(candidate cachedPubKey) {
69+
- if len(c.keys) < maxCachedPubKeys {
70+
- c.keys = append(c.keys, candidate)
71+
+ if len(c.keys) >= maxCachedPubKeys {
72+
+ c.keys = c.keys[1:]
73+
}
74+
+ c.keys = append(c.keys, candidate)
75+
}
76+
77+
// ServerConn is an authenticated SSH connection, as seen from the

SPECS/cert-manager/cert-manager.spec

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Automatically provision and manage TLS certificates in Kubernetes
22
Name: cert-manager
33
Version: 1.11.2
4-
Release: 15%{?dist}
4+
Release: 16%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -28,6 +28,7 @@ Patch5: CVE-2023-3978.patch
2828
Patch6: CVE-2024-24786.patch
2929
Patch7: CVE-2024-28180.patch
3030
Patch8: CVE-2023-2253.patch
31+
Patch9: CVE-2024-45337.patch
3132
BuildRequires: golang
3233
Requires: %{name}-acmesolver
3334
Requires: %{name}-cainjector
@@ -120,6 +121,9 @@ install -D -m0755 bin/webhook %{buildroot}%{_bindir}/
120121
%{_bindir}/webhook
121122

122123
%changelog
124+
* Tue Dec 17 2024 Andrew Phelps <[email protected]> - 1.11.2-16
125+
- Add patch for CVE-2024-45337
126+
123127
* Mon Sep 09 2024 CBL-Mariner Servicing Account <[email protected]> - 1.11.2-15
124128
- Bump release to rebuild with go 1.22.7
125129

SPECS/coredns/CVE-2024-24786.patch

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 867d49d8c566b0f1284f8295ba1286d6c5e93edf Mon Sep 17 00:00:00 2001
2+
From: kavyasree <[email protected]>
3+
Date: Mon, 9 Dec 2024 17:03:26 +0530
4+
Subject: [PATCH] Modified patch
5+
6+
---
7+
.../protobuf/encoding/protojson/well_known_types.go | 4 ++++
8+
.../protobuf/internal/encoding/json/decode.go | 2 +-
9+
2 files changed, 5 insertions(+), 1 deletion(-)
10+
11+
diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
12+
index c85f846..634ba41 100644
13+
--- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
14+
+++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
15+
@@ -348,6 +348,10 @@ func (d decoder) skipJSONValue() error {
16+
}
17+
}
18+
}
19+
+ case json.EOF:
20+
+ // This can only happen if there's a bug in Decoder.Read.
21+
+ // Avoid an infinite loop if this does happen.
22+
+ return errors.New("unexpected EOF")
23+
}
24+
return nil
25+
}
26+
diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
27+
index b13fd29..b2be4e8 100644
28+
--- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
29+
+++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
30+
@@ -121,7 +121,7 @@ func (d *Decoder) Read() (Token, error) {
31+
32+
case ObjectClose:
33+
if len(d.openStack) == 0 ||
34+
- d.lastToken.kind == comma ||
35+
+ d.lastToken.kind&(Name|comma) != 0 ||
36+
d.openStack[len(d.openStack)-1] != ObjectOpen {
37+
return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString())
38+
}
39+
--
40+
2.34.1
41+

SPECS/coredns/coredns.spec

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Fast and flexible DNS server
44
Name: coredns
55
Version: 1.11.1
6-
Release: 11%{?dist}
6+
Release: 12%{?dist}
77
License: Apache License 2.0
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -36,6 +36,7 @@ Patch2: CVE-2023-49295.patch
3636
Patch3: CVE-2024-22189.patch
3737
Patch4: CVE-2023-45288.patch
3838
Patch5: CVE-2024-0874.patch
39+
Patch6: CVE-2024-24786.patch
3940

4041
BuildRequires: golang
4142

@@ -74,6 +75,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} %{name}
7475
%{_bindir}/%{name}
7576

7677
%changelog
78+
* Mon Dec 09 2024 Kavya Sree Kaitepalli <[email protected]> - 1.11.1-12
79+
- Patch for CVE-2024-24786
80+
7781
* Mon Sep 09 2024 CBL-Mariner Servicing Account <[email protected]> - 1.11.1-11
7882
- Bump release to rebuild with go 1.22.7
7983

SPECS/etcd/CVE-2024-24786.patch

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 867d49d8c566b0f1284f8295ba1286d6c5e93edf Mon Sep 17 00:00:00 2001
2+
From: kavyasree <[email protected]>
3+
Date: Mon, 9 Dec 2024 17:03:26 +0530
4+
Subject: [PATCH] Modified patch
5+
6+
---
7+
.../protobuf/encoding/protojson/well_known_types.go | 4 ++++
8+
.../protobuf/internal/encoding/json/decode.go | 2 +-
9+
2 files changed, 5 insertions(+), 1 deletion(-)
10+
11+
diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
12+
index c85f846..634ba41 100644
13+
--- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
14+
+++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
15+
@@ -348,6 +348,10 @@ func (d decoder) skipJSONValue() error {
16+
}
17+
}
18+
}
19+
+ case json.EOF:
20+
+ // This can only happen if there's a bug in Decoder.Read.
21+
+ // Avoid an infinite loop if this does happen.
22+
+ return errors.New("unexpected EOF")
23+
}
24+
return nil
25+
}
26+
diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
27+
index b13fd29..b2be4e8 100644
28+
--- a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
29+
+++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
30+
@@ -121,7 +121,7 @@ func (d *Decoder) Read() (Token, error) {
31+
32+
case ObjectClose:
33+
if len(d.openStack) == 0 ||
34+
- d.lastToken.kind == comma ||
35+
+ d.lastToken.kind&(Name|comma) != 0 ||
36+
d.openStack[len(d.openStack)-1] != ObjectOpen {
37+
return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString())
38+
}
39+
--
40+
2.34.1
41+

SPECS/etcd/etcd.spec

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: A highly-available key value store for shared configuration
22
Name: etcd
33
Version: 3.5.12
4-
Release: 5%{?dist}
4+
Release: 6%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -14,6 +14,8 @@ Source1: etcd.service
1414
# generate_source_tarball.sh --srcTarball <source_tarball> --pkgVersion %%{version} --outFolder .
1515
Source2: %{name}-%{version}-vendor.tar.gz
1616
Patch0: CVE-2023-45288.patch
17+
Patch1: CVE-2024-24786.patch
18+
1719
BuildRequires: golang
1820

1921
%description
@@ -117,6 +119,9 @@ install -vdm755 %{buildroot}%{_sharedstatedir}/etcd
117119
/%{_docdir}/%{name}-%{version}-tools/*
118120

119121
%changelog
122+
* Mon Dec 09 2024 Kavya Sree Kaitepalli <[email protected]> - 3.5.12-6
123+
- Patch for CVE-2024-24786
124+
120125
* Mon Sep 09 2024 CBL-Mariner Servicing Account <[email protected]> - 3.5.12-5
121126
- Bump release to rebuild with go 1.22.7
122127

0 commit comments

Comments
 (0)