Skip to content

Commit e731008

Browse files
[AUTO-CHERRYPICK] [Low] Patch dcos-cli for CVE-2024-51744 - branch main (#13351)
Co-authored-by: Kevin Lockwood <57274670+kevin-b-lockwood@users.noreply.github.com>
1 parent 42923d3 commit e731008

2 files changed

Lines changed: 67 additions & 3 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 67bf8f996ae5ad8238dba72a4d492708125a1561 Mon Sep 17 00:00:00 2001
2+
From: Kevin Lockwood <v-klockwood@microsoft.com>
3+
Date: Tue, 11 Mar 2025 13:56:18 -0700
4+
Subject: [PATCH] [Low] patch dcos-cli for CVE-2024-51744
5+
6+
Link: https://github.com/golang-jwt/jwt/commit/7b1c1c00a171c6c79bbdb40e4ce7d197060c1c2c.patch
7+
---
8+
vendor/github.com/dgrijalva/jwt-go/parser.go | 22 +++++++++-----------
9+
1 file changed, 10 insertions(+), 12 deletions(-)
10+
11+
diff --git a/vendor/github.com/dgrijalva/jwt-go/parser.go b/vendor/github.com/dgrijalva/jwt-go/parser.go
12+
index d6901d9..72cf9ee 100644
13+
--- a/vendor/github.com/dgrijalva/jwt-go/parser.go
14+
+++ b/vendor/github.com/dgrijalva/jwt-go/parser.go
15+
@@ -56,6 +56,12 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
16+
return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable}
17+
}
18+
19+
+ // Perform validation
20+
+ token.Signature = parts[2]
21+
+ if err := token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
22+
+ return token, &ValidationError{Inner: err, Errors: ValidationErrorSignatureInvalid}
23+
+ }
24+
+
25+
vErr := &ValidationError{}
26+
27+
// Validate Claims
28+
@@ -69,22 +75,14 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
29+
} else {
30+
vErr = e
31+
}
32+
+ return token, vErr
33+
}
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+
- vErr.Inner = err
40+
- vErr.Errors |= ValidationErrorSignatureInvalid
41+
- }
42+
-
43+
- if vErr.valid() {
44+
- token.Valid = true
45+
- return token, nil
46+
- }
47+
+ // No errors so far, token is valid.
48+
+ token.Valid = true
49+
50+
- return token, vErr
51+
+ return token, nil
52+
}
53+
54+
// WARNING: Don't use this method unless you know what you're doing
55+
--
56+
2.34.1
57+

SPECS/dcos-cli/dcos-cli.spec

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The command line for DC/OS
22
Name: dcos-cli
33
Version: 1.2.0
4-
Release: 20%{?dist}
4+
Release: 21%{?dist}
55
License: Apache-2.0
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -10,6 +10,7 @@ URL: https://github.com/dcos/dcos-cli
1010
Source0: https://github.com/dcos/dcos-cli/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
1111
Patch0: CVE-2024-28180.patch
1212
Patch1: CVE-2025-27144.patch
13+
Patch2: CVE-2024-51744.patch
1314
BuildRequires: golang
1415
BuildRequires: git
1516
%global debug_package %{nil}
@@ -19,7 +20,10 @@ BuildRequires: git
1920
The command line for DC/OS.
2021

2122
%prep
22-
%autosetup -p1
23+
%autosetup -N
24+
%autopatch -p1 0 1
25+
cd vendor/github.com/dgrijalva/jwt-go
26+
%autopatch 2
2327

2428
%build
2529
export GOPATH=%{our_gopath}
@@ -46,10 +50,13 @@ go test -mod=vendor
4650
%{_bindir}/dcos
4751

4852
%changelog
53+
* Tue Mar 11 2025 Kevin Lockwood <v-klockwood@microsoft.com> - 1.2.0-21
54+
- Add patch for CVE-2024-51744
55+
4956
* Sat Mar 01 2025 Kanishk Bansal <kanbansal@microsoft.com> - 1.2.0-20
5057
- Fix CVE-2025-27144 with an upstream patch
5158

52-
* Mon Oct 01 2024 Henry Li <lihl@microsoft.com> - 1.2.0-19
59+
* Tue Oct 01 2024 Henry Li <lihl@microsoft.com> - 1.2.0-19
5360
- Add patch to resolve CVE-2024-28180
5461

5562
* Mon Sep 09 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.2.0-18

0 commit comments

Comments
 (0)