Security & Correctness Fixes
Critical follow-up to v1.0.96's plugin cache self-heal — addresses 7 issues found by parallel agent army review.
Fixes
- Path traversal guard —
installPathfrominstalled_plugins.jsonnow validated to be inside~/.claude/plugins/cache/before creating symlinks. Prevents arbitrary filesystem writes from corrupted registry. - Layer 4 hook registration — global heal hook now registers in
~/.claude/settings.jsonSessionStart. Previously was dead code (Claude Code doesn't auto-discover files in~/.claude/hooks/). - Bundle mode symlink target —
server.tsmid-session heal used wrong directory in bundled mode. Now usespluginRootpattern matching other tools. - Dangling symlink recovery —
lstatSync+unlinkSyncbeforesymlinkSyncin all 3 layers. Previously, a broken symlink at the registry path would silently prevent healing (EEXIST). - Exact key match — uses
=== "context-mode@context-mode"instead ofincludes("context-mode")to prevent matching unrelated plugins. - Clean imports — removed dead
lstatSyncimport, eliminated unnecessary dynamic import. - Test accuracy — tests now verify
.mjsdeployment (not.sh) andsettings.jsonregistration.
Related Claude Code issues
- anthropics/claude-code#46915
- anthropics/claude-code#29074
- anthropics/claude-code#36245
- anthropics/claude-code#45997
Tests
- 13 cache heal integration tests (dangling symlink, path traversal, exact match, settings.json registration)
- 1809 total tests passing, 0 failures