Skip to content

fix(security): enforce credential and filesystem trust boundaries - #861

Merged
runkids merged 4 commits into
mainfrom
runkids/fix-security-boundaries
Nov 11, 2026
Merged

runkids merged 4 commits into
mainfrom
runkids/fix-security-boundaries

Conversation

@runkids

@runkids runkids commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal
  • Approved feature or large change

Linked Issue

None — fixes the three trust-boundary defects found in the repository security review.

Summary

 remote credentials
- authorize by provider-looking hostname
+ authorize canonical/configured HTTPS origins; preserve host policy in every consumer
+ strip credentials on cross-origin redirects; guard browser search/preview requests

 repository discovery
- accept fallback paths with linked parent components
+ require real .agents/skills components, preserving intentionally followed roots

 discovered agent install/update
- write destination before audit
+ stage and audit, then publish with rooted atomic writes

Update the built-in install reference, all five documentation locales, and the security-boundaries runbook. Preserve the explicitly broad HTTPS SKILLSHARE_GIT_TOKEN fallback.

Evidence

  • Before: provider-name heuristics selected credentials for unrelated origins; fallback discovery checked only the final directory; discovered-agent writes could follow repository-planted destination links before audit.
    After: regressions cover credential lookalikes, scheme/port boundaries, redirects, browser cross-site requests, fallback aliases, destination links, audit rejection, dry runs and followed roots.
  • Before: fresh pre-PR review found configured CNB/Gitea policy dropped by grouped skill discovery and tracked-agent updates. New private-Git regressions failed for both providers (clone authentication failure / unchanged checkout reported as current).
    After: preserve the policy at both boundaries and verify updated file contents and tracked revision.
  • Passed during implementation: complete suites for all 12 affected Go packages and CLI integration tests; website production builds for en, ja, ko, zh-Hans and zh-Hant.
  • On the refreshed main baseline: make docs-check fmt-check lint, all 138 Herdr tests, and focused security regressions passed. Full internal/install and cmd/skillshare suites also cover the final policy-propagation fixes.
  • Five-pass pre-PR review completed; confirmed consumer regressions fixed with red/green behavior tests. Codex first-round review completed without findings at 19361f5; the subsequent task-owned change only stabilizes the private-Git test fixture.
  • Windows CI exposed a fixture-only CRLF/configuration mismatch. Reproduced it locally with core.autocrlf=true, pinned the fixture checkout configuration, and verified the same test turns green without weakening assertions. Native Windows CI then passed.
  • Integrated current main (fix(project): keep config.yaml true after reinstall, uninstall and fresh-clone installs #860) because it overlaps the search/update/install consumers. On exact integrated head d8f9f1060f09f9e0d5b131274f09218e5891c943, all eight executed checks passed: quality check, unit tests, Windows tests, Ubuntu/macOS integration, online/offline Docker sandbox, and redteam. redteam-signal was skipped by the workflow condition. See the final CI run.

Merge Danger

Door: two-way

No persisted format migration. Reverting restores the previous security weaknesses.

Blast Radius: authentication

Provider tokens no longer authorize self-hosted services merely because their names resemble a provider. Explicit CNB/Gitea host configuration remains supported; other enterprise hosts should use host-scoped Git credentials or an invocation-scoped generic token. Unsafe linked fallback directories and agent destinations are deliberately rejected.

Not covered

  • Full make check did not pass in the strict local sandbox: the untouched internal/mcp/TestLiveStdioTimeoutKillsProcessGroup helper exited with a Go deadlock before its expected timeout. No tests were disabled or weakened; CI is tracked separately.
  • Native Windows unit tests passed in CI. Full/basic-user UTM link runbooks were not run locally.
  • Security reproductions used dummy credentials and isolated local Git transport; no deployed endpoints were security-probed. No dashboard visual changes.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — targeted checks pass; full local check has the untouched MCP sandbox failure described above
  • No unrelated changes in the diff
  • Scope is focused — credential and filesystem trust-boundary fixes from one security review

Authorize provider tokens against trusted HTTPS origins and carry configured host policy through every Git and download consumer. Reject cross-site remote reads and strip credentials on cross-origin redirects.

Refuse linked agent fallback directories and publish discovered agents through rooted atomic writes after audit so repository content cannot redirect installation outside the source.
Grouped skill discovery and tracked-agent updates dropped the explicit CNB/Gitea host policy before authenticating. Preserve it at both boundaries so private updates continue to work without restoring hostname-based credential trust.

Add local authenticated Git regressions for both providers that verify published content and tracked revision advancement.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T14:46:53.129015Z 19361f5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The private transport fixture replaces global Git configuration after the tracked checkout is cloned. A Windows autocrlf default can leave CRLF bytes that become dirty once the fixture switches configuration, so the update is skipped before authentication.

Pin autocrlf on the test checkout itself. The same regression fails under a CRLF default before this change and passes afterward without weakening content or revision assertions.
@runkids
runkids merged commit c040917 into main Nov 11, 2026
9 checks passed
@runkids
runkids deleted the runkids/fix-security-boundaries branch November 11, 2026 15:22
runkids added a commit that referenced this pull request Nov 11, 2026
#861 and #863 added a parseOpts parameter to runCheck and renderAgentCheck, the same functions that take exitCode here. Keep both parameters at every call site.
runkids added a commit that referenced this pull request Nov 11, 2026
Point every README release notice at check --exit-code and check --all, the headline CI changes in 0.30.6, and credit tomerzcod7 (#852) and ErykJakubik (#858), whose reports led to the git hook and project config fixes.

The security change in #861 added its provider-token paragraph twice to the install command page in all five locales; keep one copy.

The website builds for all five locales and context validation passes.
runkids added a commit that referenced this pull request Nov 11, 2026
The generated entry listed commit subjects only. Describe each change by what users see, add CI examples for check --exit-code, and give a migration note for self-hosted servers, which no longer receive provider tokens after #861.
runkids added a commit that referenced this pull request Nov 11, 2026
* chore(main): release 0.30.6

* chore(release): synchronize release metadata

* docs(changelog): write user-facing notes for 0.30.6

The generated entry listed commit subjects only. Describe each change by what users see, add CI examples for check --exit-code, and give a migration note for self-hosted servers, which no longer receive provider tokens after #861.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Willie <[email protected]>
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