pprof is public accessible even when ENABLE_PPROF=false #2350

Closed
opened 2025-11-02 04:33:34 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @krombel on GitHub (Sep 20, 2018).

Description

I do not expect to have those debug information public available.

Those get added in go-macaron/toolbox
https://github.com/go-gitea/gitea/blob/364c02924607eeebbe7d76983a7c5e45e9017fe0/vendor/github.com/go-macaron/toolbox/toolbox.go#L136-L140
which got added in #1290:
https://github.com/go-gitea/gitea/blob/364c02924607eeebbe7d76983a7c5e45e9017fe0/routers/routes/routes.go#L127-L134

Badly there does not seem to be an option to disable this without removing the Toolbox completly.

//EDIT: As a temporary workaround I added this to my nginx config:

        location /debug {
                return 403;
        }
Originally created by @krombel on GitHub (Sep 20, 2018). - Gitea version (or commit ref): 364c029 - Can you reproduce the bug at https://try.gitea.io: - [x] Yes: e.g. https://try.gitea.io/debug/pprof/heap?debug=1 ## Description I do not expect to have those debug information public available. Those get added in go-macaron/toolbox https://github.com/go-gitea/gitea/blob/364c02924607eeebbe7d76983a7c5e45e9017fe0/vendor/github.com/go-macaron/toolbox/toolbox.go#L136-L140 which got added in [#1290](https://github.com/go-gitea/gitea/pull/1290/files#diff-7aa71b75b5fddf1332a485052ffbca9aR117): https://github.com/go-gitea/gitea/blob/364c02924607eeebbe7d76983a7c5e45e9017fe0/routers/routes/routes.go#L127-L134 Badly there does not seem to be an option to disable this without removing the Toolbox completly. //EDIT: As a temporary workaround I added this to my nginx config: ``` location /debug { return 403; } ```
GiteaMirror added the type/bug label 2025-11-02 04:33:34 -06:00
Author
Owner

@L-P commented on GitHub (Sep 26, 2018):

I can confirm this issue is present on the official v1.5.1 docker image.

@L-P commented on GitHub (Sep 26, 2018): I can confirm this issue is present on the official v1.5.1 docker image.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2350