Skip to content

Allow the winget-pkgs fork and upstream in gh-safe - #748

Merged
Finesssee merged 1 commit into
mainfrom
chore/gh-safe-allow-winget
Oct 3, 2026
Merged

Finesssee merged 1 commit into
mainfrom
chore/gh-safe-allow-winget

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

scripts/gh-safe.sh only allowed writes to nesszer/Win-CodexBar, so the winget release step (a manifest branch on the Finesssee/winget-pkgs fork, then a PR on microsoft/winget-pkgs) could not go through the wrapper. This adds those two repos to the allowlist. Every other check is unchanged: read-back verification, the --repo override block, repos/<repo>/ scoping for gh api, and the upstream steipete/CodexBar gate.

  • gh-safe.tests.sh: the fake gh repo view now echoes the requested repo. New cases: winget PR create allowed, fork merge-upstream API allowed, an API path outside the bound fork rejected, and an unlisted other/winget-pkgs rejected.
  • AGENTS.md: names the three allowlisted repos.

Commands

  • bash -n scripts/gh-safe.sh: passes.
  • scripts/gh-safe.tests.sh: passes locally ("GitHub write-safety shell tests passed."), run from a copy without the temp-dir cleanup trap, which this workstation's delete-policy hook blocks. The hosted -Slice ci does not run this script; only the default developer slice of local-check.ps1 does.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0915bac3-4ad1-403c-9832-6a383c40b5d8
📥 Commits

Reviewing files that changed from the base of the PR and between f0b45ed and a15a2a0.

📒 Files selected for processing (3)
  • AGENTS.md
  • scripts/gh-safe.sh
  • scripts/gh-safe.tests.sh

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The gh-safe.sh allowlist now accepts nesszer/win-codexbar, finesssee/winget-pkgs, and microsoft/winget-pkgs. The usage example, documentation, and wrapper tests reflect these repositories and test rejection cases.

Changes

Repository allowlist

Layer / File(s) Summary
Allowlist and wrapper tests
scripts/gh-safe.sh, scripts/gh-safe.tests.sh, AGENTS.md
The allowlist accepts the three specified repositories. The usage example and documentation reflect the additions. Tests cover successful calls and rejection cases.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a15a2

The wrapper permits the intended fork and upstream operations while rejecting the inspected mismatched targets. No actionable merge-blocking issue remains after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a15a2

The repository checks remain in place, but the newly allowed repositories receive broader command authorization than the two release actions described. Actual mutation authority depends on the configured GitHub account permissions, which were not established.

Retained concerns

  • Low · security · observed: The newly authorized winget repositories inherit generic mutation dispatch, not operation-specific authorization for fork synchronization and upstream PR creation. A caller using repo-only verification can select other commands or repository-scoped REST endpoints; their success depends on existing GitHub permissions. Repository identity checks contain ordinary target mismatches but do not narrow operations within either newly allowed repository.
Security review details

Security Blast Radius

  • inferred — The incremental intended exposure is mutation capability on Finesssee/winget-pkgs and microsoft/winget-pkgs. Within those targets, impact may extend beyond manifest branches and PR creation if the configured credentials permit other repository operations. Credential scope and downstream package publication effects were not established.

Security Findings and Attack Paths

  • inferred — A malicious or mistaken caller able to invoke the wrapper can select a newly allowed repository, use repo-only verification, and forward an operation outside the documented release examples. The wrapper does not enforce a release-operation profile; GitHub permissions remain a limiting control. This is an authority-expansion concern, not evidence of successful unauthorized mutation or package compromise.

Trust Boundaries and Controls

  • observed — The wrapper separates caller-selected intent from verified repository identity. It rejects standard forwarded repository overrides, requires literal API endpoints under the selected repository prefix, rejects literal double-dot segments, and checks read-back names and URLs before dispatch. These inspected checks do not establish coverage of every alternate CLI argument or encoded-path representation.

Resilience and Maintainability Implications

  • observed — Authorization and read-back failures exit before dispatch. Each invocation performs one mutation dispatch without a local retry, deduplication, postcondition check, rollback, or cleanup protocol. This lifecycle is unchanged by the PR; interrupted or repeated remote mutations remain dependent on GitHub behavior.

Hardening Proposals

  • proposed — If these repositories are intended only for the described release actions, consider explicit operation profiles for fork synchronization and upstream PR creation, backed by appropriately limited credentials. This would narrow the intended authorization expansion rather than repair a demonstrated bypass.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: allowing the winget-pkgs fork and upstream in gh-safe.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit d5ef504 into main Oct 3, 2026
4 checks passed
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