-
Notifications
You must be signed in to change notification settings - Fork 3
Restrict ValidateRepo API to allowed git providers #53
Copy link
Copy link
Open
Description
Summary
ValidateRepoHandler accepts arbitrary user-supplied URLs and performs remote validation (including dulwich ls_remote) without applying the same provider whitelist checks used by the spawner path.
Why this matters
This broad URL reachability can be abused for SSRF-style probing/internal network access attempts from the hub context.
Current behavior
ValidateRepoHandlervalidates arbitrary URL input.- It can attempt outbound requests to non-approved hosts.
- Spawner path has whitelist checks, but validation API does not enforce equivalent constraints.
Expected behavior
Repository validation should enforce scheme and hostname restrictions identical (or stricter) to spawn-time validation.
Proposed fix
- Require
http/httpsscheme. - Enforce host whitelist via
gitClone.allowedProviders(same matching rule as spawner). - Return clear 4xx responses for disallowed hosts.
- Add tests for allowed/disallowed host cases.
Acceptance criteria
- Validation API rejects non-whitelisted providers with 4xx.
- Allowed providers continue to validate normally.
- Tests cover whitelist enforcement.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels