Skip to content

fix(web): reject non-string connected repo branches - #227

Merged
dirtybits merged 3 commits into
mainfrom
fix/reject-nonstring-connected-repo-branch
Oct 11, 2026
Merged

dirtybits merged 3 commits into
mainfrom
fix/reject-nonstring-connected-repo-branch

Conversation

@dirtybits

Copy link
Copy Markdown
Owner

Summary

  • Stack this narrow follow-up on fix(web): reject unsafe connected repo branches #210, which rejects slash/path traversal forms in connected-repository branch names.
  • Treat branch as untrusted runtime input in validateRepoCoords: preserve the existing undefined/null default to main, trim strings, and reject numbers, arrays, and objects with the existing Invalid branch result.
  • Prevent a validly signed connect-repository request with branch: {} (or another non-string JSON value) from reaching .trim() and returning a server error before repository ownership checks.
  • Add direct behavioral regression coverage for representative non-string branch values.

No database schema, repository sync behavior for valid inputs, chain, wallet, payment, or deployment configuration changes.

Verification

  • npm test --workspace @agentvouch/web -- __tests__/lib/mirror-connectedRepos.test.ts --maxWorkers=1 --no-fileParallelism — passed (26 tests).
  • npm run format:check — passed.
  • npm run lint:web — passed.
  • npm run typecheck — passed.
  • npm test --workspace @agentvouch/web -- --maxWorkers=1 --no-fileParallelism — passed (141 files, 1,195 tests).
  • git diff --check origin/fix/reject-unsafe-connected-repo-branches...HEAD — passed.
  • npm exec --workspace @agentvouch/web -- next build --webpack — webpack compilation and TypeScript passed, but static prerendering stopped at /sitemap.xml because this cron checkout lacks web/.env.local / DATABASE_URL. The pre-existing ox dynamic-dependency warning was also emitted. No full production-build success is claimed.

Rollback

Revert commit 029538b. This restores the prior behavior only; no schema, deployment, or persisted state requires rollback.

@dirtybits
dirtybits changed the base branch from fix/reject-unsafe-connected-repo-branches to main October 11, 2026 06:05
@dirtybits
dirtybits merged commit a92d300 into main Oct 11, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — fc95e4cf Deployed Oct 11, 2026 by vercel[bot]
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