Skip to content

fix(install-gate): triage the marketplace a claude plugin install adds - #634

Merged
sandstream merged 2 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-plugin-gate
Oct 29, 2026
Merged

sandstream merged 2 commits into
mainfrom
claude/web-kit-status-sync-p6fg9a-plugin-gate

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Found while researching the cache-thermo Claude Code mod (sandstream/kit-research#108).

Problem

Measured on main (1353deb) by feeding kit gate-bash the PreToolUse payload:

Command Before
npm install left-pad exit 2, blocked pending triage
claude plugin install cache-thermo --marketplace stilero/mods-marketplace exit 0, silent

A Claude Code plugin's hooks module runs inside the agent. The mod examined in #108 drops prompts, resubmits text with asUser: true and sends billed $.model.fork requests. That is more authority than most npm packages, yet the gate covered npx skills add and not claude plugin ….

Change

src/install-gate-repos.ts (new) holds claudePluginInstall, wired into scanSegment. Adding a marketplace is the trust decision, so that is what is triaged:

Command Result
claude plugin marketplace add <src>, claude plugin install <p> --marketplace <src> (also --marketplace=, plugins) GitHub <src> in any spelling → github:owner/repo triage ref
same, with a local path skipped (the user's own code)
same, with another host or a …/marketplace.json URL unverifiable → blocked
claude plugin install <p>@<marketplace> not re-gated: the marketplace was triaged when it was added
list, validate, remove, --plugin-dir not an install

/plugin install typed inside Claude Code is a slash command and never reaches a Bash hook. The CHANGELOG says it is not covered.

install-gate.ts is frozen at 1339 lines, so ownerRepoArg moved to the new module, where the skills and plugin paths share it. It is re-exported unchanged, and install-gate.ts drops to 1287 lines.

Verified

  • src/install-gate-repos.test.ts runs through parseInstallCommand, the gate's own entry:
    • four GitHub spellings;
    • the --marketplace= form;
    • plugin installs behind && and inside sh -c;
    • fail-closed sources;
    • the non-installs.
  • Mutation: disabling the matcher fails 3 of the 4 tests.
  • kit gate-bash after the change:
    • the --marketplace stilero/mods-marketplace install is now exit 2, blocked pending repo triage (here the triage hit a 403 because this session cannot reach the GitHub API);
    • cache-thermo@mods-marketplace is still exit 0.
  • Full npm test (7168 tests, 0 fail), eslint (no new findings), prettier, adr check, and kit standards --enforce with the pinned tools.

Generated by Claude Code

kit gate-bash let 'claude plugin install <p> --marketplace <repo>' and 'claude plugin marketplace add <repo>' through silently (exit 0) while it gated 'npx skills add'. A plugin's hooks module runs inside the agent: it can drop prompts, submit text as the user and send billed model requests. Adding a marketplace is now triaged like skills add: a GitHub repo becomes a github: ref, a local path is skipped, any other source is unverifiable (blocked). Installing from an already-added marketplace is not re-gated. ownerRepoArg moves to src/install-gate-repos.ts with the new matcher, re-exported unchanged; install-gate.ts shrinks under its frozen size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

CHANGELOG: kept this PR's Security entry and main's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

Copy link
Copy Markdown

Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published.

@sandstream
sandstream merged commit bb7be52 into main Oct 29, 2026
26 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a-plugin-gate branch October 29, 2026 12:23
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.

2 participants