Skip to content

fix(auth): enforce repo-scoped access for self-dogfood registration pack - #486

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-authorization-flaw-in-self-dogfood-route
Jun 10, 2026
Merged

fix(auth): enforce repo-scoped access for self-dogfood registration pack#486
JSONbored merged 1 commit into
mainfrom
codex/fix-authorization-flaw-in-self-dogfood-route

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The app-level /v1/app/self-dogfood/registration-pack route performed a global role check (requireAppRole) but did not verify that a browser session actually had access to the configured self-dogfood repository, allowing maintainers of unrelated repos to view a private report.

Description

  • Require the resolved self-dogfood repo and its RepositoryRecord inside the app route and call requireSessionRepoAccess for session identities before returning the pack.
  • Preserve existing app-role guard by keeping the requireAppRole check and only adding a repo-scoped access check for browser sessions.
  • Add unit tests and a seedInstalledRepo helper to cover the new behavior, verifying that an unrelated repo-scoped session receives forbidden_repo and that a session scoped to the configured repo is allowed.
  • Update imports in the test to seed installations and repositories for the auth scenarios.

Testing

  • Ran npm run test:unit -- test/unit/routes-self-dogfood-registration-pack.test.ts and the added tests passed.
  • Ran tsc --noEmit via npm run typecheck and typechecking succeeded.
  • The full unit test run in this environment completed successfully (all tests passed).

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 988e6da Commit Preview URL

Branch Preview URL
Jun 10 2026, 06:12 AM

@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 9, 2026
@dosubot dosubot Bot added the size:XS label Jun 9, 2026
@ghost

ghost commented Jun 9, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #486 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 9, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored force-pushed the codex/fix-authorization-flaw-in-self-dogfood-route branch from 57bd485 to 988e6da Compare June 10, 2026 06:10
@JSONbored
JSONbored merged commit 7e1d153 into main Jun 10, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-authorization-flaw-in-self-dogfood-route branch June 10, 2026 06:13
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant