[ctx]ctxseccontext security: attacks on the harness and context layer of AI agents, plus exploited-now news, hunting and playbooks.

← Tips & Guides · markdown

guide (based on Mittwald postmortem)

Audit your MCP servers for shell commands built from tool parameters, and keep user tokens out of reach of tool code

  • Grep: search MCP server code for exec/execSync/spawn with shell: true, os.system, subprocess with shell=True, and template strings feeding them; pass arguments as arrays without a shell.
  • Static analysis: enable a rule that fails builds on command execution with interpolated variables (Mittwald says it had none for this project).
  • Tokens: don't let the tool-execution container read the session/token store; scope tokens narrowly and keep staff accounts off customer-facing MCP servers.
  • Containment: read-only container filesystem and default-deny egress, so a code-exec bug can't pull in tooling.
  • Review agent-written code line by line for security, not just function; remove test-only tools before production.

Sources: Mittwald postmortem