T09 · Insecure Skill Coding Practices
- Location
scripts/remote_support.py:302- Finding
Unencrypted VNC May Be Exposed When the Firewall Is Inactive or Unavailable
- Content
View full analysis
bool: if not firewall_cmd_available(): return False code, out, _ = run(["firewall-cmd", "--query-port", f"{VNC_PORT}/tcp"], timeout=10) return code == 0 and out.strip() == "yes" ``` ```python def enable_vnc(vnc_pass: str, mode: str) -> None: if vnc_port_allowed_by_firewalld(): raise RuntimeError(f"firewalld allows {VNC_PORT}/tcp; refusing to expose current-session VNC") set_vnc_encryption("['none']") ``` ### Technical Analysis The firewall check conflates two materially different conditions: 1. Firewalld is active and port 1024 is confirmed blocked. 2. Firewalld is unavailable, inactive, or cannot be queried. Both conditions return `False`. The caller interprets that result as permission to continue. It then explicitly configures GNOME VNC with encryption disabled. Although `preflight` reports firewall availability, `open` does not require proof that preflight succeeded. Consequently, direct invocation of `open` can start the VNC backend without an active firewall. The implementation only verifies that VNC is reachable through `127.0.0.1`; it does not prove that the backend is exclusively bound to loopback. This exceeds the minimum safe privileges required for the declared tunnel-based workflow because the desktop backend may become reachable through a host network interface rather than exclusively through the authenticated Guacamole tunnel. ### Attack Path 1. Firewalld is stopped, missing, or its query fails. 2. A user or automation invokes `remote_support.py open` directly. 3. `vnc_port_allowed_by_firewalld()` returns `False`. 4. `enable_vnc()` treats the result as evidence that the port is blocked. 5. GNOME ...[truncated 936 chars]- Remediation
View remediation
