Critical Vulnerability in libX11: Remote Code Execution Risk

libx11 Updated 02 Oct 2025

Summary

27/05/2021
N/A
Yes i
Critical
9.8

ALPINE-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. Affects libx11 versions < 1.6.12-r1. Fixed in 1.6.12-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libX11 is a core library for the X Window System, providing essential functions for managing windows and user input in graphical environments. It facilitates communication between client applications and the X server, enabling graphical user interfaces on Unix-like operating systems. The library is widely used in various applications, making it a critical component in many systems. However, it is susceptible to vulnerabilities that can be exploited by attackers, particularly those that allow remote code execution.

Vulnerability Detail

The vulnerability identified as CVE-2021-31535 exists in the XLookupColor request of libX11, which is designed for server-side color lookup. An attacker can exploit this flaw by sending color-name requests that exceed the maximum size allowed by the protocol. This excessive data can be interpreted by the server as additional X protocol requests, potentially leading to arbitrary code execution. If a victim encounters malicious terminal control sequences for color codes, the attacker may gain full control over the victim's graphical session, posing a significant security risk.

How To Fix

Minimum fixed version

1.6.12-r1

This is the first release that contains the fix.

sudo apk add --upgrade libx11

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can limit access to the X server or implement stricter authorization controls to mitigate the risk of exploitation until the package can be updated.

Conclusion

The CVE-2021-31535 vulnerability in libX11 poses a significant risk of remote code execution, affecting numerous systems that rely on this library. Users are urged to update their libX11 packages to the latest patched versions to safeguard against potential exploits. Regular monitoring and updates are crucial in maintaining system security.

See every vulnerability recorded for libx11 →

Share this vulnerability

FAQ

CVE-2021-31535 is a critical vulnerability in the libX11 library that allows remote attackers to execute arbitrary code by exploiting the XLookupColor request.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for this vulnerability is 9.8, indicating a critical level of risk.

Exploitation of this vulnerability can lead to remote code execution, allowing attackers to take full control of the affected graphical session.

It is recommended to regularly check for updates and apply them promptly to mitigate the risk of vulnerabilities in your software.

Related vulnerabilities

Recent vulnerabilities recorded for libx11.

How To Fix

Minimum fixed version

1.6.12-r1

This is the first release that contains the fix.

sudo apk add --upgrade libx11

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback