Skip to content
Info disclosure Advisory Intermediate CVE-2018-3838

Simple DirectMedia Layer SDL2_Image load_xcf_tile_rle Information Disclosure Vulnerability

A specially crafted XCF image can cause an out-of-bounds read on the heap due to a zero-length tile offset difference, leading to information disclosure. An attacker can display such an image to trigger the vulnerability.

Lilith Follow

Originally disclosed on Cisco Talos

Medium 5.3 View original

An exploitable information vulnerability exists in the XCF image rendering functionality of SDL2image-2.0.2. A specially crafted XCF image can cause an out-of-bounds read on the heap, resulting in information disclosure.

Lilith, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the length parameter passed to load_xcf_tile_rle can be zero when two consecutive tile offsets are equal, causing malloc(0) to return a small buffer that is then over-read because the loop uses x*y*bpp as the size.

Impact

An attacker could disclose heap memory contents, potentially leaking sensitive information, though the CVSS vector indicates high attack complexity and user interaction is required.

What the attacker needed

Victim loads a crafted XCF image

The fix

The vulnerability was fixed by the vendor.

How it was found

  1. Craft an XCF file with two consecutive tile_file_offsets that are equal.
  2. Load the crafted XCF file using SDL2_image.
  3. The library calls load_xcf_tile_rle with len=0, leading to malloc(0) and subsequent out-of-bounds read.

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 report has not been written yet. The Original tab links to the source.

When an image file is loaded, the program reads data into a buffer. If the file is crafted so that a certain size value becomes zero, the program still tries to read a large amount of data from that tiny buffer, going past its end. This can leak memory contents, which might include sensitive information.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Lilith

View all

4 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.