CVE-2021-31535
NixOS vulnerability analysis and mitigation

Overview

CVE-2021-31535 affects libX11, the core X11 protocol client library, through X11R7.7 and versions before 1.7.1. The vulnerability stems from missing request length checks in the LookupCol.c component, which could allow remote attackers to execute arbitrary code. The issue was discovered in May 2021 and involves insufficient validation of string parameters in XLookupColor() and other X libraries functions (CVE-Mitre, OSS-Security).

Technical details

The vulnerability exists in the XLookupColor request handling where a client can send color-name requests with a name longer than the maximum size allowed by the protocol. The flaw allows injection of X11 protocol commands when processing overlong color names, similar to SQL injection attacks. The issue specifically occurs because the code does not properly validate the length of string parameters before sending them to the X server (Unparalleled Blog).

Impact

When successfully exploited, this vulnerability can allow attackers to inject arbitrary X protocol requests, potentially leading to authentication bypass, denial of service, or execution of arbitrary code. In specific cases, attackers can disable X server authentication completely, allowing unauthorized access to the X server session including keyboard and mouse input data (Red Hat CVE).

Exploitability

The vulnerability can be exploited through applications that process untrusted color names, particularly terminal emulators like xterm. Exploitation can occur when displaying malicious terminal control sequences, such as through SSH connections to compromised servers or when viewing log files containing malicious color codes. A proof-of-concept exploit has been developed that can disable X server authentication (Unparalleled Blog).

Mitigation and workarounds

The vulnerability was patched in libX11 version 1.7.1 with commit 8d2e02ae650f00c4a53deb625211a0527126c605, which adds proper validation of request data length. Additionally, XTerm version 367 includes mitigation by adding validation for color name lengths. Until patches can be applied, users should avoid using xterm to display untrusted data, particularly from SSH connections to untrusted machines (OSS-Security).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-75874CRITICAL10
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:firefox
NoYesAug 18, 2026
CVE-2026-74990CRITICAL9.8
  • NixOS logoNixOS
  • firefox-esr
NoYesAug 18, 2026
CVE-2026-74989CRITICAL9.8
  • NixOS logoNixOS
  • MozillaFirefox-translations-common
NoYesAug 18, 2026
CVE-2026-74988CRITICAL9.8
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:firefox
NoYesAug 18, 2026
CVE-2026-74987CRITICAL9.8
  • NixOS logoNixOS
  • firefox-esr
NoYesAug 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management