Skip to content

Harden git and mise defaults found by the security audit - #15

Merged
maximn merged 2 commits into
mainfrom
fix/security-audit-hardening
Oct 27, 2026
Merged

maximn merged 2 commits into
mainfrom
fix/security-audit-hardening

Conversation

@maximn

@maximn maximn commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two default changes from a full security audit of the repo.

 dotfiles/gitconfig
 [push]
   autoSetupRemote = true
-  followTags = true
+  # (removed) fetch auto-follows tags from every remote, so this pushed a fork's tags to origin

 dotfiles/zshrc
+export MISE_PARANOID="${MISE_PARANOID:-1}"                          # .tool-versions needs `mise trust`
+export MISE_NOT_FOUND_AUTO_INSTALL="${MISE_NOT_FOUND_AUTO_INSTALL:-false}"
 command -v mise >/dev/null && eval "$(mise activate zsh)"
  • followTags is the one confirmed finding (low). The flow: git remote add fork … → git fetch fork auto-follows the fork's annotated tag v99.0.0 → a later plain git push origin main publishes v99.0.0 to origin.
  • mise: by default mise trusts .tool-versions without asking, unlike mise.toml. A cloned repo could therefore pick github:/npm: tools for you, and the not-found hook may install them.
    Not in this PR:
  • Ghostty clipboard-write = ask. starship prints directory names and package.json versions raw, so a crafted name can set your clipboard. But a prompt on every OSC 52 write gets in the way of normal copying (tmux, herdr, Neovim, SSH), and the attack still needs you to paste and press Enter. If this is ever worth closing, it belongs in the prompt (strip OSC sequences from starship's output), not in Ghostty.
  • The audit's top lead, pam_reattach.so loaded by sudo from a user-writable Homebrew prefix. It needs a check on a real Mac first: stat -L on the path in /etc/pam.d/sudo_local and each of its parent directories.

Evidence

  • followTags, reproduced by the audit with host git 2.47.3 and dummy bare repos:
    • Before: git push origin main printed * [new tag] v99.0.0 -> v99.0.0, and origin listed the fork's tag.
    • After (followTags=false): origin has no tags.
  • mise 2026.10.19, in a folder containing only .tool-versions (node 22.0.0):
    • Before: mise ls --current resolves node 22.0.0 (missing) from it.
    • After (MISE_PARANOID=1): Config files in …/.tool-versions are not trusted. Trust them with mise trust.
  • zsh -n dotfiles/zshrc passes.

Merge Danger

Door: two-way

Plain revert. Each setting can also be overridden locally: ~/.gitconfig, or export MISE_PARANOID=0 before .zshrc.

Blast Radius: workflow

  • Tags no longer go up with git push. Use git push --follow-tags or git push origin <tag>.
  • The first cd into each existing project with a .tool-versions now needs a one-time mise trust.

🤖 Generated with Claude Code

maximn and others added 2 commits October 27, 2026 09:41
- gitconfig: drop push.followTags, which pushed tags auto-fetched from
  any remote (e.g. a fork) to origin on a plain git push
- zshrc: default MISE_PARANOID=1 and MISE_NOT_FOUND_AUTO_INSTALL=false so
  a cloned repo's .tool-versions needs `mise trust` and nothing installs
  just because a command name was typed
- ghostty: clipboard-write = ask, so terminal output (prompt, cat) cannot
  silently replace the clipboard via OSC 52

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asking before every OSC 52 write gets in the way of normal copying from
tmux, herdr, Neovim and SSH sessions. The risk it covered (a crafted
directory name replacing the clipboard) still needs a paste plus Enter,
and bracketed paste stops a pasted newline from running anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maximn maximn changed the title Harden git, mise and Ghostty defaults found by the security audit Harden git and mise defaults found by the security audit Oct 27, 2026
@maximn
maximn merged commit 81e105f into main Oct 27, 2026
4 checks passed
@maximn
maximn deleted the fix/security-audit-hardening branch October 27, 2026 19:02
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.

1 participant