.maestro/playbooks/2026-03-29-Issues-Triage-3-29-2026/Phase-06-Security-Fixes.md
This phase addresses 5 security issues spanning command injection in CI, arbitrary file write via settings, port collision data leakage, and permission bypass. While none are remotely exploitable (all require local access or CI write permissions), they represent real risk vectors: the GitHub Actions injection could compromise the CI pipeline, and the file write vulnerability could be exploited by malicious CLAUDE.md instructions.
Fix the GitHub Actions command injection vulnerability (issues #1285, #1521). The workflow file likely interpolates user-controlled input (PR title, branch name, or issue body) directly into a run: step without sanitization. To fix:
ls .github/workflows/ and read each .yml file${{ github.event.pull_request.title }}, ${{ github.event.issue.title }}, ${{ github.event.comment.body }}, ${{ github.head_ref }}, or similar github.event.* expressions inside run: blocksenv: block at the step or job level (e.g., env: PR_TITLE: ${{ github.event.pull_request.title }}) and reference as $PR_TITLE in the run: block — this prevents shell metacharacter injectionactions/github-script steps that pass user input to exec.exec() or child_processclaude.yml workflow specifically — Claude Code GitHub Actions may pass PR context to Claude, which could include injection payloads. Ensure any Claude-generated output that feeds back into shell commands is sanitized Fix the arbitrary file write via watch.context.path setting (issue #1204). The watch.context.path setting in ~/.claude-mem/settings.json allows specifying a custom path for the AGENTS.md context file, but there is no path validation. A malicious CLAUDE.md could instruct claude-mem to write to sensitive locations. To fix:
watch.context.path or context.path in settings handling: grep -r "context.path\|contextPath\|context_path" src/fs.realpathSync)~/.claude-mem/)/etc/, /usr/, ~/.ssh/, ~/.claude/, Windows system directories.. traversal components after normalizationcwd or within ~/.claude-mem/. Any other path is rejected with an error logisPathSafe(targetPath: string, allowedRoots: string[]): boolean utility in src/utils/Fix port collision data leakage between unrelated claude-mem instances. When two users or two projects on the same machine both try to use port 37777, the second instance connects to the first's worker and can read/write that project's memory data. To fix:
src/shared/SettingsDefaultsManager.ts for how CLAUDE_MEM_WORKER_PORT is resolvedsrc/services/infrastructure/HealthMonitor.ts isPortInUse() and src/services/worker-service.ts ensureWorkerStarted() for the existing port conflict handling/api/health response, and in ensureWorkerRunning(), compare the running worker's project with the hook's projectCLAUDE_MEM_SHARED_WORKER=true is not set, log a warning: "Port 37777 is in use by project '<other_project>'. Set CLAUDE_MEM_WORKER_PORT to a different port in settings.json to avoid data leakage."CLAUDE_MEM_WORKER_PORT in their ~/.claude-mem/settings.jsonAudit hook execution for permission and input validation:
src/cli/hook-command.ts to understand how hook input (JSON from stdin) is parsed and validatedsrc/hooks/hook-response.ts for how hook output is structuredsrc/utils/tag-stripping.ts for the <private> tag stripping implementationexecSync, spawn, or template literals that get executed<private> tag stripping is applied early enough (before any storage or transmission) and cannot be bypassed by nested tags (<private><private>...</private>...</private>)files_read, files_modified arrays) are not used for file system operations without validationsrc/supervisor/env-sanitizer.ts to verify that CLAUDECODE_* and CLAUDE_CODE_* environment variables are properly stripped before subprocess spawning — confirm no API keys leak to chroma-mcp or other childrenWrite tests for security fixes:
isPathSafe() rejects ../../../etc/passwd, symlinks to /etc/, paths outside allowed roots, and Windows UNC pathsANTHROPIC_API_KEY, CLAUDECODE_SESSION, and similar vars are stripped from child process environmentRun build and verify:
npm run build-and-syncexecSync( or exec( with string concatenation (potential injection)eval( (code injection)execAsync calls