Open X11 Server

An X Window System display server accepts connections from any host, letting an attacker capture the screen and keystrokes and send input to the user's session.

SeverityHigh
CVSS 3.18.2 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N Open in the calculator
CVSS 4.08.8 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-306: Missing Authentication for Critical Function
OWASP Top 10A07:2025 Authentication Failures
MITRE ATT&CKT1113 Screen Capture, T1056.001 Keylogging, T1059 Command and Scripting Interpreter
CategoryBroken Access Control

Description

The X11 display server accepts client connections over the network without access control. An X server normally listens only for local connections, or uses an authorisation cookie (MIT-MAGIC-COOKIE-1) so that only clients holding the cookie can connect. Running xhost +, starting the server with the -ac option or adding broad entries to the host access list removes this protection, so any host that can reach the server's TCP port can connect as if it were a local application.

An attacker who connects in this way can take screenshots of the whole display, record keystrokes typed into any window, including passwords, and inject keyboard and mouse events into the session. With an active session this can allow commands to be run as the logged-in user, for example by typing into an open terminal, and the attacker can close or interfere with the user's applications. The impact depends on who uses the display: an administrator's session, or one with privileged terminals open, gives a correspondingly privileged foothold.

The issue is identified on TCP 6000 and the ports above it (one for each display), for example with the Nmap x11-access script, or by running a client such as xdpyinfo or xwininfo -root -tree against the remote display and receiving information instead of an authorisation error. Scanners report it as an open or unauthenticated X11 server. Current X servers and display managers normally disable TCP listening by default, so the issue is most often found on older Unix workstations, thin clients and systems where remote X was enabled deliberately.

Remediation

Restore access control and stop exposing the display server:

  • Stop the X server listening on TCP: start it with -nolisten tcp, or use the display manager's setting, such as DisallowTCP=true in the [security] section of GDM's custom.conf or xserver-allow-tcp=false in LightDM's configuration.
  • Remove xhost + and -ac from start-up scripts and session files, and rely on cookie-based authorisation managed with xauth.
  • Where remote graphical applications are needed, use SSH X11 forwarding (ssh -X), which carries the connection over an authenticated, encrypted channel, or a properly authenticated remote desktop service.
  • Block TCP 6000 to 6063 with host and network firewall rules as an additional layer.
# GDM: /etc/gdm/custom.conf (/etc/gdm3/custom.conf on Ubuntu, /etc/gdm3/daemon.conf on Debian) [security] DisallowTCP=true # LightDM: /etc/lightdm/lightdm.conf [Seat:*] xserver-allow-tcp=false

Confirm the fix by repeating the remote connection attempt and checking that the port is closed or the connection is refused.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding