CVE-2023-3138 Memory corruption in libX11

High 7.5 Published Updated

A malicious X server or proxy can cause client crashes via out-of-bounds writes in libX11 due to missing bounds checks on protocol IDs.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-3138?

CVE-2023-3138 is a high-severity memory corruption vulnerability in Redhat Enterprise Linux, published on 28 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A vulnerability was found in libX11. The security flaw occurs because the functions in src/InitExt.c in libX11 do not check that the values provided for the Request, Event, or Error IDs are within the bounds of the arrays that those functions write to, using those IDs as array indexes. They trust that they were called with values provided by an Xserver adhering to the bounds specified in the X11 protocol, as all X servers provided by X.Org do. As the protocol only specifies a single byte for these values, an out-of-bounds value provided by a malicious server (or a malicious proxy-in-the-middle) can only overwrite other portions of the Display structure and not write outside the bounds of the Display structure itself, possibly causing the client to crash with this memory corruption.

Weakness: CWE-787, CWE-119

Which versions are affected by CVE-2023-3138?

It affects 2 products.

Linux distribution packages (40)
libX11 AlmaLinux:8All versions1.6.8-6.el8
libX11-common AlmaLinux:8All versions1.6.8-6.el8
libX11-devel AlmaLinux:8All versions1.6.8-6.el8
libX11-xcb AlmaLinux:8All versions1.6.8-6.el8
libX11 AlmaLinux:9All versions1.7.0-8.el9
libX11-common AlmaLinux:9All versions1.7.0-8.el9
libX11-devel AlmaLinux:9All versions1.7.0-8.el9
libX11-xcb AlmaLinux:9All versions1.7.0-8.el9
libX11 Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-common Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-debugsource Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-devel Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-xcb Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11-xcb-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:1.6.8-6.el8
libX11 Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-common Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-devel Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-xcb Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11-xcb-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:1.7.0-8.el9
libX11 Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-common Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-debuginfo Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-debugsource Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-devel Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-xcb Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11-xcb-debuginfo Red Hat:rhel_eus:8.8::appstreamAll versions0:1.6.8-6.el8_8
libX11 Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-common Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-debuginfo Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-debugsource Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-devel Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-xcb Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11-xcb-debuginfo Red Hat:rhel_eus:9.2::appstreamAll versions0:1.7.0-8.el9_2
libX11 SUSE:Enterprise Storage 7All versions1.6.5-150000.3.30.1
libX11 SUSE:Enterprise Storage 7.1All versions1.6.5-150000.3.30.1
libX11 SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions1.6.5-150000.3.30.1
libX11 SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSSAll versions1.6.5-150000.3.30.1

Products include Redhat Enterprise Linux, X.org Libx11.

How do I fix CVE-2023-3138?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2023-3138 being exploited?

There is no known exploitation of CVE-2023-3138 in the wild and no public exploit code.

All Redhat Enterprise Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2023-3138, ALSA-2023:6497, ALSA-2023:7029, AZL-27274, CLSA-2025-1745270046, DEBIAN-CVE-2023-3138 and 19 more.

Is CVE-2023-3138 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free