T09 · Insecure Skill Coding Practices
- Location
scripts/subagent-health.py:21- Finding
Unbounded MCP Input Persisted to Local State
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a local Claude Code MCP monitor with some implementation and disclosure weaknesses, but no evidence of hidden exfiltration, privilege escalation, or destructive behavior.
Install only if you are comfortable with a local MCP server storing subagent names and task descriptions on disk under ~/.claude. Avoid putting secrets or sensitive customer data in task descriptions, and treat duplicate-detection and token-waste numbers as incomplete heuristics rather than audited measurements.
scripts/subagent-health.py:21Unbounded MCP Input Persisted to Local State
The skill description understates or misstates actual behavior by omitting persistent local state access and overstating exposed duplicate-detection functionality. Security-relevant behavior mismatches are dangerous because users and reviewers make trust decisions based on the declared purpose; hidden persistence in ~/.claude can enable silent data retention, unexpected state manipulation, or operational confusion.
Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.
Add to ~/.claude/mcp.json:
{
The skill exposes code-backed behavior with file-write capability but does not declare any tool scope, permissions, or allowed-tools constraints. This creates a transparency and least-privilege failure: users may install or invoke the skill without realizing it persists data locally, increasing the chance of unintended filesystem modification and making abuse harder to detect.
The description promises real-time tracking with actionable alerts, but get_fleet_summary fabricates estimated_waste_tokens as a fixed 18% of total tokens and waste_percentage as a constant 18, without tying them to observed idle loops or measured events. This creates a mismatch between claimed monitoring semantics and the actual heuristic-only implementation.
The manifest says the skill detects duplicate task spawns, but spawn_with_tracking only hashes the task description and stores metadata in self.tasks without incrementing counts, checking for prior duplicates, or surfacing any duplicate-related alert. As implemented, duplicate tracking behavior is not present even though it is advertised as a core capability.
This code persistently writes agent and task state to ~/.claude/subagent-health-state.json, which affects user data on disk. While the module docstring names the tool, there is no confirmation prompt, comment, or user-facing notice near the write path explaining that invocation will create and update a local state file.