FiloSottile / FiloSottile/mkcert
Automatic sudo fallback is scary!
- Dominant language
- Go
- Stars
- 59.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
If the user wants to give mkcert the ability to run as root via sudo then they should explicitly do so.
Having a process fallback to running via sudo automatically itself is very scary. It basically allows mkcert to piggy back root privileges of the back of another unrelated command's sudo timeout window.
This is pretty ripe for abuse. It is also very surprising when you run mkcert without sudo and discover that has somehow magically managed to write to your system trust store. This is exactly what happened to me, and led to me trying to figure out how this happened.
Printing a message saying "That operation requires root - rerun with sudo" should be all that is needed.
Contributor guide
Assessment
This issue has not been assessed yet.