Skip to content

Hardening local defaults#224

Merged
ajmallesh merged 2 commits intoKeygraphHQ:mainfrom
ajmallesh:security/tighten-docker-env-isolation
Mar 7, 2026
Merged

Hardening local defaults#224
ajmallesh merged 2 commits intoKeygraphHQ:mainfrom
ajmallesh:security/tighten-docker-env-isolation

Conversation

@ajmallesh
Copy link
Collaborator

Summary

  • Pin Playwright MCP to fixed version — replaces @latest with @0.0.68 to prevent supply chain risk from unpinned runtime npx fetches
  • Restrict MCP subprocess environment to allowlist — replaces full process.env spread with explicit forwarding of only PATH, HOME, NODE_PATH, DISPLAY, and XDG vars. API keys and secrets no longer leak to the Playwright subprocess
  • Add path traversal guard to include directives — validates resolved paths stay within the prompts directory, preventing directory escape via crafted include paths
  • Harden Docker network exposure — binds all exposed ports (Temporal gRPC, Web UI, router) to 127.0.0.1 and removes redundant ipc:host setting since shm_size already covers Chromium shared memory needs
  • Document prompt injection risk — adds a disclaimer to README about the inherent risk of scanning untrusted repositories with AI-powered code analysis

- Pin @playwright/mcp to 0.0.68 instead of @latest to prevent supply chain risk
- Restrict MCP subprocess env to allowlist (PATH, HOME, NODE_PATH, DISPLAY, XDG_*) instead of spreading process.env
- Add path traversal guard to @include() directive in prompt templates
- Bind all Docker ports to 127.0.0.1 to prevent network exposure
- Remove ipc: host — shm_size: 2gb already covers Chromium shared memory needs
- Add prompt injection disclaimer for untrusted repositories to README
@ajmallesh ajmallesh changed the title security: tighten Docker isolation and subprocess env Hardening local defaults Mar 7, 2026
@ajmallesh ajmallesh merged commit 17df89a into KeygraphHQ:main Mar 7, 2026
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.

2 participants