T09 · Insecure Skill Coding Practices
Error
- Location
- start-tunnel.sh:148
- Finding
- Password-Bearing Remote-Control URL Is Persisted and Disclosed<![CDATA[ ## Vulnerability Details **File Location**: `start-tunnel.sh:148-191`; duplicated in generated code at `install.sh:476-519`; exposed by `status.sh:37-53` **Vulnerability Type**: Sensitive credential exposure through URLs, files, Agent workspace state, and command output **Risk Level**: High ### Complete Code Snippet ```bash # Build noVNC URL with auto-login password if [ -n "$VNC_PASSWORD" ] && [ "$VNC_PASSWORD" != "(your Mac password)" ]; then NOVNC_URL="${TUNNEL_URL}/vnc.html?password=${VNC_PASSWORD}&autoconnect=true" else NOVNC_URL="${TUNNEL_URL}/vnc.html?autoconnect=true" fi echo "" echo "=========================================" echo "✅ TUNNEL ACTIVE!" echo "" echo "🔗 Link: $NOVNC_URL" echo "🔐 Protected by: Google OAuth ($ALLOWED_EMAIL)" echo "" echo "Open from your phone or any browser!" echo "You'll need to login with your Google account." echo "=========================================" echo "" # Save to config.json cat > $CONFIG_FILE << CONF { "novncUrl": "$NOVNC_URL", "tunnelUrl": "$TUNNEL_URL", "allowedEmail": "$ALLOWED_EMAIL", "cdpUrl": "http://localhost:9222", "updatedAt": "$(date -Iseconds)" } CONF # Update TOOLS.md if [ -f "$TOOLS_FILE" ]; then # Remove old Browser Control section grep -v "## Browser Control" "$TOOLS_FILE" | grep -v "noVNC URL:" | grep -v "Protected by:" | grep -v "Send the link" | grep -v "When you need the user" | grep -v "Google OAuth" > "$TOOLS_FILE.tmp" || true mv "$TOOLS_FILE.tmp" "$TOOLS_FILE" fi cat >> "$TOOLS_FILE" << TOOLS ## Browser Control When you need the user to login, 2FA, captcha, or any manual verification: - noVNC URL: $NOVNC_URL - Protected by: Google OAuth ($ALLOWED_EMAIL) Send the link and wait for the user to say "done". The user will need to login with their Google account. TOOLS ``` The status script further discloses the stored value: ```bash # Get URL if available if [ -f "$SKILL_DIR/config.json" ]; then URL=$(jq -r '.novncUrl' "$SKILL_ ...[truncated 2417 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not include the VNC password in the URL. Present a password prompt only after the user passes OAuth. - Prefer a short-lived, single-use session capability rather than a reusable VNC password. - Create sensitive files under `umask 077` and explicitly apply `chmod 600` to `config.json`. - Do not write credentials or credential-bearing URLs into `TOOLS.md` or other persistent Agent context. - Make `status.sh` return only service state and a redacted endpoint, never the password-bearing URL or email unless explicitly requested. - Remove or securely overwrite stale session data when the tunnel stops. - Avoid printing secrets to terminal output and ensure application logs redact query parameters. - Rotate the VNC password for every tunnel session rather than once during installation. ]]>
