T09 · Insecure Skill Coding Practices
- Location
SKILL.md:101- Finding
Plaintext Dashboard Token Exposure and Unsafe Network-Sharing Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 101 and 108–113; related usage guidance appears at lines 138, 163–172, 200, and 211
Vulnerability Type: Plaintext bearer-token exposure and insecure authentication configuration
Risk Level: HighVulnerable Code Snippet
markdown | `DASHBOARD_HOST` | 否 | `127.0.0.1` | 绑定地址,设为 `0.0.0.0` 允许局域网访问 | - 所有请求必须携带 token,支持 3 种方式: - URL 查询参数: `?token=未指定` - 请求头: `X-Dashboard-Token: 未指定` - Bearer 认证: `Authorization: Bearer 未指定` - 前端将 token 存入 `localStorage`,页面加载后从 URL 中移除,避免泄露 - 默认绑定 `127.0.0.1`,仅本机可访问;需局域网访问时设 `DASHBOARD_HOST=0.0.0.0`The related LAN-sharing example is:
markdown DASHBOARD_HOST=0.0.0.0 PORT=19195 DASHBOARD_TOKEN=team-shared-key node (请参考skill目录中的脚本文件)text Access URL: http://0.0.0.0:19195/?token=team-shared-keyThe document also explicitly acknowledges the exposure:
markdown 4. **Token 安全性**: token 以明文形式存在于 URL 与 `localStorage`,HTTPS 环境下更安全Technical Analysis
The documented authentication design permits a bearer token to be transmitted as a URL query parameter and stores that token in browser
localStorage. Query-string credentials can be retained in browser history, copied URLs, access logs, monitoring systems, screenshots, and other URL-processing infrastructure. Removing the token from the address bar after page load does not remove copies already recorded during the initial request.A token stored in
localStorageis accessible to JavaScript executing in the dashboard origin. Therefore, any same-origin cross-site scripting flaw or compromised third-party frontend resource could read and exfiltrate it. The package contains no server or frontend implementation, so output escaping, Content Security Policy enforcement, and safe token handling cannot be verified.The documented LAN configuration compounds this weakness by binding the service to all interfaces and advertising an ` ...[truncated 2034 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove query-string token authentication entirely. Reject requests containing credentials in URL parameters.
- For browser access, use a short-lived, cryptographically random session identifier in a cookie configured with
Secure,HttpOnly, andSameSite=Strict. - If authorization headers remain supported for API clients, require HTTPS and avoid persisting bearer tokens in browser storage.
- Do not store authentication credentials in
localStorage. Keep short-lived credentials in protected cookies or ephemeral in-memory state. - Continue binding to
127.0.0.1by default. For remote access, require an authenticated TLS reverse proxy, VPN, or similarly protected tunnel instead of directly exposing the Express service on all interfaces. - Replace the plaintext
http://LAN example with an HTTPS deployment example and prominently warn against sending bearer credentials over unencrypted transport. - Generate high-entropy credentials, enforce expiration and rotation, and provide immediate revocation. Avoid shared static tokens and placeholder examples that resemble deployable secrets.
- Add per-user authentication and authorization if team access is supported, with separate credentials and audit logging for each user.
- Apply restrictive security headers, including an appropriate Content Security Policy, and ensure all values read from
inbox.jsonlandsession.jsonare contextually escaped before rendering. - Supply the actual implementation and automated security tests so authentication, output encoding, URL cleanup, access control, and loopback-only defaults can be independently verified.
