rc: don't expose pprof debug handlers on an unauthenticated server GHSA-mfvx-7rcj-9m5g CVE-PENDING

The pprof debug handlers were accessible without authentication disclosing the
process command line (which can carry backend credentials passed on the command
line) and runtime profiles.

Mount the pprof handlers only when when auth is configured or --rc-no-auth was
passed - so they obey the same rule as the rc endpoints.

Addresses GHSA-mfvx-7rcj-9m5g finding 1.
This commit is contained in:
Nick Craig-Wood
2026-07-31 13:21:59 +01:00
parent 21d8cd3b92
commit faaf716e9b
3 changed files with 56 additions and 10 deletions
+8
View File
@@ -2742,6 +2742,14 @@ curl -H "Content-Type: application/json" -X POST -d '{"potato":2,"sausage":1}' '
If you use the `--rc` flag this will also enable the use of the go
profiling tools on the same port.
The profiling endpoints follow the same authentication rules as the
rest of the rc: they are only served if authentication has been set up
(`--rc-user`/`--rc-pass` or `--rc-htpasswd`) or the
[`--rc-no-auth`](#--rc-no-auth) flag is in use. For debugging on the
default localhost port the easiest thing is to use `--rc --rc-no-auth`
(but see the warning about using `--rc-no-auth` on a non-loopback
bind).
To use these, first [install go](https://golang.org/doc/install).
### Debugging memory use