T09 · Insecure Skill Coding Practices
Error
- Location
- docker/entrypoint.sh:61
- Finding
- Externally Routed VSCode and VNC Services Disable Authentication<![CDATA[ ## Vulnerability Details **File Location**: `docker/entrypoint.sh:61-77`; externally exposed by `docker/devbox-init.sh:86-103` and `docker/devbox-init.sh:151-184` **Vulnerability Type**: Unauthenticated remote development environment **Risk Level**: Critical ### Vulnerable Code ```bash if [ "${ENABLE_VNC:-false}" = "true" ]; then VNC_PORT=5900 x11vnc -display :1 -rfbport "${VNC_PORT}" -shared -forever -nopw -localhost & websockify --web=/usr/share/novnc "${NOVNC_PORT}" "localhost:${VNC_PORT}" > /dev/null 2>&1 & echo "[devbox] noVNC ready on port ${NOVNC_PORT}" fi if [ "${ENABLE_VSCODE:-false}" = "true" ]; then "${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server" \ --host 0.0.0.0 \ --port "${VSCODE_PORT}" \ --without-connection-token \ --default-folder /workspace \ > /dev/null 2>&1 & echo "[devbox] VSCode ready on port ${VSCODE_PORT}" fi ``` The services are subsequently assigned externally reachable hostnames: ```bash cat > "${CF_CONFIG_DIR}/config.yml" << CFEOF ingress: - hostname: vscode-${DEVBOX_ID}.${DEVBOX_DOMAIN} service: http://localhost:${VSCODE_PORT} - hostname: novnc-${DEVBOX_ID}.${DEVBOX_DOMAIN} service: http://localhost:${NOVNC_PORT} ``` ### Technical Analysis OpenVSCode Server is launched with `--without-connection-token`, explicitly disabling its connection-token authentication. VNC is launched with `-nopw`, explicitly disabling password authentication. The initialization script then creates public Traefik or Cloudflare Tunnel routes for both services. No authentication middleware, identity-aware access policy, source-address restriction, or independently generated session secret is configured in the audited project. Sequential devbox identifiers also make hostnames such as `vscode-1.example.com` easier to predict. ### Attack Path 1. An attacker identifies the configured base domain through DNS, documentation, certificate transparency, or normal reconnaissa ...[truncated 905 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove `--without-connection-token` and require a cryptographically random, per-devbox OpenVSCode connection token. - Remove `-nopw` and configure a strong, independently generated VNC credential. - Put both services behind an identity-aware proxy, such as Cloudflare Access or authenticated Traefik middleware. - Restrict access to approved users, source networks, or VPN identities. - Use non-sequential, high-entropy route identifiers rather than predictable numeric IDs. - Do not return service URLs until authentication and routing policies have been applied successfully. - Add automated tests that reject configurations exposing VSCode or noVNC without authentication. ]]>
