← Vulnerability feed

Vulnerability record · CVE-2021-31535 · published 27 May 2021

CVE-2021-31535: X.org libx11 classic buffer overflow vulnerability

XX.Org · Libx11

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.

9.8 CVSS 3.1 Critical EPSS 10% · top 4.2% CWE-120 · Classic buffer overflow
9.8CVSS 3.1 base score, v2 7.5
10%EPSS exploitation probability, 30 days
NoNot in CISA KEV
3Affected product versions listed by NVD
38References, 6 tagged exploit
17 Jun 2026Last modified by NVD

Description

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.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected products

3 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://packetstormsecurity.com/files/162737/libX11-Insufficient-Length-Check-Injection.html ExploitThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2021/May/52 Mailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2021/05/18/2 Mailing ListThird Party Advisory
https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/8d2e02ae650f00c4a53deb625211a0527126c605 Third Party Advisory
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cdev.kafka.apache.org
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.o
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.o
https://lists.debian.org/debian-lts-announce/2021/05/msg00021.html Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TEOT4RLB76RVPJQKGGTIKTB
https://lists.freedesktop.org/archives/xorg/ Third Party Advisory
https://lists.x.org/archives/xorg-announce/2021-May/003088.html Vendor Advisory
https://security.gentoo.org/glsa/202105-16 Third Party Advisory
https://security.netapp.com/advisory/ntap-20210813-0001/ Third Party Advisory
https://unparalleled.eu/blog/2021/20210518-using-xterm-to-navigate-the-huge-color-space/ ExploitThird Party Advisory
https://unparalleled.eu/publications/2021/advisory-unpar-2021-1.txt ExploitThird Party Advisory
https://www.debian.org/security/2021/dsa-4920 Third Party Advisory
https://www.openwall.com/lists/oss-security/2021/05/18/2 Mailing ListThird Party Advisory
https://www.openwall.com/lists/oss-security/2021/05/18/3 Mailing ListThird Party Advisory
http://packetstormsecurity.com/files/162737/libX11-Insufficient-Length-Check-Injection.html ExploitThird Party AdvisoryVDB Entry
http://seclists.org/fulldisclosure/2021/May/52 Mailing ListThird Party Advisory
http://www.openwall.com/lists/oss-security/2021/05/18/2 Mailing ListThird Party Advisory
https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/8d2e02ae650f00c4a53deb625211a0527126c605 Third Party Advisory
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cdev.kafka.apache.org
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.o
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.o
https://lists.debian.org/debian-lts-announce/2021/05/msg00021.html Third Party Advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TEOT4RLB76RVPJQKGGTIKTB
https://lists.freedesktop.org/archives/xorg/ Third Party Advisory
https://lists.x.org/archives/xorg-announce/2021-May/003088.html Vendor Advisory
https://security.gentoo.org/glsa/202105-16 Third Party Advisory
https://security.netapp.com/advisory/ntap-20210813-0001/ Third Party Advisory
https://unparalleled.eu/blog/2021/20210518-using-xterm-to-navigate-the-huge-color-space/ ExploitThird Party Advisory
https://unparalleled.eu/publications/2021/advisory-unpar-2021-1.txt ExploitThird Party Advisory
https://www.debian.org/security/2021/dsa-4920 Third Party Advisory
https://www.openwall.com/lists/oss-security/2021/05/18/2 Mailing ListThird Party Advisory
https://www.openwall.com/lists/oss-security/2021/05/18/3 Mailing ListThird Party Advisory

Track CVE-2021-31535 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2009-0846Mit kerberos 5 vulnerabilityThe asn1_decode_generaltime function in lib/krb5/asn.1/asn1_decode.c in the ASN.1 GeneralizedTime decoder in MIT Kerberos 5 (aka krb5) before 1.6.4 a…EPSS 8.9%9.8CVE-2018-14599X.org libx11 vulnerabilityAn issue was discovered in libX11 through 1.6.5. The function XListExtensions in ListExt.c is vulnerable to an off-by-one error caused by malicious s…EPSS 4.2%9.8CVE-2018-14600X.org libx11 out-of-bounds write vulnerabilityAn issue was discovered in libX11 through 1.6.5. The function XListExtensions in ListExt.c interprets a variable as signed instead of unsigned, resul…EPSS 9.2%9.8CVE-2016-7943Fedoraproject fedora out-of-bounds write vulnerabilityThe XListFonts function in X.org libX11 before 1.6.4 might allow remote X servers to gain privileges via vectors involving length fields, which trigg…EPSS 4.5%9.8CVE-2016-7942Fedoraproject fedora permissions and access controls vulnerabilityThe XGetImage function in X.org libX11 before 1.6.4 might allow remote X servers to gain privileges via vectors involving image type and geometry, wh…EPSS 4.5%9.8CVE-2008-2374Bluez-libs vulnerabilitysrc/sdp.c in bluez-libs 3.30 in BlueZ, and other bluez-libs before 3.34 and bluez-utils before 3.34 versions, does not validate string length fields …EPSS 4.3%9.8CVE-2008-2108Php vulnerabilityThe GENERATE_SEED macro in PHP 4.x before 4.4.8 and 5.x before 5.2.5, when running on 64-bit systems, performs a multiplication that generates a port…EPSS 4.3%9.8CVE-2008-0599Php vulnerabilityThe init_request_info function in sapi/cgi/cgi_main.c in PHP before 5.2.6 does not properly consider operator precedence when calculating the length …EPSS 11%

Source: NIST National Vulnerability Database (record CVE-2021-31535), CISA KEV, FIRST EPSS (scores of 2026-11-24). This page is refreshed as NVD updates the record.