T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Hardcoded Shared API Credential Enables Unauthorized Task Management
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This task-management skill is mostly coherent, but it publishes a shared API key and encourages persistent task polling with mutating task actions, so users should review it carefully before installing.
Install only in an environment where the localhost OpenTask service is trusted and isolated. Rotate the published API key, replace it with a runtime secret, require explicit confirmation for write actions, and do not enable HEARTBEAT polling unless task contents are validated and treated as untrusted data.
SKILL.md:20Hardcoded Shared API Credential Enables Unauthorized Task Management
SKILL.md:52Heartbeat Workflow Executes Tasks from an Insufficiently Trusted Control Channel
SKILL.md:15Authentication Credential and Task Data Are Sent over Plaintext HTTP
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
# 获取待执行任务
TASKS=$(curl -s -H "X-Bot-Key: hope-bot-apikey-2026-0424" \
"http://127.0.0.1:8090/api/tasks/pending?assigned_to=anna")
# 解析任务数量
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "有 $COUNT 条待执行任务"
# 开始执行第一条任务
TASK_ID=$(echo "$TASKS" | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['id'])")
curl -X PUT -H "X-Bot-Key: ..." "http://127.0.0.1:8090/api/tasks/$TASK_ID/start"
else
echo "HEARTBEAT_OK"
fi
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "有 $COUNT 条待执行任务"
# 开始执行第一条任务
TASK_ID=$(echo "$TASKS" | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['id'])")
curl -X PUT -H "X-Bot-Key: ..." "http://127.0.0.1:8090/api/tasks/$TASK_ID/start"
else
echo "HEARTBEAT_OK"
fi
The documentation embeds what appears to be a live API credential (X-Bot-Key: hope-bot-apikey-2026-0424) and pairs it with a reachable local service endpoint. Any actor with access to this skill content can reuse the key to query or mutate tasks, making this a credential exposure issue rather than harmless example text.
The trigger phrases include broad everyday expressions such as '创建任务', '完成任务', and '任务管理', which can cause accidental invocation during normal conversation. Because this skill performs state-changing operations, overbroad activation materially increases the chance of unintended task creation or status changes.
The skill documentation directly discloses a hardcoded API key and also exposes internal infrastructure details, including a private database host and port. Anyone with access to the skill can reuse the credential to query or mutate task data, and the internal topology disclosure lowers the barrier for further lateral movement or targeted attacks.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -H "X-Bot-Key: hope-bot-apikey-2026-0424" \
"http://127.0.0.1:8090/api/tasks/pending?assigned_to=anna"
The skill documents create/start/complete operations without warning that these actions modify shared system state. In this context, silent state mutation is risky because users or agents may invoke examples as if they were harmless lookups, causing unauthorized or accidental workflow changes.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "有 $COUNT 条待执行任务"
# 开始执行第一条任务
TASK_ID=$(echo "$TASKS" | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['id'])")
curl -X PUT -H "X-Bot-Key: ..." "http://127.0.0.1:8090/api/tasks/$TASK_ID/start"
else
echo "HEARTBEAT_OK"
fi
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
TASK_ID=$(echo "$TASK" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
# 2. 开始执行
curl -X PUT -H "X-Bot-Key: ..." "http://127.0.0.1:8090/api/tasks/$TASK_ID/start"
# 3. 执行任务逻辑...
The API examples show authentication secrets directly in plaintext and provide no warning against copying, committing, or sharing them. This increases the chance of credential leakage through logs, screenshots, repositories, shell history, or downstream LLM/tool outputs.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
所有 API 请求需要携带 X-Bot-Key 请求头:
curl -H "X-Bot-Key: hope-bot-apikey-2026-0424" "http://127.0.0.1:8090/api/tasks"
The markdown describes retry and cancel endpoints that change task state, including resetting failed tasks to pending and cancelling pending or running tasks, but it provides no warning about operational impact or irreversibility considerations. Under SQP-2 for markdown files, behaviors that can affect user data or system integrity should be accompanied by explicit warnings so users understand the consequences before invoking them.
The file's operational instructions and API descriptions are presented in Chinese throughout, while the document does not offer an alternate language, user opt-in, or a documented region-specific justification. SQP-3 applies to all file types and flags forced language or locale constraints when no choice or rationale is provided.