Update X.Org Server Version 21.1.12: Four Security Vulnerabilities Patched

Corrective releases published X.Org Server 21.1.12 and DDX component (Device-Dependent X) xwayland 23.2.5, which provides the launch of X.Org Server for organizing the execution of X11 applications in Wayland-based environments. The new version of X.Org Server eliminates 4 vulnerabilities. One vulnerability can be exploited for privilege escalation on systems where the X server is running as root, as well as for remote code execution in configurations that use X11 session redirection via SSH for access.

The remaining three vulnerabilities can lead to server memory leaks or crashes. These three vulnerabilities are exploited by using a different byte order on the client side than on the server. In this regard, the new release offers the ability to block connections from clients from systems that have a different byte order. To disable, you can use the “AllowByteSwappedClients” configuration option or the “+byteswappedclients” command line option.

Changing the default value allows you to protect against possible byte order manipulation vulnerabilities that have not yet been identified. The essence of such vulnerabilities is that changing the byte order for values ​​with a size leads to their incorrect interpretation and reading or writing to memory that is obviously larger than the allocated buffer can accommodate.

By default, support for clients with other byte order is still maintained, despite the fact that in practice byte order conversion has recently been used extremely rarely, since workstations that run the X server are usually equipped with processors with little-endian byte order (low to high byte) and connecting X clients with big-endian order to them, such as the s390x platform (IBM zSystems), is very rare.

Issues identified:

  • CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 – Out-of-buffer reading through manipulation of the ProcXIGetSelectedEvents, ProcXIPassiveGrabDevice and ProcAppleDRICreatePixmap functions, which use a field with a size without regard to byte order in the value passed by the client. Accordingly, if the byte order of the client and server differs, the functions return more data to the client. The first two problems appear starting with the release of xorg-server-1.7.0 (2009), and the third – with xorg-server-1.15.0 (2012).
  • CVE-2024-31083 – User-after-free memory access in the ProcRenderAddGlyphs function, which calls the AllocateGlyph() function to store new glyphs passed by the client. The AllocateGlyph() function returns a new glyph with a refcount of 0 (refcount=0), and specifying a glyph again does not increment the refcount, so the glyph_new array may contain multiple entries pointing to a single glyph with no refcount. When the ProcRenderAddGlyphs() function frees the memory allocated for a glyph, an extra instance of the pointer to the glyph, the memory for which has already been freed, remains in the array and can be used. The problem occurs in X.Org Server and does not affect xwayland.

Thanks for reading: