T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/assisted-session.sh:440
- Finding
- Unauthenticated noVNC service exposes full browser control on all network interfaces## Vulnerability Details **File Location**: `scripts/assisted-session.sh:440-448`, `scripts/assisted-session.sh:498-528`, and `scripts/open-protected-page.sh:350-365` **Vulnerability Type**: Unauthenticated remote browser access over plaintext transport **Risk Level**: Critical ### Vulnerable Code ```bash if ! pid_running "$(read_pid x11vnc)"; then start_process x11vnc "$LOG_DIR/x11vnc.log" \ env DISPLAY="$display" \ x11vnc -display "$display" -forever -shared -rfbport "$VNC_PORT" -localhost -nopw fi if ! pid_running "$(read_pid websockify)"; then start_process websockify "$LOG_DIR/websockify.log" \ websockify --web="$novnc_root" "0.0.0.0:$NOVNC_PORT" "localhost:$VNC_PORT" fi ``` The main wrapper automatically invokes this assisted-access path: ```bash if printf '%s' "$CHALLENGE_JSON" | grep -q '"hasChallenge": *true'; then assisted_helper start --url "$INITIAL_URL" --origin "$ORIGIN" --session-key "$SESSION_KEY" >/dev/null ASSISTED_STATUS="$(assisted_helper status --url "$INITIAL_URL" --origin "$ORIGIN" --session-key "$SESSION_KEY")" emit_result "needs-user" "open-novnc" "$TARGET_ID" "" "$ASSISTED_STATUS" "challenge" "$CDP_PORT" exit 0 fi if printf '%s' "$LOGIN_JSON" | grep -q '"hasLoginWall": *true'; then assisted_helper start --url "$INITIAL_URL" --origin "$ORIGIN" --session-key "$SESSION_KEY" >/dev/null ASSISTED_STATUS="$(assisted_helper status --url "$INITIAL_URL" --origin "$ORIGIN" --session-key "$SESSION_KEY")" emit_result "needs-user" "open-novnc" "$TARGET_ID" "" "$ASSISTED_STATUS" "login-wall" "$CDP_PORT" exit 0 fi ``` ### Technical Analysis `x11vnc` is started with `-nopw`, explicitly disabling VNC authentication. Although the VNC listener itself is restricted to loopback by `-localhost`, `websockify` forwards it through a listener bound to `0.0.0.0`, making the unauthenticated session reachable through every host network interface. The service pr ...[truncated 2384 chars]
- Remediation
- ## Remediation Suggestions 1. Bind websockify to loopback by default: ```bash websockify --web="$novnc_root" "127.0.0.1:$NOVNC_PORT" "127.0.0.1:$VNC_PORT" ``` 2. Require users to access the service through an authenticated SSH tunnel unless LAN publication is explicitly requested. 3. Remove `-nopw`. Use a strong, randomly generated, short-lived VNC credential or an authenticated reverse proxy. 4. If direct network exposure is required, use TLS, a one-time access token, firewall allowlisting, and explicit user confirmation before binding a public interface. 5. Automatically stop `websockify` and `x11vnc` immediately after successful capture, cancellation, or timeout. 6. Add a short maximum assisted-session lifetime and ensure cleanup occurs through signal traps and failure paths. 7. Do not return a LAN URL unless secure LAN publication was explicitly enabled. 8. Add tests asserting that the default listener is `127.0.0.1`, authentication is enabled, and capture terminates the overlay.
