Skip to content

fix: Validate git transport scheme for package sources - #607

Merged
alecthomas merged 1 commit into
masterfrom
aat/validate-git-source-scheme
Aug 12, 2026
Merged

fix: Validate git transport scheme for package sources#607
alecthomas merged 1 commit into
masterfrom
aat/validate-git-source-scheme

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

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

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
alecthomas force-pushed the aat/validate-git-source-scheme branch from eb25cee to 5300d4c Compare August 12, 2026 23:14
@alecthomas
alecthomas merged commit 01276e6 into master Aug 12, 2026
8 checks passed
@alecthomas
alecthomas deleted the aat/validate-git-source-scheme branch August 12, 2026 23:19
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