Deploy key with write access can not push #8657

Closed
opened 2025-11-02 08:13:34 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @wxiaoguang on GitHub (Mar 5, 2022).

2022/03/06 00:00:42 router: completed GET /api/internal/serv/command/21/org/repo?mode=2&verb=git-receive-pack for 127.0.0.1:34602, 200 OK in 6.2ms @ private/serv.go:81(private.ServCommand)

2022/03/06 00:00:42 router: completed POST /api/internal/hook/pre-receive/org/repo for 127.0.0.1:34604, 403 Forbidden in 5.8ms @ private/hook_pre_receive.go:107(private.HookPreReceive)

2022/03/06 00:00:42 router: completed POST /api/internal/ssh/21/update/42 for 127.0.0.1:34606, 200 OK in 10.4ms @ private/key.go:18(private.UpdatePublicKeyInRepo)

The HookPreReceive calls AssertCanWriteCode, but AssertCanWriteCode only checks user's permission.

Originally created by @wxiaoguang on GitHub (Mar 5, 2022). ``` 2022/03/06 00:00:42 router: completed GET /api/internal/serv/command/21/org/repo?mode=2&verb=git-receive-pack for 127.0.0.1:34602, 200 OK in 6.2ms @ private/serv.go:81(private.ServCommand) 2022/03/06 00:00:42 router: completed POST /api/internal/hook/pre-receive/org/repo for 127.0.0.1:34604, 403 Forbidden in 5.8ms @ private/hook_pre_receive.go:107(private.HookPreReceive) 2022/03/06 00:00:42 router: completed POST /api/internal/ssh/21/update/42 for 127.0.0.1:34606, 200 OK in 10.4ms @ private/key.go:18(private.UpdatePublicKeyInRepo) ``` The `HookPreReceive` calls `AssertCanWriteCode`, but `AssertCanWriteCode` only checks user's permission.
GiteaMirror added the type/bug label 2025-11-02 08:13:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8657