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/web
Archer 5c542ca94c
Prevent automatic OAuth grants for public clients (#30790)
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: wxiaoguang <wxiaoguang@gmail.com>
10 months ago
..
admin Resolve lint for unused parameter and unnecessary type arguments (#30750) 10 months ago
auth Prevent automatic OAuth grants for public clients (#30790) 10 months ago
devtest Move context from modules to services (#29440) 1 year ago
events Move context from modules to services (#29440) 1 year ago
explore Refactor topic Find functions and add more tests for pagination (#30127) 11 months ago
feed Resolve lint for unused parameter and unnecessary type arguments (#30750) 10 months ago
healthcheck Always enable caches (#28527) 1 year ago
misc Move context from modules to services (#29440) 1 year ago
org Fix project description rendering for org (#30587) 10 months ago
repo Fix bleve fuzziness (#30799) 10 months ago
shared Add API for `Variables` (#29520) 11 months ago
user Initial support for colorblindness-friendly themes (#30625) 10 months ago
base.go Fix panic in storageHandler (#27446) 1 year ago
githttp.go Move context from modules to services (#29440) 1 year ago
goget.go Move context from modules to services (#29440) 1 year ago
home.go migrate some more "OptionalBool" to "Option[bool]" (#29479) 1 year ago
metrics.go Implement FSFE REUSE for golang files (#21840) 2 years ago
nodeinfo.go Move context from modules to services (#29440) 1 year ago
passkey.go Move context from modules to services (#29440) 1 year ago
swagger_json.go Move context from modules to services (#29440) 1 year ago
web.go Skip gzip for some well-known compressed file types (#30796) 10 months ago
webfinger.go Move context from modules to services (#29440) 1 year ago