From 388436d5005cca1b969379aab16bb68d86c24c61 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 2 Mar 2026 01:37:10 +0100 Subject: [PATCH] fix: verify code challenge of S256 We do not know for sure, but it is quite likely someone assumed implicit fallthrough. This meant that if someone used S256 for PKCE, it simply did not verify the code challenge and always accepted it. PKCE only started working recently as it was broken for a long time already, forgejo/forgejo!8678 --- routers/web/auth/oauth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index f44a102a49..9099aedb44 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -479,8 +479,7 @@ func AuthorizeOAuth(ctx *context.Context) { // pkce support switch form.CodeChallengeMethod { - case "S256": - case "plain": + case "S256", "plain": if err := ctx.Session.Set("CodeChallengeMethod", form.CodeChallengeMethod); err != nil { handleAuthorizeError(ctx, AuthorizeError{ ErrorCode: ErrorCodeServerError,