Skip to content

Prevent activated environments from hijacking Hermit tools - #613

Merged
alecthomas merged 2 commits into
masterfrom
fix-dx-29
Aug 13, 2026
Merged

Prevent activated environments from hijacking Hermit tools#613
alecthomas merged 2 commits into
masterfrom
fix-dx-29

Conversation

@alecthomas

@alecthomas alecthomas commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Hermit鈥檚 internal tool invocations could resolve repository-controlled shims from an activated environment鈥檚 bin/, allowing a malicious git wrapper to bypass the transport restrictions added for VULN-78247.

Resolve internal tools from the user鈥檚 pre-activation PATH by reverting Hermit鈥檚 recorded environment operations, and pass that restored PATH to their child processes. This excludes paths injected during activation without breaking Homebrew, Nix, or other custom tool locations, while user-authored package commands retain normal PATH behavior. Includes unit coverage and separate Bash/Zsh integration cases for resolution before and after activation.

Linear: DX-29

alecthomas and others added 2 commits August 13, 2026 14:00
Resolve Hermit's internal helper binaries from a trusted system path so repository-controlled environment shims cannot bypass Git transport protections or intercept archive operations. Add unit and integration coverage for the poisoned PATH scenario.

Co-authored-by: Codex <noreply@openai.com>
Restore PATH from Hermit's recorded activation operations instead of relying on fixed system directories. This keeps Homebrew, Nix, and other user-configured tool locations available while excluding repository-controlled paths injected by Hermit. Cover binary resolution independently before and after activation.

Co-authored-by: Codex <noreply@openai.com>
@alecthomas alecthomas changed the title Prevent Hermit helper PATH hijacking Prevent activated environments from hijacking Hermit tools Aug 13, 2026
@alecthomas
alecthomas merged commit 778de32 into master Aug 13, 2026
8 checks passed
@alecthomas
alecthomas deleted the fix-dx-29 branch August 13, 2026 04:05
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