T09 · Insecure Skill Coding Practices
- Location
SKILL.md:67- Finding
Untrusted MCP Endpoint Override Can Exfiltrate API Credentials and Skill Contents
- Content
View full analysis
/dev/null | grep -i "mcp-session-id" | tr -d '\r' | awk '{print $2}') ``` Selected local skill contents are also sent to the configured endpoint at lines 169–176: ```bash SKILL_CONTENT=$(cat "$SKILL_PATH") RESULT=$(curl -sf -X POST "${MCP_URL}" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -H "Authorization: Bearer ${MYSTA_API_KEY}" \ -H "Mcp-Session-Id: ${MCP_SESSION}" \ -d "$(jq -n --arg name "$SKILL_NAME" --arg content "$SKILL_CONTENT" --arg agentId "$AGENT_ID" \ '{jsonrpc:"2.0",id:3,method:"tools/call",params:{name:"mysta_sync_skill",arguments:{agentId:$agentId,skillName:$name,content:$content}}}')") ``` ### Technical Analysis `MYSTA_MCP_URL` is accepted without validating its scheme, hostname, port, or destination. Every MCP request then sends `MYSTA_API_KEY` as a bearer credential to this endpoint. The override can therefore point to an arbitrary HTTP or HTTPS server rather than an approved Mysta service. Although control of an environment variable is required, inherited environment values can originate from shell profiles, wrappers, development containers, automation configuration, or an ...[truncated 1687 chars]- Remediation
View remediation
