Repository navigation
fix(git): reject scp-style embedded credentials and align clone timeout - #308
Merged
jeff-r2026 merged 1 commit intoAug 24, 2026
Merged
Conversation
Two follow-up fixes for the generic Git provider (Tencent#301): - parseGenericGitRepoInput accepted scp-style URLs whose user field carried credentials (e.g. "oauth2:token@host:group/repo.git"), returning them verbatim while the HTTPS path already rejected embedded credentials. A colon in the SSH user field is a credential, never a real login, so reject it. Normal "git@host:..." logins are unaffected. - Clone timeout was 120s, shorter than the 180s default used by the shallow-clone path in clone.ts. Large self-hosted repos over slow/VPN links could time out where the equivalent path would not. Align to 180s. Co-Authored-By: Claude Fable 5 <[email protected]>
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…ut (Tencent#308) Two follow-up fixes for the generic Git provider (Tencent#301): - parseGenericGitRepoInput accepted scp-style URLs whose user field carried credentials (e.g. "oauth2:token@host:group/repo.git"), returning them verbatim while the HTTPS path already rejected embedded credentials. A colon in the SSH user field is a credential, never a real login, so reject it. Normal "git@host:..." logins are unaffected. - Clone timeout was 120s, shorter than the 180s default used by the shallow-clone path in clone.ts. Large self-hosted repos over slow/VPN links could time out where the equivalent path would not. Align to 180s. Co-authored-by: Claude Fable 5 <[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.
Summary
Two follow-up fixes for the generic Git provider added in #301, found in code review.
1. scp-style URLs leaked embedded credentials (security)
parseGenericGitRepoInputrejected embedded credentials on the HTTPS/ssh://path, but the scp-style branch (user@host:group/repo.git) returned the input verbatim. An input likeoauth2:[email protected]:Enterprise/repo.gitwas preserved as-is and could be written back intoteamai.yaml(repo:) /localConfig.remote, contradicting the no-credentials-in-URL guarantee that the HTTPS path and the redact util both promise.A colon in the SSH user field is a credential (
oauth2:token), never a real login, so we now reject it with the same message the HTTPS path uses. Normalgit@host:group/repo.gitlogins are unaffected.2. Clone timeout shorter than the shallow-clone path
cloneRepohardcoded a 120s timeout, shorter than the 180s default used by the shallow-clone path inclone.ts. Large self-hosted repos over slow/VPN links could time out where the equivalent path would not. Aligned to 180s.Test Plan
npx tsc --noEmit— no new type errors in changed filesnpx vitest run src/__tests__/generic-git-provider.test.ts— 16/16 pass (added a scp-credential case; updated the timeout assertion)npm run build— success; confirmedtimeout: 18e4(180000) compiled into the generic cloneReponode dist/index.js init "oauth2:[email protected]:Enterprise/repo.git"→ rejected withDo not embed credentialsnode dist/index.js init "[email protected]:..."→ not rejected for credentials (normal scp login preserved)🤖 Generated with Claude Code