Skip to content

Verify mkcert binary SHA-256 checksum before execution#588

Draft
Copilot wants to merge 3 commits intohuntercaron/mkcert-secure-wsfrom
copilot/sub-pr-586
Draft

Verify mkcert binary SHA-256 checksum before execution#588
Copilot wants to merge 3 commits intohuntercaron/mkcert-secure-wsfrom
copilot/sub-pr-586

Conversation

Copy link

Copilot AI commented Mar 6, 2026

Addresses the security implications of downloading and executing the mkcert binary without integrity verification. Since mkcert installs a root CA into the system trust store, a tampered binary (MITM or compromised release) could install a malicious CA and enable HTTPS interception.

Changes

  • Checksum verification on download — SHA-256 of the downloaded binary is computed in-memory and compared against hardcoded values before writing to disk; a mismatch throws with a clear tamper warning
  • Checksum verification on cache hit — cached binary is re-verified on each run; a mismatch triggers a re-download with a warning
  • Hardcoded checksums for all 7 mkcert v1.4.4 targets (darwin-amd64/arm64, linux-amd64/arm/arm64, windows-amd64/arm64) — must be updated alongside MKCERT_VERSION
  • getDownloadUrlgetDownloadInfo — now returns { url, expectedChecksum } so the checksum travels with the URL
  • Security notes in module JSDoc — documents the CA private key risk (~/.framer/code-link/rootCA-key.pem must not be shared/committed) and the checksum update requirement

Changelog

  • No user-facing changes

Testing

  • First-run: delete ~/.framer/code-link/mkcert (or the .exe), run the CLI, confirm the binary is downloaded and the WSS server starts
  • Cache hit: run again without deleting the binary, confirm "already available and verified" debug log and no re-download
  • Tamper detection: corrupt the cached binary (echo x >> ~/.framer/code-link/mkcert), confirm a re-download is triggered with the checksum warning

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 6, 2026 12:28
Co-authored-by: Nick-Lucas <8896153+Nick-Lucas@users.noreply.github.com>
Co-authored-by: Nick-Lucas <8896153+Nick-Lucas@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 6, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FiloSottile/mkcert/releases/tags/v1.4.4
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP Address security implications and best practices for secure websockets Verify mkcert binary SHA-256 checksum before execution Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants