Prevent activated environments from hijacking Hermit tools - #613
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hermit鈥檚 internal tool invocations could resolve repository-controlled shims from an activated environment鈥檚
bin/, allowing a maliciousgitwrapper to bypass the transport restrictions added for VULN-78247.Resolve internal tools from the user鈥檚 pre-activation
PATHby reverting Hermit鈥檚 recorded environment operations, and pass that restoredPATHto their child processes. This excludes paths injected during activation without breaking Homebrew, Nix, or other custom tool locations, while user-authored package commands retain normalPATHbehavior. Includes unit coverage and separate Bash/Zsh integration cases for resolution before and after activation.Linear: DX-29