Skip to content

Commit 38254e9

Browse files
CBL-Mariner-Botsandeepkarambelkarjslobodzian
authored
[AUTO-CHERRYPICK] Patch promethes for CVE-2025-22868 [High] - branch 3.0-dev (#12969)
Co-authored-by: Sandeep Karambelkar <skarambelkar@microsoft.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 827c032 commit 38254e9

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

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 <nealpatel@google.com>
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 <gobot@golang.org>
14+
Reviewed-by: Damien Neil <dneil@google.com>
15+
Reviewed-by: Roland Shoemaker <roland@golang.org>
16+
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
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/prometheus/prometheus.spec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: Prometheus monitoring system and time series database
55
Name: prometheus
66
Version: 2.45.4
7-
Release: 8%{?dist}
7+
Release: 9%{?dist}
88
License: Apache-2.0
99
Vendor: Microsoft Corporation
1010
Distribution: Azure Linux
@@ -22,8 +22,9 @@ Patch1: CVE-2023-45288.patch
2222
Patch2: CVE-2024-6104.patch
2323
Patch3: CVE-2024-24786.patch
2424
Patch4: CVE-2023-44487.patch
25-
Patch5: 0001-Fix-exit-condition-of-TestQuerierIndexQueriesRace.patch
26-
Patch6: 0002-Improve-sensitivity-of-TestQuerierIndexQueriesRace.patch
25+
Patch5: CVE-2025-22868.patch
26+
Patch6: 0001-Fix-exit-condition-of-TestQuerierIndexQueriesRace.patch
27+
Patch7: 0002-Improve-sensitivity-of-TestQuerierIndexQueriesRace.patch
2728
BuildRequires: golang
2829
BuildRequires: nodejs
2930
BuildRequires: nodejs-npm
@@ -140,9 +141,12 @@ fi
140141
%doc README.md RELEASE.md documentation
141142

142143
%changelog
143-
* Thu Mar 13 2025 Andrew Phelps <anphel@microsoft.com> - 2.45.4-8
144+
* Thu Mar 13 2025 Andrew Phelps <anphel@microsoft.com> - 2.45.4-9
144145
- Add patches to fix test reliability issues with TestQuerierIndexQueriesRace
145146

147+
* Thu Mar 06 2025 Sandeep Karambelkar <skarambelkar@microsoft.com> - 2.45.4-8
148+
- Fix CVE-2025-22868
149+
146150
* Tue Mar 04 2025 corvus-callidus <108946721+corvus-callidus@users.noreply.github.com> - 2.45.4-7
147151
- Fix CVE-2023-44487
148152

0 commit comments

Comments
 (0)