CVE-2021-31535: Input Validation

Published May 18, 2021
·
Updated

A missing validation flaw was found in libX11. This flaw allows an attacker to inject X11 protocol commands on X clients, and in some cases, also bypass, authenticate (via injection of control characters), or potentially execute arbitrary code with permissions of the application compiled with libX11. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.

Other sources

LookupCol.c in X.Org X through X11R7.7 and libX11 before 1.7.1 might allow remote attackers to execute arbitrary code. The libX11 XLookupColor request (intended for server-side color lookup) contains a flaw allowing a client to send color-name requests with a name longer than the maximum size allowed by the protocol (and also longer than the maximum packet size for normal-sized packets). The user-controlled data exceeding the maximum size is then interpreted by the server as additional X protocol requests and executed, e.g., to disable X server authorization completely. For example, if the victim encounters malicious terminal control sequences for color codes, then the attacker may be able to take full control of the running graphical session.

XLookupColor() and other X libraries function lack proper validation of the length of their string parameters. If those parameters can be controlled by an external application (for instance a color name that can be emitted via a terminal control sequence) it can lead to the emission of extra X protocol requests to the X server.

References: https://www.openwall.com/lists/oss-security/2021/05/18/2 https://www.openwall.com/lists/oss-security/2021/05/18/3

Red Hat

Affected Software

7 affected componentsFixes available
redhat/redhat-virtualization-host<0:4.3.18-20210903.0.el7_9
0:4.3.18-20210903.0.el7_9
debian/libx11
2:1.6.7-1+deb10u22:1.6.7-1+deb10u42:1.7.2-1+deb11u12:1.7.2-1+deb11u22:1.8.4-2+deb12u12:1.8.4-2+deb12u22:1.8.7-1
debian/libx11<=2:1.7.0-2, <=2:1.6.7-1, <=2:1.6.7-1+deb10u1
2:1.6.7-1+deb10u22:1.7.1-1
X.Org libX11<1.7.1
X.Org X Window System<=x11r7.7
Fedoraproject Fedora=33
redhat/libX11<1.7.1
1.7.1

Remediation

Information

xterm should not be used to display less trusted data, e.g. from SSH connections to less trusted remote machines. To avoid attacks via .Xdefaults on kiosk type machines, where graphical user has no permission to execute arbitrary operating system commands or sometimes not even to send hardware keyboard keystrokes, the .Xdefaults must not be modifiable by the user.

Event History

May 18, 2021
CVE Published
12:00 AM
Data Sourced
via Red Hat·07:14 PM
DescriptionSeverityAffected Software
May 27, 2021
CVE Published
via MITRE·12:26 PM
Data Sourced
via MITRE·12:26 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2021-31535?

CVE-2021-31535 is a vulnerability in libX11 that allows remote attackers to execute arbitrary code.

2

How severe is CVE-2021-31535?

CVE-2021-31535 has a severity rating of 9.8 (critical).

3

What software is affected by CVE-2021-31535?

The libX11 package with versions before 1.7.1 on Red Hat, libX11 package with various versions on Debian, X.Org libX11 with versions before 1.7.1, X.org X Window System up to inclusive x11r7.7, and Fedoraproject Fedora 33 are affected.

4

How can I fix CVE-2021-31535?

To fix CVE-2021-31535, update libX11 to version 1.7.1 on Red Hat, update libX11 to the recommended versions on Debian, and update X.Org libX11 to version 1.7.1.

5

Where can I find more information about CVE-2021-31535?

More information about CVE-2021-31535 can be found at the following references: [Reference 1], [Reference 2], [Reference 3]

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203