Repository navigation
Share the git URL check, and refuse the transports Omarchy does not clone from - #8174
Merged
Merged
Conversation
Both commands clone a URL a stranger can choose, and each carried its own copy of the rule that refuses a git option or a `<helper>::<address>` transport helper before cloning. Two copies of a security check drift: the second one arrived four months after the first, and only because someone went looking for it. The rule now lives in omarchy-git-url-check and the callers ask it. Its absence refuses the URL rather than waving it through, since the callers read a non-zero status as a refusal and a missing command exits 127. Co-Authored-By: Claude Opus 5 <[email protected]> Co-Authored-By: Codex XHigh <[email protected]>
`<helper>::<address>` is only one of the two ways a URL reaches a remote helper. git also resolves git-remote-<scheme> for `<scheme>://<address>` whenever the scheme is not one it connects itself, so `ext::sh -c id` and `ext://sh -c id` arrive at the same helper while only the first was refused. That shape cannot be refused outright, because it is also how every legitimate URL arrives, so the scheme is checked against the transports git still connects itself. `git+ssh` and `ssh+git` are on that list: they are spelled like a helper and read as plain ssh, and leaving them off would refuse a URL that clones today. `ext` and `fd` are off it deliberately -- git ships a helper for each, and `ext` runs whatever command the URL carries. Co-Authored-By: Claude Opus 5 <[email protected]> Co-Authored-By: Codex XHigh <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes Git URL validation and blocks unsupported transport helpers before cloning themes or plugins.
Changes:
- Adds a shared, fail-closed Git URL checker.
- Updates theme and plugin installation commands to use it.
- Expands regression coverage for helper schemes and missing checker behavior.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-git-url-check |
Implements shared transport validation. |
bin/omarchy-theme-install |
Delegates URL checks to the shared command. |
bin/omarchy-plugin-add |
Delegates URL checks to the shared command. |
test/shell.d/git-url-check-test.sh |
Tests accepted and rejected URL forms. |
test/shell.d/theme-install-guards-test.sh |
Tests unsupported schemes and fail-closed behavior. |
test/shell.d/plugin-add-test.sh |
Tests scheme rejection before cloning. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
omarchybot
added a commit
that referenced
this pull request
Aug 25, 2026
…lone from (backport of #8174) Backport of the shared URL check (PR #8174, merged to quattro as 68ab12f) onto the v4-0-1 release branch, on top of the #8067 backport it follows. omarchy-theme-install and omarchy-plugin-add both clone a URL a stranger can choose, and each carried its own copy of the rule that refuses a git option or a transport helper before cloning. The rule now lives in omarchy-git-url-check and both callers ask it: two copies of a security check drift, and the second copy arrived four months after the first only because someone went looking for it. That rule was also enforcing half of what it described. <helper>::<address> is one of two shapes git resolves a remote helper from -- it also runs git-remote-<scheme> for <scheme>://<address> whenever the scheme is not one it connects itself, so ext::sh -c id and ext://sh -c id reach the same helper while only the first was refused. Nothing exploitable follows on a stock system: protocol.ext.allow defaults to never, and the :// spelling hands git-remote-ext a command name it cannot exec. But a third-party helper installed on PATH is reachable through the scheme form alone, and a guard is worth more when it enforces the rule it states. The :// shape cannot be refused the way :: is, because it is also how every legitimate URL arrives, so the scheme is checked against the transports git still connects itself: ssh git git+ssh ssh+git http https ftp ftps file. git+ssh and ssh+git are on that list because they are spelled like a helper and read as plain ssh; leaving them off would refuse a URL that clones today. ext and fd are off it deliberately. A single colon is always scp-style ssh and a bare path is always a path, so neither needs constraining. The check fails closed: the callers read a non-zero status as a refusal, so a missing omarchy-git-url-check refuses the URL rather than waving it through. Clean cherry-pick on top of the #8067 backport: every file is byte-identical to quattro, so merging v4-0-1 into quattro resolves without a conflict. test/shell passes: 189 files, including the one this adds. test/cli passes, so the new command's metadata is well-formed. Exercised the check here: https, scp-style, ssh, git+ssh and scp-style IPv6 all pass, while ext:: ext:// fd:: fd:// and a leading-dash form are refused, as is an uppercase EXT:// spelling. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
Closed
nick1udwig
pushed a commit
to nick1udwig/omarchy
that referenced
this pull request
Sep 9, 2026
…lone from (omacom#8174) * Share the git URL check between theme-install and plugin-add Both commands clone a URL a stranger can choose, and each carried its own copy of the rule that refuses a git option or a `<helper>::<address>` transport helper before cloning. Two copies of a security check drift: the second one arrived four months after the first, and only because someone went looking for it. The rule now lives in omarchy-git-url-check and the callers ask it. Its absence refuses the URL rather than waving it through, since the callers read a non-zero status as a refusal and a missing command exits 127. Co-Authored-By: Claude Opus 5 <[email protected]> Co-Authored-By: Codex XHigh <[email protected]> * Refuse a git URL naming a transport Omarchy does not clone from `<helper>::<address>` is only one of the two ways a URL reaches a remote helper. git also resolves git-remote-<scheme> for `<scheme>://<address>` whenever the scheme is not one it connects itself, so `ext::sh -c id` and `ext://sh -c id` arrive at the same helper while only the first was refused. That shape cannot be refused outright, because it is also how every legitimate URL arrives, so the scheme is checked against the transports git still connects itself. `git+ssh` and `ssh+git` are on that list: they are spelled like a helper and read as plain ssh, and leaving them off would refuse a URL that clones today. `ext` and `fd` are off it deliberately -- git ships a helper for each, and `ext` runs whatever command the URL carries. Co-Authored-By: Claude Opus 5 <[email protected]> Co-Authored-By: Codex XHigh <[email protected]> --------- Co-authored-by: David Heinemeier Hansson <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Codex XHigh <[email protected]>
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.
omarchy-theme-installandomarchy-plugin-addboth clone a URL a stranger can choose, and each carried its own copy of the rule that refuses a git option or a transport helper before cloning. The rule now lives in one place,omarchy-git-url-check, and both callers ask it — two copies of a security check drift, and the second copy arrived four months after the first only because someone went looking for it.That rule was also enforcing half of what it described.
<helper>::<address>is one of two shapes git resolves a remote helper from: it also runsgit-remote-<scheme>for<scheme>://<address>whenever the scheme is not one it connects itself, soext::sh -c idandext://sh -c idreach the same helper while only the first was refused. Nothing exploitable follows on a stock system —protocol.ext.allowdefaults tonever, and the://spelling handsgit-remote-exta command name it cannot exec — but a third-party helper installed onPATHis reachable through the scheme form alone, and a guard is worth more when it enforces the rule it states.The
://shape cannot be refused the way::is, because it is also how every legitimate URL arrives, so the scheme is checked against the transports git still connects itself:ssh git git+ssh ssh+git http https ftp ftps file.git+sshandssh+gitare on that list because they are spelled like a helper and read as plain ssh; leaving them off would refuse a URL that clones today.extandfdare off it deliberately — git ships a helper for each, andextruns whatever command the URL carries. A single colon is always scp-style ssh and a bare path is always a path, so neither needs constraining.The check fails closed. The callers read a non-zero status as a refusal, so a missing
omarchy-git-url-checkrefuses the URL rather than waving it through.Follows on from #8067, which added the
::half of this check toomarchy-plugin-add.🤖 Generated by Opus 5 in Claude Code. Reviewed by Codex XHigh.