[GH-ISSUE #236] Automatic sudo fallback is scary! #151

Open
opened 2026-02-25 22:32:44 +03:00 by kerem · 1 comment
Owner

Originally created by @mgeorge on GitHub (Jan 16, 2020).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/236

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.

Originally created by @mgeorge on GitHub (Jan 16, 2020). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/236 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.
Author
Owner

@renatofrota commented on GitHub (Feb 11, 2024):

This is actually wonderful. And a great reminder that you must review (or trust) the code you run on your machine, no matter you are adding sudo in front of it (manually) or not.

If you do not trust someone's code (hint: mkcert), do not run it - or fully inspect it before doing so.

<!-- gh-comment-id:1937458937 --> @renatofrota commented on GitHub (Feb 11, 2024): This is actually wonderful. And a great reminder that **you must review** (or trust) the code you run on your machine, no matter you are adding sudo in front of it (manually) **or not**. If you do not trust someone's code (hint: mkcert), do not run it - or fully inspect it before doing so.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mkcert#151
No description provided.