Skip to content

Commit 47e93c7

Browse files
[AUTO-CHERRYPICK] [LOW] Patch rook to fix CVE-2024-51744 - branch main (#13356)
Co-authored-by: Archana Shettigar <v-shettigara@microsoft.com>
1 parent 52c5c1d commit 47e93c7

2 files changed

Lines changed: 85 additions & 1 deletion

File tree

SPECS/rook/CVE-2024-51744.patch

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
From aed4cc91e3bce602c939f71278acb2b2d878cd96 Mon Sep 17 00:00:00 2001
2+
From: archana25-ms <v-shettigara@microsoft.com>
3+
Date: Thu, 20 Mar 2025 05:28:44 +0000
4+
Subject: [PATCH] Address CVE-2024-51744
5+
6+
Source link: https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c#diff-83eb8e32639d01cf443d6d8bde24c1c8be78766090d8c5f8586c36250cfedca6
7+
---
8+
.../github.com/form3tech-oss/jwt-go/parser.go | 34 +++++++++++--------
9+
1 file changed, 20 insertions(+), 14 deletions(-)
10+
11+
diff --git a/vendor/github.com/form3tech-oss/jwt-go/parser.go b/vendor/github.com/form3tech-oss/jwt-go/parser.go
12+
index d6901d9..83f42eb 100644
13+
--- a/vendor/github.com/form3tech-oss/jwt-go/parser.go
14+
+++ b/vendor/github.com/form3tech-oss/jwt-go/parser.go
15+
@@ -20,6 +20,16 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
16+
return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
17+
}
18+
19+
+// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object
20+
+// implementing the Claims interface. This provides default values which can be overridden and
21+
+// allows a caller to use their own type, rather than the default MapClaims implementation of
22+
+// Claims.
23+
+//
24+
+// Note: If you provide a custom claim implementation that embeds one of the standard claims (such
25+
+// as RegisteredClaims), make sure that a) you either embed a non-pointer version of the claims or
26+
+// b) if you are using a pointer, allocate the proper memory for it before passing in the overall
27+
+// claims, otherwise you might run into a panic.
28+
+
29+
func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
30+
token, parts, err := p.ParseUnverified(tokenString, claims)
31+
if err != nil {
32+
@@ -56,12 +66,17 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
33+
return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable}
34+
}
35+
36+
+ // Perform validation
37+
+ token.Signature = parts[2]
38+
+ if err := token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
39+
+ return token, &ValidationError{Inner: err, Errors: ValidationErrorSignatureInvalid}
40+
+ }
41+
+
42+
vErr := &ValidationError{}
43+
44+
// Validate Claims
45+
if !p.SkipClaimsValidation {
46+
if err := token.Claims.Valid(); err != nil {
47+
-
48+
// If the Claims Valid returned an error, check if it is a validation error,
49+
// If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set
50+
if e, ok := err.(*ValidationError); !ok {
51+
@@ -69,22 +84,13 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
52+
} else {
53+
vErr = e
54+
}
55+
+ return token, vErr
56+
}
57+
}
58+
+ // No errors so far, token is valid.
59+
+ token.Valid = true
60+
61+
- // Perform validation
62+
- token.Signature = parts[2]
63+
- if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
64+
- vErr.Inner = err
65+
- vErr.Errors |= ValidationErrorSignatureInvalid
66+
- }
67+
-
68+
- if vErr.valid() {
69+
- token.Valid = true
70+
- return token, nil
71+
- }
72+
-
73+
- return token, vErr
74+
+ return token, nil
75+
}
76+
77+
// WARNING: Don't use this method unless you know what you're doing
78+
--
79+
2.45.3
80+

SPECS/rook/rook.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Summary: Orchestrator for distributed storage systems in cloud-native environments
2020
Name: rook
2121
Version: 1.6.2
22-
Release: 25%{?dist}
22+
Release: 26%{?dist}
2323
License: Apache-2.0
2424
Vendor: Microsoft Corporation
2525
Distribution: Mariner
@@ -61,6 +61,7 @@ Patch4: CVE-2024-6104.patch
6161
Patch5: CVE-2024-28180.patch
6262
Patch6: CVE-2022-3162.patch
6363
Patch7: CVE-2025-27144.patch
64+
Patch8: CVE-2024-51744.patch
6465
# Ceph version is needed to set correct container tag in manifests
6566
BuildRequires: ceph
6667
# Rook requirements
@@ -259,6 +260,9 @@ sed -i -e "s|\(.*tag: \)VERSION|\1%{helm_appVersion}|" %{values_yaml}
259260
# bother adding docs or changelog or anything
260261

261262
%changelog
263+
* Wed Mar 19 2025 Archana Shettigar <v-shettigara@microsoft.com> - 1.6.2-26
264+
- Add patch for CVE-2024-51744
265+
262266
* Sun Mar 16 2025 Kanishk Bansal <kanbansal@microsoft.com> - 1.6.2-25
263267
- Fix CVE-2025-27144 with an upstream patch
264268

0 commit comments

Comments
 (0)