fix(config): reject malformed github repo slugs in validateConfig - #618
Open
aniruddhaadak80 wants to merge 1 commit into
Open
fix(config): reject malformed github repo slugs in validateConfig#618aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
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
Tightens
validateConfig's GitHub repo check, which previously accepted anything containing a/. Values like"owner/","/repo","a/b/c","owner//repo", and whitespace-padded slugs passed validation and failed later insideghcalls with obscure errors.src/core/config.ts:889-899— replaces therepo.includes('/')check with an anchoredowner/repopattern (/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/): exactly one slash, no empty segments, no whitespace. Error message unchanged (Invalid GitHub repo format ... (expected: owner/repo)).src/core/config.test.ts:689-706— regression tests rejectingowner/,/repo,a/b/c, padded/double-slash variants, and accepting dotted/dashed/underscored names.Reproduced before the fix via
validateConfigprobe: all ofowner/,/repo,a/b/c,owner/repo␣,␣owner/repo,owner//repo,/returnedvalid=true. After the fix all returnvalid=false, whileowner/repo1,my-org/my.repo-1_2,a/bremain valid.Related issue
No open issue exists (the repo currently has zero open issues). Proactive hardening discovered by scanning the config validation path (
src/core/config.ts:889-899) — the gap between whatvalidateConfigaccepts and what the GitHub/CI monitoring code can actually use.Type of change
Checklist
npm run lintpasses (no warnings on touched files)npm run typecheckpassesnpm run buildpasses (unaffected; type-only change shape)npm testpasses for the touched area (src/core/config.test.ts: 53 passed; 1 pre-existing Windows-only failure inparses and process-locks the strict companion contract— fails identically on cleanmainbecauseresolve('/run/...')differs on Windows, unrelated to this change)