Skip to content

fix(plugins): validate marketplace plugin names before path joins - #221

Merged
BunsDev merged 1 commit into
mainfrom
fix/marketplace-path-boundary
Oct 15, 2026
Merged

BunsDev merged 1 commit into
mainfrom
fix/marketplace-path-boundary

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 15, 2026

Copy link
Copy Markdown
Member

Summary

The exported marketplace install and uninstall functions now reject path-shaped plugin names before joining them onto the plugins directory.

Context

  • Related request: Coven Code surface-reduction goal, unit 30 ("Marketplace lexical path boundary" in the surface inventory ledger). Companion to the manifest-name boundary in fix(plugins): reject plugin names that are not a single path component #220 (unit 28).
  • Scope: crates/plugins/src/marketplace.rs.
  • Non-goals: destination symlinks, Windows reserved-name collisions, HTTP status and archive-failure fallback are separate. No workspace production caller uses these exported functions today. This is not a full filesystem containment claim.

Changes

  • The existing private plugin_install_dir helper returns Result and rejects empty, all-dot or all-space names, /, \, : and NUL before joining.
  • install validates non-URL input before the registry lookup, and validates the final entry before creating directories or downloading.
  • uninstall validates before any filesystem access.
  • Public signatures are unchanged, and ordinary Unicode, dotted, underscored and spaced names are still accepted.
  • In-file tests cover the shared helper and the public uninstall against an owned temp directory marker.

Surface: production +8 net lines, tests +63; no dependency or lock change.

Validation

  • RED: 1 pass, 2 fail. The real public uninstall removed an owned temp directory marker, and invalid pure names were accepted. No HOME, env or network writes.
  • cargo test --locked -p claurst-plugins: 18 passed, 0 failed.
  • cargo fmt --all -- --check, cargo check --workspace --locked, cargo clippy --workspace --all-targets --locked -- -D warnings: pass on this branch (current main).
  • git diff --check: clean.
  • cargo test --workspace: hosted Rust CI.
  • Independent spec/quality review accepted the final diff.

PR Readiness

  • Diff is limited to the intended file.
  • Generated files were not edited by hand.
  • User-facing docs: docs/plugins.md already distinguishes name from marketplace_id.
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks: install ordering is source-reviewed, not runtime-tested against a registry/download.

The exported marketplace install and uninstall functions joined raw
plugin names onto the plugins directory; uninstall with a path-shaped
name removed a directory outside it. Make the existing private
plugin_install_dir helper return Result and reject empty, all-dot or
all-space names, separators, colon and NUL before joining. Install
validates non-URL input before the registry lookup and the final entry
before creating directories or downloading; uninstall validates before
touching the filesystem. Public signatures and ordinary names are
unchanged.

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 15, 2026 7:37am UTC

Request Review

@BunsDev
BunsDev merged commit 36546d8 into main Oct 15, 2026
5 checks passed
@BunsDev
BunsDev deleted the fix/marketplace-path-boundary branch October 18, 2026 07:50

This branch was successfully deployed

1 active deployment
Preview — 1dbb202a Deployed Oct 15, 2026 by vercel[bot]
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