CVE-2021-31535

Exp

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.

Published: 2021-05-27 Last update: 2026-06-16 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-31535 is rated High Exploit Risk (92.5/100): CVSS Critical severity, with high exploitation likelihood (EPSS 10.63%, 95th percentile). Core evidence: 3 public exploit reference(s) are indexed (Exploit-DB). EPSS rose +5.15% over the last day, indicating growing attacker interest. Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2021-31535

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗
nvd_ref exploit_tag Exploit-DB ↗
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2021-31535

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 5.48% 10.63% +5.15%
2 2026-05-28 2.06% 5.48% +3.42%
3 2026-01-04 2.06%

Full EPSS history (40 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-31535

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]
7.5 2.0 HIGH
AV:N/AC:L/Au:N/C:P/I:P/A:P Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:L)
Exploitation conditions are straightforward and predictable.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
10.0 6.4 [email protected]

Weakness enumeration for CVE-2021-31535

OS Trackers for CVE-2021-31535

vendor priority summary link
alpine critical CVE-2021-31535: 1 source package rows (libx11); 25 state rows across 10 repos (3.10-main, 3.11-main, 3.12-main, 3.17-main, 3.18-main, 3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-main); fixed 10, open 15. https://security.alpinelinux.org/vuln/CVE-2021-31535
debian not yet assigned CVE-2021-31535 not yet assigned priority: Debian including 1 source packages (libx11), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2021-31535
gentoo low CVE-2021-31535: 1 GLSA(s) (202105-16), 1 atom(s) (x11-libs/libX11); latest impact low. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2021-31535
redhat high https://access.redhat.com/security/cve/CVE-2021-31535
suse high CVE-2021-31535 severity important: SUSE including 325 source package names (0.38.1.5.8.40:libX11-6-1.6.5-3.18.1, 0.38.1.5.8.40:libX11-data-1.6.5-3.18.1, …), 927 product×package rows across 213 product lines (Container bci/openjdk, Container bci/openjdk-devel, … (213 product lines)): Fixed 696, Known Affected 231. https://www.suse.com/security/cve/CVE-2021-31535/
ubuntu medium CVE-2021-31535 medium priority: Ubuntu including 1 source packages (libx11), 9 status rows across 9 suites (bionic, focal, groovy, hirsute, impish, jammy, trusty, upstream, xenial): released 8, needs-triage 1. https://ubuntu.com/security/CVE-2021-31535

Affected software / configurations for CVE-2021-31535

Vendor Product Version Raw CPE
x.org libx11 < 1.7.1 cpe:2.3:a:x.org:libx11:*:*:*:*:*:*:*:*
x.org x_window_system <= x11r7.7 cpe:2.3:o:x.org:x_window_system:*:*:*:*:*:*:*:*
fedoraproject fedora 33 cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*

References for CVE-2021-31535

URL Tags
http://packetstormsecurity.com/files/162737/libX11-Insufficient-Length-Check-Injection.html Exploit Third Party Advisory VDB Entry
http://seclists.org/fulldisclosure/2021/May/52 Mailing List Third Party Advisory
http://www.openwall.com/lists/oss-security/2021/05/18/2 Mailing List Third 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%3E
https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.org%3E
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org%3E
https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.org%3E
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/TEOT4RLB76RVPJQKGGTIKTBIOLHX2NR6/
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/ Exploit Third Party Advisory
https://unparalleled.eu/publications/2021/advisory-unpar-2021-1.txt Exploit Third 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 List Third Party Advisory
https://www.openwall.com/lists/oss-security/2021/05/18/3 Mailing List Third Party Advisory
cvelogic Threat Intelligence