T09 · Insecure Skill Coding Practices
- Location
SKILL.md:1277- Finding
Shell Command Injection Through User-Controlled Model Identifiers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a mostly coherent guide for using a powerful coding CLI, but it includes under-scoped examples that can grant broad remote control, filesystem, shell, and persistent configuration authority.
Review this skill before installing if you intend to use Ex-Coder with real repositories or credentials. Keep MCP filesystem roots project-scoped, avoid the / example, pin MCP packages instead of using unreviewed npx -y resolution, do not expose the HTTP API beyond trusted local access, prefer approval prompts over auto-approve, and do not let agents write user-provided values into shell startup files.
SKILL.md:1277Shell Command Injection Through User-Controlled Model Identifiers
SKILL.md:1300Persistent Command Injection Through Shell Profile Modification
SKILL.md:541Automatic Execution of Unpinned MCP Packages Through npx
SKILL.md:559Excessive Root Filesystem Access Granted to an MCP Server
Exposing a memory purge command in an autonomous agent skill can be abused to delete stored context, auditability, or safety-relevant state. While memory management is a legitimate feature, presenting destructive memory operations without guardrails or warnings creates integrity and accountability risks.
Command Description
:memory stats Show memory usage statistics
:memory inspect Inspect memory contents
:memory purge Purge memory cache
Taskfiles - :taskfile
Command Description
:taskfile new Create a new taskfile
A POST /message endpoint that sends messages to the agent is effectively a remote command surface. Without strong warnings and secure defaults, exposing this endpoint can let unauthorized parties drive the agent, potentially causing data disclosure, file modification, or command execution through downstream tool use.
GET /session/turns Session conversation
GET /config Configuration
GET /events SSE event stream
POST /message Send message to agent
Authentication:
export EXCODER_SERVER_PASSWORD=secret
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
These commands install the latest released versions of **ex-coder-autonomy** (v3.0.0) and **scrapegoat-ex-coder** (v4.1.3).
**excoder-autonomy** (to run Excoder via :interactive command in Autonomy REPL. Note: it requires valid Anthropic API key in .env file)
**excoder-autonomy-goatmode** (opencode shell) Tip: To make agent live and breathe on the terminal use a conda environment with python 3.11 or higher
# Verify installation
Skill contains patterns that exfiltrate system prompts or internal instructions via tool calls (file writes, network requests, logging).
How:
# Write instruction to file
echo "Implement feature X" > /tmp/task.md
# Run with stdin
The interactive mode section advertises full file, shell, refactoring, and git capabilities without clearly warning that using the feature can execute commands and modify local data. In a skill consumed by agents, this omission increases the chance that users enable a high-privilege mode without understanding the operational risk.
The skill instructs users how to expose an HTTP API with endpoints for session data, configuration, event streams, and message submission, but does not prominently warn that this creates a remote-control and data-exposure surface. If enabled insecurely or without strong authentication/binding, an attacker could access sensitive conversation content or issue agent commands remotely.
The MCP examples include a GitHub token and broad filesystem access, including a sample that points the filesystem server at '/'. This can lead users to grant excessive local file access and embed credentials in configuration, creating a high risk of token leakage and broad unauthorized data exposure if the MCP server or connected agent is compromised.
The skill repeatedly states that Excoder must only be run through sub-agents and labels direct execution in the main context as a critical anti-pattern. However, this example executes excoder directly with Bash(...) rather than delegating through a sub-agent, contradicting the stated operational rule and potentially encouraging the forbidden usage pattern.
The same auto-approve behavior is correctly flagged twice from adjacent matching text. Automatic approval in a powerful coding agent environment creates a meaningful security risk because it permits autonomous execution without an explicit human checkpoint.
--verbose / -v Show log messages Verbose in interactive
--debug / -d Enable debug logging to file Disabled
--port <port> Proxy server port Random (3000-9000)
--no-auto-approve Require permission prompts Auto-approve enabled
--dangerous Disable sandbox Disabled
--monitor Proxy to real Anthropic API (debug) Disabled
--force-update Force refresh model cache Auto (>2 days)
The same auto-approve behavior is correctly flagged twice from adjacent matching text. Automatic approval in a powerful coding agent environment creates a meaningful security risk because it permits autonomous execution without an explicit human checkpoint.
--verbose / -v Show log messages Verbose in interactive
--debug / -d Enable debug logging to file Disabled
--port <port> Proxy server port Random (3000-9000)
--no-auto-approve Require permission prompts Auto-approve enabled
--dangerous Disable sandbox Disabled
--monitor Proxy to real Anthropic API (debug) Disabled
--force-update Force refresh model cache Auto (>2 days)
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
Fix:
export OPENROUTER_API_KEY='sk-or-v1-...'
# Or add to ~/.zshrc or ~/.bashrc
Error 2: Excoder Not Installed
Error:
Earlier sections explicitly say 'NEVER Run Excoder Directly in Main Conversation' and present await Bash("excoder ...") as wrong, yet this example uses await Bash(excoder --model ${model} --stdin < ${instructionFile}). This is an intent/documentation contradiction rather than mere incompleteness, because the file actively prescribes the opposite behavior elsewhere.
The document's central rule is that Ex-Coder should always be used through sub-agents to avoid context pollution, but this implementation example directly shells out to excoder. Because the same file frames direct Bash execution as the primary mistake to avoid, this is a clear documentation-to-example divergence.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
Full README: mcp/excoder/README.md (in repository root)
AI Agent Guide: Print with excoder --help-ai
Model Integration: skills/excoder_usage/SKILL.md (in repository root)
External Links:
Excoder GitHub: https://github.com/ex-coder/ex-coder
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.
Manage long sessions with compaction and forking
Get code intelligence via LSP (diagnostics, symbols, definitions)
Remote control via HTTP API
Extend functionality with MCP servers
🆕 New Features Reference
Comprehensive Command Reference -
Chat Mode - type your goal, then follow-up prompts
No suspicious patterns detected.