mirror of
https://github.com/FiloSottile/mkcert.git
synced 2026-04-25 13:36:02 +03:00
[GH-ISSUE #156] Unsafe defaults facilitate privilege escalation #99
Labels
No labels
TLS stack issue
Windows
bug
duplicate
duplicate
enhancement
help wanted
help wanted
pull-request
question
question
root store
waiting for info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mkcert#99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @VP- on GitHub (Apr 15, 2019).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/156
The only safe way to use a local CA on a typical system is to install its certificate in a separate browser profile, which is then used for development only. Otherwise, the following scenario can use the CA as part of an exploit chain:
mkcert?)By using a separate browser profile, all that a compromised CA key can achieve is to impersonate the page/app under development.
The default behavior for
mkcert -installis to enable step 3 of the above exploit chain. And what's worse, the only way to make it secure is to abuse the environment variable$TRUST_STORESby providing an invalid value, so that the generated certs are not installed anywhere. One must then use-CAROOTto actually find the generated root certs (this one is at least documented).This is the exact opposite of the "safe by default" policy that any software should follow, much less any software designed to help people make their own software more secure.
As a solution to this problem, you could provide a command which just generates the CA certificates (optionally in a specified directory) and mention it as the safe alternative to
-installin all documentation. IMHO it's not necessary to completely replace-installsince e.g. a dedicated development system, where the user is not installing random software from the internet, is still a perfectly valid use case for it.As a bonus, please explicitly document a value for
$TRUST_STORESwhich is guaranteed to not match any future store types, e.g. "none".@FiloSottile commented on GitHub (Apr 15, 2019):
Thanks for your issue, this has been debated a few times, and I am still not convinced that remote read access to the filesystem of a developer machine is any different from a full compromise. For example, an attacker can read the GitHub cookies from the browser store.
All
-installdoes is install the root in the trust stores. You don't have to run it to use mkcert, so theTRUST_STORES=nonemode is simplymkcertwithout-install.@VP- commented on GitHub (Apr 16, 2019):
True, and red-herring arguments like this are the reason why. The existence of a problem is not an excuse for making it worse.
Great! So the fix does not involve any code at all. The documentation only needs to mention that
-installis optional. Preferably somewhere near the top, where-installitself is explained.