Bitzu

CPSA ยท Unix network file, trust and remote access services

X11 security: xhost versus xauth

Host-based (xhost) vs user-based (xauth) access control and remote display risks.

Key points

  • An X server decides which clients may open windows on its display.
  • xhost: host-based list of allowed machines; xhost + switches access control off for everyone.
  • xauth: user-based; clients must present matching authorization data held by the user.
  • Open X server: a remote client can capture screenshots, read keystrokes and inject input, so xhost + on a networked display is a serious finding.

Source: https://xorg.freedesktop.org/archive/X11R7.7/doc/man/man1/xhost.1.xhtml

Practice questions

Single choice

What does running 'xhost +' with no name do?

  1. Turns access control off, so any host may connect
  2. Adds only the local machine to the allowed list
  3. Turns on user-based xauth checking
  4. Lists the hosts currently allowed
Show answer

Answer: A. Turns access control off, so any host may connect

A bare + turns access control off, so any host may connect to the X server. A bare - turns it back on. It does not add only localhost or enable xauth.

Select all that apply

What can a remote client do against an X server whose access control is open?

  1. Capture screenshots of the display
  2. Observe keystrokes typed into windows
  3. Send synthetic keyboard input to windows
  4. Decrypt the user's SSH sessions
  5. Rewrite the server's firewall rules
Show answer

Answer: A. Capture screenshots of the display, B. Observe keystrokes typed into windows, C. Send synthetic keyboard input to windows

An accepted X client can read the screen contents, observe keystrokes and send synthetic input to windows. It cannot decrypt SSH traffic or change the server's firewall rules by itself.

True or false

True or false: xhost provides strong, per-user authentication of X clients.

Show answer

Answer: False

False. xhost is host-based and the man page calls it a rudimentary form of access control suited to single-user workstations. User-based control is the job of xauth-style authorization data.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module