Skip to content

Commit 765a0e5

Browse files
authored
Merge commit from fork (#2233)
Fixes: GHSA-f83f-xpx7-ffpw Signed-off-by: Bob Callaway <[email protected]>
1 parent 90f8520 commit 765a0e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/identity/issuerpool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ func (p IssuerPool) Authenticate(ctx context.Context, token string, opts ...conf
4141
}
4242

4343
func extractIssuerURL(token string) (string, error) {
44-
parts := strings.Split(token, ".")
45-
if len(parts) != 3 {
46-
return "", fmt.Errorf("oidc: malformed jwt, expected 3 parts got %d", len(parts))
44+
if strings.Count(token, ".") != 2 {
45+
return "", fmt.Errorf("oidc: malformed jwt, token must have 3 parts")
4746
}
4847

48+
parts := strings.SplitN(token, ".", 3)
4949
raw, err := base64.RawURLEncoding.DecodeString(parts[1])
5050
if err != nil {
5151
return "", fmt.Errorf("oidc: malformed jwt payload: %w", err)

0 commit comments

Comments
 (0)