CVE-2021-31535
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.
What to do
Likely to be exploited: EPSS gives a 10% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 20.04 | libx11 | Fixed | 2:1.6.9-2ubuntu1.2 | UBUNTU-CVE-2021-31535 |
| Ubuntu 18.04 | libx11 | Fixed | 2:1.6.4-3ubuntu0.4 | UBUNTU-CVE-2021-31535 |
| Ubuntu 16.04 | libx11 | Fix pending | 2:1.6.3-1ubuntu2.2+esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-31535 |
| Ubuntu 14.04 | libx11 | Fix pending | 2:1.6.2-1ubuntu2.1+esm2 (Ubuntu Pro) | UBUNTU-CVE-2021-31535 |
| Debian 14 | libx11 | Fixed | 2:1.7.1-1 | DEBIAN-CVE-2021-31535 |
| Debian 13 | libx11 | Fixed | 2:1.7.1-1 | DEBIAN-CVE-2021-31535 |
| Debian 12 | libx11 | Fixed | 2:1.7.1-1 | DEBIAN-CVE-2021-31535 |
| Red Hat Enterprise Linux 9 | libX11 | Not affected | ||
| Red Hat Enterprise Linux 9 | libX11-common | Not affected | ||
| Red Hat Enterprise Linux 9 | libX11-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | libX11-xcb | Not affected | ||
| Red Hat Enterprise Linux 8 | libX11 | Fixed | 0:1.6.8-5.el8 | RHSA-2021:4326 |
| Red Hat Enterprise Linux 8 | libX11-common | Fixed | 0:1.6.8-5.el8 | RHSA-2021:4326 |
| Red Hat Enterprise Linux 8 | libX11-devel | Fixed | 0:1.6.8-5.el8 | RHSA-2021:4326 |
| Red Hat Enterprise Linux 8 | libX11-xcb | Fixed | 0:1.6.8-5.el8 | RHSA-2021:4326 |
| Red Hat Enterprise Linux 7 | libX11 | Fixed | 0:1.6.7-4.el7_9 | RHSA-2021:3296 |
| Red Hat Enterprise Linux 7 | libX11-common | Fixed | 0:1.6.7-4.el7_9 | RHSA-2021:3296 |
| Red Hat Enterprise Linux 7 | libX11-devel | Fixed | 0:1.6.7-4.el7_9 | RHSA-2021:3296 |
| Red Hat Enterprise Linux 7 | redhat-virtualization-host | Fixed | 0:4.3.18-20210903.0.el7_9 | RHSA-2021:3477 |
| Red Hat Enterprise Linux 7 | redhat-virtualization-host-image-update | Fixed | 0:4.3.18-20210903.0.el7_9 | RHSA-2021:3477 |
| Red Hat Enterprise Linux 6 | libX11 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libX11-common | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libX11-devel | Will not fix Out of support scope | ||
| AlmaLinux 8 | libX11 | Fixed | 1.6.8-5.el8 | ALSA-2021:4326 |
| AlmaLinux 8 | libX11-common | Fixed | 1.6.8-5.el8 | ALSA-2021:4326 |
| AlmaLinux 8 | libX11-devel | Fixed | 1.6.8-5.el8 | ALSA-2021:4326 |
| AlmaLinux 8 | libX11-xcb | Fixed | 1.6.8-5.el8 | ALSA-2021:4326 |
| Rocky Linux 8 | libX11 | Fixed | 0:1.6.8-5.el8 | RLSA-2021:4326 |
| Alpine Linux 3.24 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.23 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.22 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.21 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.20 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.19 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.18 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.17 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.16 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.15 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.14 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.13 | libx11 | Fixed | 1.7.1-r0 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.12 | libx11 | Fixed | 1.6.12-r1 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.11 | libx11 | Fixed | 1.6.12-r1 | ALPINE-CVE-2021-31535 |
| Alpine Linux 3.10 | libx11 | Fixed | 1.6.12-r1 | ALPINE-CVE-2021-31535 |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://www.debian.org/security/2021/dsa-4920 (vendor-advisory)
- https://security.gentoo.org/glsa/202105-16 (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://unparalleled.eu/publications/2021/advisory-unpar-2021-1.txt
- https://lists.freedesktop.org/archives/xorg/
- http://www.openwall.com/lists/oss-security/2021/05/18/2
- http://seclists.org/fulldisclosure/2021/May/52
- http://packetstormsecurity.com/files/162737/libX11-Insufficient-Length-Check-Injection.html
- https://lists.debian.org/debian-lts-announce/2021/05/msg00021.html
- https://www.debian.org/security/2021/dsa-4920
- https://security.gentoo.org/glsa/202105-16
- https://www.openwall.com/lists/oss-security/2021/05/18/3
- https://www.openwall.com/lists/oss-security/2021/05/18/2
- https://unparalleled.eu/blog/2021/20210518-using-xterm-to-navigate-the-huge-color-space/
- https://lists.x.org/archives/xorg-announce/2021-May/003088.html
- https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/8d2e02ae650f00c4a53deb625211a0527126c605
- https://security.netapp.com/advisory/ntap-20210813-0001/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TEOT4RLB76RVPJQKGGTIKTBIOLHX2NR6/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.