Skip to content

fix(security): restrict generic git repository URLs to network transports - #174

Merged
maartenbode merged 1 commit into
mainfrom
fix/git-transport-rce
Jul 26, 2026
Merged

fix(security): restrict generic git repository URLs to network transports#174
maartenbode merged 1 commit into
mainfrom
fix/git-transport-rce

Conversation

@maartenbode

Copy link
Copy Markdown
Member

Repository identifiers for the generic Git provider were validated only as string|max:500 before being passed to git. Git accepts addresses that are not network URLs, so a repository could be pointed at things it should never reach.

Adds a provider-aware ValidRepositoryIdentifier rule: API-backed providers take an owner/repo slug, and the generic Git provider is limited to https, http, ssh and git URLs or scp-style user@host:path.

The same check runs again where git is actually invoked, so identifiers already stored — or written by any path other than the form — are refused too. Command arguments now use a -- separator so an address can never be read as an option.

Split out of #172 so it can be reviewed and released on its own.

@maartenbode
maartenbode merged commit 3b72412 into main Jul 26, 2026
3 checks passed
@maartenbode
maartenbode deleted the fix/git-transport-rce branch July 26, 2026 14:14
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