Token for trigger mirror-sync only #6361

Closed
opened 2025-11-02 06:53:35 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wenerme on GitHub (Nov 20, 2020).

  • Gitea version (or commit ref): 1.14.0+dev-239-gad2a28862

  • Git version: 1.14.0+dev

  • Operating system: Linux/Docker

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

User can read repo, but can not trigger https://git.my.org/api/v1/repos/my/repo/mirror-sync?token=$TOKEN, this is used in the webhook of other system like gitlab, github. Webhook is not hide in most system, this cause the owner's PAT is leaked to who can access the webhook, which is quite common allowed a lot user to access. Better to have a token only for mirror-sync or provide another webhook url which not require token.

BTW, gitlab has a lot token for various actions, like feed token or email token, this can prevent leak the pat.

Originally created by @wenerme on GitHub (Nov 20, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.0+dev-239-gad2a28862 - Git version: 1.14.0+dev - Operating system: Linux/Docker <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite ## Description User can read repo, but can not trigger `https://git.my.org/api/v1/repos/my/repo/mirror-sync?token=$TOKEN`, this is used in the webhook of other system like gitlab, github. Webhook is not hide in most system, this cause the owner's PAT is leaked to who can access the webhook, which is quite common allowed a lot user to access. Better to have a token only for `mirror-sync` or provide another webhook url which not require token. BTW, gitlab has a lot token for various actions, like feed token or email token, this can prevent leak the pat.
GiteaMirror added the issue/duplicate label 2025-11-02 06:53:35 -06:00
Author
Owner

@jolheiser commented on GitHub (Nov 20, 2020):

I think this is closely enough related to #4300 to close this one in favor of the other with more details.

@jolheiser commented on GitHub (Nov 20, 2020): I think this is closely enough related to #4300 to close this one in favor of the other with more details.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6361