fix: Validate git transport scheme for package sources - #607
Merged
Conversation
Sources were dispatched to git on a ".git" suffix, which is decided at the end of the string, while git resolves the transport from the start. Nothing looked in between, so "zzq::x.git" reached git clone untouched and git exec'd git-remote-zzq from PATH, which Hermit itself prepends the environment's own bin/ to. A committed bin/hermit.hcl is outside Env.Verify(), so validate env still passed and a bare cd was enough to trigger it via the shell hooks. Reject unsupported schemes and the remote-helper form up front, and pin protocol.allow on every git invocation so an unknown transport is also refused by git itself. Autoversion and the cache take manifest-supplied URLs into the same sink, so they are covered too. VULN-78247 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
alecthomas
force-pushed
the
aat/validate-git-source-scheme
branch
from
August 12, 2026 23:14
eb25cee to
5300d4c
Compare
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.
Sources were dispatched to git on a ".git" suffix, which is decided at
the end of the string, while git resolves the transport from the start.
Nothing looked in between, so "zzq::x.git" reached git clone untouched
and git exec'd git-remote-zzq from PATH, which Hermit itself prepends
the environment's own bin/ to. A committed bin/hermit.hcl is outside
Env.Verify(), so validate env still passed and a bare cd was enough to
trigger it via the shell hooks.
Reject unsupported schemes and the remote-helper form up front, and pin
protocol.allow on every git invocation so an unknown transport is also
refused by git itself. Autoversion and the cache take manifest-supplied
URLs into the same sink, so they are covered too.
VULN-78247
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com