You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers
Giteabot 1389fa8a99
Prevent automatic OAuth grants for public clients (#30790) (#30835)
Backport #30790 by archer-321

This commit forces the resource owner (user) to always approve OAuth 2.0
authorization requests if the client is public (e.g. native
applications).

As detailed in [RFC 6749 Section
10.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-10.2),

> The authorization server SHOULD NOT process repeated authorization
requests automatically (without active resource owner interaction)
without authenticating the client or relying on other measures to ensure
that the repeated request comes from the original client and not an
impersonator.

With the implementation prior to this patch, attackers with access to
the redirect URI (e.g., the loopback interface for
`git-credential-oauth`) can get access to the user account without any
user interaction if they can redirect the user to the
`/login/oauth/authorize` endpoint somehow (e.g., with `xdg-open` on
Linux).

Fixes #25061.

Co-authored-by: Archer <archer@beezig.eu>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
10 months ago
..
api Fix empty field login_name in API response JSON when creating user (#30511) (#30532) 10 months ago
common Fix incorrect cookie path for AppSubURL (#29534) (#29552) 12 months ago
install Fix validity of the FROM email address not being checked (#29347) (#29360) 12 months ago
private Performance optimization for git push (#30104) (#30354) 10 months ago
utils
web Prevent automatic OAuth grants for public clients (#30790) (#30835) 10 months ago
init.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago