1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-05 19:30:58 +00:00
forgejo/tests
forgejo-backport-action 8d1cf92e12 [v12.0/forgejo] fix: require password login for creation of new token (#9080)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/9070

Obtaining a [personal access token via the API](https://forgejo.org/docs/latest/user/api-usage/#generating-and-listing-api-tokens)  is no longer possible if the password used for basic authentication is an API token or an [OAuth2 token](https://forgejo.org/docs/latest/user/api-usage/#oauth2-provider): it has to be the user password. Such privilege escalation was only possible for tokens with write permissions to the user.

This requirement is already enforced when API calls are made with an authorization header [as described in the documentation](https://forgejo.org/docs/latest/user/api-usage/#authentication), but it was not enforced with basic authentication. As a consequence it was possible for an API token with `write:user` permissions or an OAuth2 token to obtain a new token with a wider or identical scope.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9070): <!--number 9070 --><!--line 0 --><!--description cmVxdWlyZSBwYXNzd29yZCBsb2dpbiBmb3IgY3JlYXRpb24gb2YgbmV3IHRva2Vu-->require password login for creation of new token<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9080
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-08-30 18:43:53 +02:00
..
e2e [v12.0/forgejo] fix: wrap items in gitignore dropdown (#8841) 2025-08-09 20:20:40 +02:00
fuzz chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
gitea-lfs-meta Test views of LFS files (#22196) 2022-12-23 07:41:56 +08:00
gitea-repositories-meta [v12.0/forgejo] fix(ui): move file rename notice to before pagination (#8852) 2025-08-10 22:19:25 +02:00
integration [v12.0/forgejo] fix: require password login for creation of new token (#9080) 2025-08-30 18:43:53 +02:00
testdata/data add model viewer for .glb (GLTF) model in file view (#8111) 2025-06-21 14:42:35 +02:00
mysql.ini.tmpl [v12.0/forgejo] Revert "feat: remove API authentication methods that uses the URL query (#7924)" (#8653) 2025-07-24 17:53:11 +02:00
pgsql.ini.tmpl [v12.0/forgejo] Revert "feat: remove API authentication methods that uses the URL query (#7924)" (#8653) 2025-07-24 17:53:11 +02:00
sqlite.ini.tmpl [v12.0/forgejo] Revert "feat: remove API authentication methods that uses the URL query (#7924)" (#8653) 2025-07-24 17:53:11 +02:00
test_utils.go [v12.0/forgejo] fix: prevent pull requests from being merged multiple times (#8862) 2025-08-11 23:08:46 +02:00