cve.bz

CVE-2021-31535 Classic Buffer Overflow

9.8 criticalExploit referenceEPSS 10%

Critical (9.8). EPSS 10% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
10% (unchanged from 10% a week ago; 11% 30 days ago) estimated probability of exploitation activity in the next 30 days; 96th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-120 Buffer Copy without Checking Size of Input (Classic Buffer Overflow)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-31535 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-31535?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-31535?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-31535 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
x.org:libx11before 1.7.1
x.org:x_window_systemthrough x11r7.7
fedoraproject:fedora33

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9libx112:1.6.4-3+deb9u4DLA-2666-1
Debian10libx112:1.6.7-1+deb10u2DSA-4920-1
Debian12, 13, 14libx112:1.7.1-1DEBIAN-CVE-2021-31535
Ubuntu18.04:LTSlibx112:1.6.4-3ubuntu0.4UBUNTU-CVE-2021-31535 USN-4966-1
Ubuntu20.04:LTSlibx112:1.6.9-2ubuntu1.2UBUNTU-CVE-2021-31535 USN-4966-1
UbuntuPro:14.04:LTSlibx112:1.6.2-1ubuntu2.1+esm2UBUNTU-CVE-2021-31535 USN-4966-2
UbuntuPro:16.04:LTSlibx112:1.6.3-1ubuntu2.2+esm1UBUNTU-CVE-2021-31535 USN-4966-2
Red Hatenterprise_linux:7::client, enterprise_linux:7::server, enterprise_linux:7::workstationlibX11, libX11-devel, libX11-common and 1 more0:1.6.7-4.el7_9RHSA-2021:3296
Red Hatenterprise_linux:7::computenodelibX11-devel, libX11-debuginfo0:1.6.7-4.el7_9RHSA-2021:3296
Red Hatenterprise_linux:7::hypervisorredhat-virtualization-host, redhat-virtualization-host-image-update0:4.3.18-20210903.0.el7_9RHSA-2021:3477
Red Hatenterprise_linux:8::appstreamlibX11, libX11-xcb, libX11-devel and 4 more0:1.6.8-5.el8RHSA-2021:4326
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 13 morelibX111.6.5-3.21.1SUSE-SU-2021:1897-1
SUSEHPE Helion OpenStack 8, Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL and 11 morelibX111.6.2-12.21.1SUSE-SU-2021:1892-1
SUSELinux Enterprise Micro 5.0, Linux Enterprise Module for Basesystem 15 SP2, Linux Enterprise Module for Basesystem 15 SP3libX111.6.5-3.18.1SUSE-SU-2021:1765-1
SUSELinux Enterprise Point of Sale 11 SP3, Linux Enterprise Server 11 SP4-LTSSxorg-x11-libX117.4-5.11.72.27.1SUSE-SU-2021:14748-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5libX111.6.2-12.18.1SUSE-SU-2021:1766-1
openSUSELeap 15.2libX111.6.5-lp152.5.15.1openSUSE-SU-2021:0807-1
openSUSELeap 15.2libX111.6.5-lp152.5.18.1openSUSE-SU-2021:0857-1
openSUSELeap 15.3libX111.6.5-3.21.1openSUSE-SU-2021:1897-1
openSUSETumbleweedlibX111.7.2-1.2openSUSE-SU-2024:10918-1
AlmaLinux8libX11, libX11-xcb, libX11-devel and 1 more1.6.8-5.el8ALSA-2021:4326
Rocky Linux8libX110:1.6.8-5.el8RLSA-2021:4326
Alpinev3.10, v3.11, v3.12libx111.6.12-r1ALPINE-CVE-2021-31535
Alpinev3.13, v3.14, v3.15 and 9 morelibx111.7.1-r0ALPINE-CVE-2021-31535

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This flaw was rated with an important severity as it allows an attacker to inject X11 protocol commands on X clients with the privileges of the application linked with the libX11 library, potentially having administrative privileges. However, Red Hat Enterprise Linux 8 and 9 do not run the Xorg server with root privileges, lowering the security impact of this issue. For this reason, Red Hat Enterprise Linux 8 and 9 have been rated with a moderate severity.

Red Hat's mitigation

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.

ProductPackageStateAdvisory
Red Hat Ansible Tower 3.8 for RHEL 7ansible-tower-38/ansible-tower-rhel7:3.8.4-1Fixed 2021-09-08RHBA-2021:3472
Red Hat Enterprise Linux 7libX11-0:1.6.7-4.el7_9Fixed 2021-08-30RHSA-2021:3296
Red Hat Enterprise Linux 8libX11-0:1.6.8-5.el8Fixed 2021-11-09RHSA-2021:4326
Red Hat Virtualization 4 for Red Hat Enterprise Linux 7redhat-virtualization-host-0:4.3.18-20210903.0.el7_9Fixed 2021-09-09RHSA-2021:3477
Red Hat Enterprise Linux 6libX11Out of support scope
Red Hat Enterprise Linux 9libX11Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-31535.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-120 (13).

References

Check your stackJSON