102-500 · Question #204
Why is the xhost program considered dangerous to use?
The correct answer is B. It allows easy access to your X server by other users. See the full explanation below for the reasoning.
Question
Options
- AIt makes it difficult to uniquely identify a computer on the network.
- BIt allows easy access to your X server by other users.
- CIt logs sensitive information to syslog.
- DIt makes your computer share network resources without any authentication.
- EIt is a graphical DNS tool with known exploits.
How the community answered
(31 responses)- A3% (1)
- B71% (22)
- C16% (5)
- D6% (2)
- E3% (1)
Community Discussion
3B is correct. The xhost program controls access to the X display server, and using it carelessly (especially xhost + to allow all hosts) grants any user on the network the ability to connect to your X server, which means they can capture keystrokes, read screen contents, and inject input into your graphical session with no authentication required.
I initially gravitated toward D because "no authentication" sounds like the classic security horror story, but D describes anonymous file sharing, not X access. The pivot came when I remembered what xhost actually does: it disables X server access control entirely, meaning any user on any listed host can connect to your display and do whatever they want with your GUI session, which is exactly what B states.
Saw this one on my actual exam and almost second-guessed myself because D sounds scary too, but the answer is B, xhost allows other users to connect to your X server without needing to authenticate at all, which means anyone on the network can potentially display or intercept your graphical applications. Once I remembered that xhost basically opens the door with no lock, it clicked.