Skip to content

Commit 06c7772

Browse files
[AUTO-CHERRYPICK] Patch keda for CVE-2025-22868 & CVE-2025-27144 [High] - branch 3.0-dev (#12784)
Co-authored-by: Kanishk Bansal <[email protected]>
1 parent 2059682 commit 06c7772

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

SPECS/keda/CVE-2025-22868.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 681b4d8edca1bcfea5bce685d77ea7b82ed3e7b3 Mon Sep 17 00:00:00 2001
2+
From: Neal Patel <[email protected]>
3+
Date: Thu, 30 Jan 2025 14:10:09 -0500
4+
Subject: [PATCH] jws: split token into fixed number of parts
5+
6+
Thanks to 'jub0bs' for reporting this issue.
7+
8+
Fixes #71490
9+
Fixes CVE-2025-22868
10+
11+
Change-Id: I2552731f46d4907f29aafe7863c558387b6bd6e2
12+
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/652155
13+
Auto-Submit: Gopher Robot <[email protected]>
14+
Reviewed-by: Damien Neil <[email protected]>
15+
Reviewed-by: Roland Shoemaker <[email protected]>
16+
LUCI-TryBot-Result: Go LUCI <[email protected]>
17+
---
18+
vendor/golang.org/x/oauth2/jws/jws.go | 4 ++--
19+
1 file changed, 2 insertions(+), 2 deletions(-)
20+
21+
diff --git a/vendor/golang.org/x/oauth2/jws/jws.go b/vendor/golang.org/x/oauth2/jws/jws.go
22+
index 95015648b..6f03a49d3 100644
23+
--- a/vendor/golang.org/x/oauth2/jws/jws.go
24+
+++ b/vendor/golang.org/x/oauth2/jws/jws.go
25+
@@ -165,11 +165,11 @@ func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) {
26+
// Verify tests whether the provided JWT token's signature was produced by the private key
27+
// associated with the supplied public key.
28+
func Verify(token string, key *rsa.PublicKey) error {
29+
- parts := strings.Split(token, ".")
30+
- if len(parts) != 3 {
31+
+ if strings.Count(token, ".") != 2 {
32+
return errors.New("jws: invalid token received, token must have 3 parts")
33+
}
34+
35+
+ parts := strings.SplitN(token, ".", 3)
36+
signedContent := parts[0] + "." + parts[1]
37+
signatureString, err := base64.RawURLEncoding.DecodeString(parts[2])
38+
if err != nil {

SPECS/keda/CVE-2025-27144.patch

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 72e5dc031b9ecdc0ba2db04b715bb43b8eefcf59 Mon Sep 17 00:00:00 2001
2+
From: Kanishk-Bansal <[email protected]>
3+
Date: Fri, 28 Feb 2025 09:57:57 +0000
4+
Subject: [PATCH] CVE-2025-27144
5+
6+
---
7+
vendor/github.com/go-jose/go-jose/v4/jwe.go | 5 +++--
8+
vendor/github.com/go-jose/go-jose/v4/jws.go | 5 +++--
9+
2 files changed, 6 insertions(+), 4 deletions(-)
10+
11+
diff --git a/vendor/github.com/go-jose/go-jose/v4/jwe.go b/vendor/github.com/go-jose/go-jose/v4/jwe.go
12+
index 89f03ee3..9f1322dc 100644
13+
--- a/vendor/github.com/go-jose/go-jose/v4/jwe.go
14+
+++ b/vendor/github.com/go-jose/go-jose/v4/jwe.go
15+
@@ -288,10 +288,11 @@ func ParseEncryptedCompact(
16+
keyAlgorithms []KeyAlgorithm,
17+
contentEncryption []ContentEncryption,
18+
) (*JSONWebEncryption, error) {
19+
- parts := strings.Split(input, ".")
20+
- if len(parts) != 5 {
21+
+ // Five parts is four separators
22+
+ if strings.Count(input, ".") != 4 {
23+
return nil, fmt.Errorf("go-jose/go-jose: compact JWE format must have five parts")
24+
}
25+
+ parts := strings.SplitN(input, ".", 5)
26+
27+
rawProtected, err := base64.RawURLEncoding.DecodeString(parts[0])
28+
if err != nil {
29+
diff --git a/vendor/github.com/go-jose/go-jose/v4/jws.go b/vendor/github.com/go-jose/go-jose/v4/jws.go
30+
index 3a912301..d09d8ba5 100644
31+
--- a/vendor/github.com/go-jose/go-jose/v4/jws.go
32+
+++ b/vendor/github.com/go-jose/go-jose/v4/jws.go
33+
@@ -327,10 +327,11 @@ func parseSignedCompact(
34+
payload []byte,
35+
signatureAlgorithms []SignatureAlgorithm,
36+
) (*JSONWebSignature, error) {
37+
- parts := strings.Split(input, ".")
38+
- if len(parts) != 3 {
39+
+ // Three parts is two separators
40+
+ if strings.Count(input, ".") != 2 {
41+
return nil, fmt.Errorf("go-jose/go-jose: compact JWS format must have three parts")
42+
}
43+
+ parts := strings.SplitN(input, ".", 3)
44+
45+
if parts[1] != "" && payload != nil {
46+
return nil, fmt.Errorf("go-jose/go-jose: payload is not detached")
47+
--
48+
2.45.2
49+

SPECS/keda/keda.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Kubernetes-based Event Driven Autoscaling
22
Name: keda
33
Version: 2.14.1
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -24,6 +24,8 @@ Source0: %{name}-%{version}.tar.gz
2424
Source1: %{name}-%{version}-vendor.tar.gz
2525
Patch0: CVE-2024-6104.patch
2626
Patch1: CVE-2024-45338.patch
27+
Patch2: CVE-2025-27144.patch
28+
Patch3: CVE-2025-22868.patch
2729
BuildRequires: golang >= 1.15
2830

2931
%description
@@ -61,6 +63,9 @@ cp ./bin/keda-admission-webhooks %{buildroot}%{_bindir}
6163
%{_bindir}/%{name}-admission-webhooks
6264

6365
%changelog
66+
* Mon Mar 03 2025 Kanishk Bansal <[email protected]> - 2.14.1-3
67+
- Fix CVE-2025-27144, CVE-2025-22868 with an upstream patch
68+
6469
* Wed Jan 08 2025 <[email protected]> - 2.14.1-2
6570
- Add patch for CVE-2024-45338
6671

0 commit comments

Comments
 (0)