Skip to content

Stop tracked repository metadata from redirecting hosted ledger reads (VERIA-27) - #176

Draft
veria-ai[bot] wants to merge 4 commits into
mainfrom
veria/27-tracked-repository-metadata-can-redirect
Draft

veria-ai[bot] wants to merge 4 commits into
mainfrom
veria/27-tracked-repository-metadata-can-redirect

Conversation

@veria-ai

@veria-ai veria-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Security fix: Tracked Repository Metadata Can Redirect Hosted Ledger Reads

What was wrong

binding() in packages/core/src/team-server.ts accepted the SageOx repository ID from tracked .sageox/config.json without requiring an operator-controlled repository pin. A checkout with an approved Git origin could therefore select another same-team repository for hosted ledger sync and reads when the team-level repo pin was absent.

What changed

  • parseReposConf() in packages/cli/src/repos.ts added support for a validated repo=repo_<id> suffix, stored as expectedRepoId; packages/cli/src/cli.ts passed that pin to the team server.
  • binding() now rejects hosted access unless the tracked ID matches expectedRepoId, falling back to the team-level repo pin when no entry-specific pin exists. When both pins are set, both must match.
  • Tests in packages/cli/test/repos.test.ts and packages/core/test/team-server.test.ts added coverage for pin parsing, missing and conflicting pins, fallback behavior, and same-team ID substitution before initial sync and during refresh. Deployment documentation and CHANGELOG.md documented the configuration requirement.

Why this is safe

Tracked metadata alone can no longer choose the repository offered the team credential: missing or mismatched trusted bindings block hosted sync and reads. Existing origin, team, ID syntax, authorization, and response checks remain in place. Correctly pinned hosted callers continue working; unpinned hosted access is now refused, while code indexing and explicit ledgerSync behavior remain unchanged.

Before merging

Configure repo=repo_<id> for each repository requiring hosted ledger reads in repos.conf, or use the existing team-level repo pin for a single-repository scope. Obtain IDs from trusted deployment information, not the checkout's tracked .sageox/config.json.

Fixes VERIA-27


This PR was generated by Veria AI.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

rsnodgrass and others added 3 commits November 6, 2026 01:25
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
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