|
| 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 | + |
0 commit comments