From e790555387c72c74e3ab74eeecd398c4b9528625 Mon Sep 17 00:00:00 2001 From: Max Novak Date: Tue, 27 Oct 2026 09:41:34 +0000 Subject: [PATCH 1/2] Harden git, mise and Ghostty defaults found by the security audit - 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 --- dotfiles/ghostty | 5 +++++ dotfiles/gitconfig | 3 ++- dotfiles/zshrc | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dotfiles/ghostty b/dotfiles/ghostty index eea8e64..01b1552 100644 --- a/dotfiles/ghostty +++ b/dotfiles/ghostty @@ -11,3 +11,8 @@ keybind = super+k=text:\x0c # Left Option sends Alt, so terminal apps like herdr receive alt+. # Right Option still types special characters (€, ñ, ∞). macos-option-as-alt = left + +# Ask before a program sets the clipboard (OSC 52). Anything printed to the +# terminal can carry the sequence -- a directory name in the prompt, a file +# you cat -- so it should not be able to replace what you paste next. +clipboard-write = ask diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index 142cd2e..f77b136 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -5,7 +5,8 @@ defaultBranch = main [push] autoSetupRemote = true - followTags = true # push annotated tags along with the commits + # No followTags: fetch auto-follows tags from every remote, so it would push + # a fork's tags to your origin. Push tags explicitly: git push origin [fetch] prune = true [rerere] diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 9290e7c..ea40e81 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -35,6 +35,11 @@ if command -v bat >/dev/null && [[ -z "$FZF_CTRL_T_OPTS" ]]; then export FZF_CTRL_T_OPTS="--preview 'bat --color=always --style=numbers --line-range=:500 {}'" fi +# mise asks before using a cloned repo's .tool-versions (it already does for +# mise.toml), and never installs a tool just because you typed its name. +export MISE_PARANOID="${MISE_PARANOID:-1}" +export MISE_NOT_FOUND_AUTO_INSTALL="${MISE_NOT_FOUND_AUTO_INSTALL:-false}" + # Tools command -v starship >/dev/null && eval "$(starship init zsh)" command -v mise >/dev/null && eval "$(mise activate zsh)" From f522d30b7243a58f7ddba77e1d1fc8308a92dec4 Mon Sep 17 00:00:00 2001 From: Max Novak Date: Tue, 27 Oct 2026 10:10:54 +0000 Subject: [PATCH 2/2] Drop the Ghostty clipboard-write prompt 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 --- dotfiles/ghostty | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dotfiles/ghostty b/dotfiles/ghostty index 01b1552..eea8e64 100644 --- a/dotfiles/ghostty +++ b/dotfiles/ghostty @@ -11,8 +11,3 @@ keybind = super+k=text:\x0c # Left Option sends Alt, so terminal apps like herdr receive alt+. # Right Option still types special characters (€, ñ, ∞). macos-option-as-alt = left - -# Ask before a program sets the clipboard (OSC 52). Anything printed to the -# terminal can carry the sequence -- a directory name in the prompt, a file -# you cat -- so it should not be able to replace what you paste next. -clipboard-write = ask