| 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 |
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.
- Add
&& isWorkspaceTrustedto thewhenexpression formdsmith.kinds.resolveandmdsmith.kinds.whyin editors/vscode/package.json lines 125-130. - Add an
isTrusted()early-return guard torunKindsResolveandrunKindsWhyin editors/vscode/src/commands/kinds.ts — matching the pattern in fix-workspace.ts:62 and init.ts:23. - Pass
isTrustedthrough the wiring.ts call sites at lines 829 and 838 in editors/vscode/src/wiring.ts.
- Add a trust check in the
mdsmith-rule:content provider in editors/vscode/src/wiring.ts. Trust gate is an explicitif (!isTrusted()) return Promise.resolve("")boundary guard at the top ofprovideTextDocumentContent, matching the KINDS_SCHEME pattern.fetchRuleDocContentandprovideRuleDocContentare pure data-fetching functions with no trust coupling; trust is enforced at the wiring boundary.
-
mdsmith.kinds.resolveandmdsmith.kinds.whyare hidden in the palette in an untrusted workspace. -
runKindsResolveandrunKindsWhyreturn early whenisTrusted()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 runreports no issues (environment constraint: tools/go.mod requires Go 1.25.8+; golangci-lint skipped;go vet ./...passes)