|
| 1 | +From 0672cedd8b665bd9f56f3080a2c4ea0b2070bbc4 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Kanishk-Bansal <kbkanishk975@gmail.com> |
| 3 | +Date: Fri, 28 Feb 2025 10:19:43 +0000 |
| 4 | +Subject: [PATCH] CVE-2025-27144 |
| 5 | +Upstream Reference : https://github.com/go-jose/go-jose/commit/5253038e3b5f64a2200b5b6c72107bf9823f4358 |
| 6 | +--- |
| 7 | + vendor/gopkg.in/square/go-jose.v2/jwe.go | 5 +++-- |
| 8 | + vendor/gopkg.in/square/go-jose.v2/jws.go | 5 +++-- |
| 9 | + 2 files changed, 6 insertions(+), 4 deletions(-) |
| 10 | + |
| 11 | +diff --git a/vendor/gopkg.in/square/go-jose.v2/jwe.go b/vendor/gopkg.in/square/go-jose.v2/jwe.go |
| 12 | +index b5a6dcd..cd1de9e 100644 |
| 13 | +--- a/vendor/gopkg.in/square/go-jose.v2/jwe.go |
| 14 | ++++ b/vendor/gopkg.in/square/go-jose.v2/jwe.go |
| 15 | +@@ -201,10 +201,11 @@ func (parsed *rawJSONWebEncryption) sanitized() (*JSONWebEncryption, error) { |
| 16 | + |
| 17 | + // parseEncryptedCompact parses a message in compact format. |
| 18 | + func parseEncryptedCompact(input string) (*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("square/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/gopkg.in/square/go-jose.v2/jws.go b/vendor/gopkg.in/square/go-jose.v2/jws.go |
| 30 | +index 8b59b6a..9646826 100644 |
| 31 | +--- a/vendor/gopkg.in/square/go-jose.v2/jws.go |
| 32 | ++++ b/vendor/gopkg.in/square/go-jose.v2/jws.go |
| 33 | +@@ -247,10 +247,11 @@ func (parsed *rawJSONWebSignature) sanitized() (*JSONWebSignature, error) { |
| 34 | + |
| 35 | + // parseSignedCompact parses a message in compact format. |
| 36 | + func parseSignedCompact(input string) (*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("square/go-jose: compact JWS format must have three parts") |
| 42 | + } |
| 43 | ++ parts := strings.SplitN(input, ".", 3) |
| 44 | + |
| 45 | + rawProtected, err := base64.RawURLEncoding.DecodeString(parts[0]) |
| 46 | + if err != nil { |
| 47 | +-- |
| 48 | +2.45.2 |
| 49 | + |
0 commit comments