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.
| Severity | High |
| CVSS 3.1 | 8.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.0 | 8.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 |
| CWE | CWE-306: Missing Authentication for Critical Function |
| OWASP Top 10 | A07:2025 Authentication Failures |
| MITRE ATT&CK | T1113 Screen Capture, T1056.001 Keylogging, T1059 Command and Scripting Interpreter |
| Category | Broken 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 asDisallowTCP=truein the[security]section of GDM'scustom.conforxserver-allow-tcp=falsein LightDM's configuration. - Remove
xhost +and-acfrom start-up scripts and session files, and rely on cookie-based authorisation managed withxauth. - 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.
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 trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.