Information
Xwayland is a compatibility layer that allows legacy X11 applications to run within a Wayland environment. It's effectively an X server that runs as a Wayland client, enabling existing X11 software to be displayed on a Wayland compositor.
Wayland's security benefits from not relying on X11's network listener. Without X11, there's no network listener, making it harder for malicious actors to exploit vulnerabilities in X11. However, enabling Xwayland (running X11 applications on Wayland) introduces X11's security concerns.
All X vulnerabilities apply to Xwayland, including keylogging, but they only affect X windows and interactions with them.
Malware can potentially exploit Xwayland vulnerabilities to keylog or intercept other input events
Solution
Edit the file /etc/gdm/custom.conf and uncomment or add the following line in the [daemon] block:
WaylandEnable=false
Example:
# GDM configuration storage
[daemon]
WaylandEnable=false
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
#Enable=true
Impact:
Many applications haven't been ported to Wayland yet, and Xwayland makes it possible to run these applications without requiring a full switch back to X11. Disabling Xwayland functionality may cause these applications to fail.