T09 · Insecure Skill Coding Practices
- Location
SKILL.md:82- Finding
Unsafe User-Prompt Interpolation Enables Shell and JavaScript Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is purpose-aligned image automation, but it gives the agent broad control of a logged-in daily Brave browser and includes unsafe prompt-insertion instructions.
Review before installing. Use this only if you are comfortable letting the agent control an already-logged-in Brave session through remote debugging. Prefer a dedicated browser profile or isolated automation browser, avoid untrusted prompt text until prompt encoding is fixed, and confirm any Feishu destination before sending generated media.
SKILL.md:82Unsafe User-Prompt Interpolation Enables Shell and JavaScript Injection
SKILL.md:4Full CDP Control of the User's Daily Browser Violates Least Privilege
The skill does not prominently warn that it will attach to and operate the user's already logged-in daily Brave session shared with another skill. That omission is dangerous because the browser context may contain sensitive authenticated data, cookies, open tabs, and cross-site state beyond chatgpt.com, so the user may not realize they are granting control over a live personal session.
The skill performs shell execution, browser automation, and local network access to a shared browser debug port, but it declares no explicit tool scope or permission boundaries. This creates a capability/consent gap: an orchestrator or user may invoke the skill without understanding that it can control a logged-in browser session and run local commands.
The invocation criteria are broad enough to catch generic image-related requests, increasing the chance this skill is selected when a safer or less-privileged image workflow would suffice. Because the skill drives a logged-in shared browser session, over-selection materially increases unnecessary exposure to authenticated web state and browser-side side effects.
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.
# 通过 CDP 创建新标签页
import json, urllib.request, asyncio, websockets
info = json.loads(urllib.request.urlopen("http://localhost:9222/json/version").read())
ws_url = info.get("webSocketDebuggerUrl")
async def create_tab():
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"eval", tab_id, expr]
if await_promise:
cmd.append("--await-promise")
r = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
if r.returncode != 0:
raise RuntimeError(f"cdp_exec failed: {r.stderr.strip() or r.stdout.strip()}")
return r.stdout.strip()