Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 2.72 KB

File metadata and controls

66 lines (55 loc) · 2.72 KB
id 2606192014
title Security hardening batch — 2026-06-19 LSP/VS Code audit
status
summary Low-severity Workspace Trust gaps from the 2026-06-19 audit: gate the mdsmith.kinds.resolve/why palette commands and the mdsmith-rule: content provider on isWorkspaceTrusted, matching the pattern already used by the three mutating commands.
model sonnet

Security hardening batch — 2026-06-19 LSP/VS Code audit

Goal

Add Workspace Trust gates to two read-only VS Code paths. Closes S006 and S007 from the 2026-06-19 LSP/VS Code audit report.

S006 (low). mdsmith.kinds.resolve and mdsmith.kinds.why lack isWorkspaceTrusted in their when conditions (package.json:125-130). Their handlers also lack an isTrusted() guard. A hostile .mdsmith.yml can inject text into the virtual document pane.

S007 (low). The mdsmith-rule: TextDocumentContentProvider (wiring.ts:906-910) spawns mdsmith help rule <id> without a trust gate. Risk is very low. The pattern is inconsistent with the trust model.

Tasks

S006 — kinds palette trust gate

S007 — rule-doc content provider trust gate

  • Add a trust check in the mdsmith-rule: content provider in editors/vscode/src/wiring.ts. Trust gate is an explicit if (!isTrusted()) return Promise.resolve("") boundary guard at the top of provideTextDocumentContent, matching the KINDS_SCHEME pattern. fetchRuleDocContent and provideRuleDocContent are pure data-fetching functions with no trust coupling; trust is enforced at the wiring boundary.

Acceptance Criteria

  • mdsmith.kinds.resolve and mdsmith.kinds.why are hidden in the palette in an untrusted workspace.
  • runKindsResolve and runKindsWhy return early when isTrusted() is false.
  • The mdsmith-rule: provider does not spawn in untrusted mode.
  • All existing VS Code extension tests pass.
  • All tests pass: go test ./...
  • go tool golangci-lint run reports no issues (environment constraint: tools/go.mod requires Go 1.25.8+; golangci-lint skipped; go vet ./... passes)