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.
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.
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
- Craft an XCF file with two consecutive tile_file_offsets that are equal.
- Load the crafted XCF file using SDL2_image.
- 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.