Skip to content
DoS Write-up Intermediate

*nix libX11: Uncovering and exploiting a 35-year-old vulnerability – Part 1 of 2

A flaw in libX11's image-splitting logic causes an endless recursion when a crafted XPM image is processed, leading to a denial of service. An attacker could crash applications that display such images.

Yair Mizrahi Follow

Published on jfrog.com

The JFrog Security research team has recently discovered two security vulnerabilities in X.Org libX11, the widely popular graphics library – CVE-2023-43786 and CVE-2023-43787 (with a high NVD severity CVSS 7.8). These vulnerabilities cause a denial-of-service and remote code execution.

Yair Mizrahi, on jfrog.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The calculation for the width of a sub-image in the recursive splitting logic failed to account for bits per pixel, so the computed width remained too large to fit in a single request, causing infinite recursion.

Impact

An attacker could cause a denial of service by supplying a crafted XPM image, crashing or hanging the application that processes it.

What the attacker needed

Victim opens a crafted XPM image; application uses vulnerable libXpm/libX11

How it was found

  1. Craft an XPM image with a very large width and a height of one pixel.
  2. Open the image with an application that uses libXpm, such as the sxpm utility.
  3. The application calls xpmCreatePixmapFromImage, which calls XPutImage and then PutSubImage.
  4. PutSubImage enters infinite recursion and exhausts the call stack, causing a denial of service.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When an image is too big to send in one piece, the library splits it into smaller parts. A mistake in the maths for one split means it keeps trying to send the same oversized piece over and over, never finishing. This can freeze or crash the program that opens the image.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Yair Mizrahi

View all

1 more disclosed report, best first.

More from X.Org (libX11)

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.