T09 · Insecure Skill Coding Practices
- Location
references/server.md:13- Finding
OpenCode API May Be Exposed to External Networks Without Authentication
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears intended for OpenCode integration, but it includes high-impact server and package-execution guidance that users should review before installing.
Install only if you intend to connect an agent to a trusted OpenCode server. Keep the server bound to 127.0.0.1 unless you add authentication, TLS or a private network, and firewall controls. Disable auto-start if you do not want the skill to launch OpenCode for you. Do not send secrets or confidential private-repo code through this workflow unless the configured OpenCode server and model provider are approved. Pin and review any MCP/plugin packages before enabling them.
references/server.md:13OpenCode API May Be Exposed to External Networks Without Authentication
references/mcp.md:9Unpinned MCP Package Is Downloaded and Executed Automatically Through npx
The skill claims full support for multiple OpenCode subsystems while apparently exposing only limited API wrappers and some undocumented local execution behavior. Overstated capability combined with incomplete disclosure is dangerous because it obscures the true trust boundary between the local host, authenticated developer tools, and the remote OpenCode service.
The skill claims full support for multiple OpenCode subsystems while apparently exposing only limited API wrappers and some undocumented local execution behavior. Overstated capability combined with incomplete disclosure is dangerous because it obscures the true trust boundary between the local host, authenticated developer tools, and the remote OpenCode service.
The skill claims full support for multiple OpenCode subsystems while apparently exposing only limited API wrappers and some undocumented local execution behavior. Overstated capability combined with incomplete disclosure is dangerous because it obscures the true trust boundary between the local host, authenticated developer tools, and the remote OpenCode service.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if (input.tool === "bash" && output.args.command?.includes("rm -rf")) {
throw new Error("已阻擋危險的 rm -rf 命令")
}
if (input.tool === "read" && output.args.filePath?.includes(".env")) {
throw new Error("不允許讀取 .env 檔案")
}
},
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if (input.tool === "bash" && output.args.command?.includes("rm -rf")) {
throw new Error("已阻擋危險的 rm -rf 命令")
}
if (input.tool === "read" && output.args.filePath?.includes(".env")) {
throw new Error("不允許讀取 .env 檔案")
}
},
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
export default async (ctx) => {
return {
"tool.execute.before": async (input, output) => {
const dangerous = ["rm -rf", "git push --force", "DROP TABLE"]
for (const cmd of dangerous) {
if (output.args.command?.includes(cmd)) {
throw new Error(`已阻擋危險命令:${cmd}`)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `bash` | 執行 Shell 指令 | allow |
| `edit` | 精確字串替換修改檔案 | allow |
| `write` | 建立新檔案或覆寫 | allow |
| `read` | 讀取檔案內容(支援行範圍)| allow(.env 除外)|
| `grep` | 正規表示式搜尋內容 | allow |
| `glob` | 萬用字元查找檔案 | allow |
| `list` | 列出目錄內容 | allow |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `bash` | 執行 Shell 指令 | allow |
| `edit` | 精確字串替換修改檔案 | allow |
| `write` | 建立新檔案或覆寫 | allow |
| `read` | 讀取檔案內容(支援行範圍)| allow(.env 除外)|
| `grep` | 正規表示式搜尋內容 | allow |
| `glob` | 萬用字元查找檔案 | allow |
| `list` | 列出目錄內容 | allow |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `bash` | 執行 Shell 指令 | allow |
| `edit` | 精確字串替換修改檔案 | allow |
| `write` | 建立新檔案或覆寫 | allow |
| `read` | 讀取檔案內容(支援行範圍)| allow(.env 除外)|
| `grep` | 正規表示式搜尋內容 | allow |
| `glob` | 萬用字元查找檔案 | allow |
| `list` | 列出目錄內容 | allow |
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
return self._get(f"/session/{session_id}")
def delete_session(self, session_id: str) -> bool:
"""DELETE /session/{id} — 刪除工作階段"""
return self._delete(f"/session/{session_id}")
def send_message(
The skill advertises and demonstrates capabilities that imply file access, network access, MCP interaction, and shell/process execution, yet it declares no explicit tool scope or permission boundaries. In an agent environment this can lead to over-broad execution authority, making it harder for operators and users to understand or constrain what the skill may do.
The skill explains HTTP API usage but does not warn that prompts, code, or review content may be transmitted to an external or separately hosted OpenCode server. In a code-review workflow this can expose proprietary source, credentials embedded in code, or sensitive business logic to systems outside the immediate runtime.
The PR review workflow references an authenticated GitHub environment and repository access but does not clearly warn that the skill may access repository data and interact with authenticated services. In practice, this can expand the blast radius from local code review into broader exposure of private repository contents or metadata.
The markdown example includes a system prompt instruction, "只分析不修改,用繁體中文回覆," which mandates a specific language/locale. Under the policy, forcing a language without user opt-in is a natural-language policy violation unless clearly justified or optional.
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
import requests
r = requests.get("http://127.0.0.1:4096/global/health")
print(r.json()) # {"healthy": true, "version": "1.x.x"}
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
import requests
r = requests.get("http://127.0.0.1:4096/global/health")
print(r.json()) # {"healthy": true, "version": "1.x.x"}
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
import requests
r = requests.get("http://127.0.0.1:4096/global/health")
print(r.json()) # {"healthy": true, "version": "1.x.x"}
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
import requests
r = requests.get("http://127.0.0.1:4096/global/health")
print(r.json()) # {"healthy": true, "version": "1.x.x"}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
r = requests.post("http://127.0.0.1:4096/session", json={"title": "PR Review"})
sid = r.json()["id"]