Skip to content
Memory corruption Advisory Advanced CVE-2025-53085

SAIL Image Decoding Library PSD RLE Decoding heap-based buffer overflow vulnerability

A heap-based buffer overflow exists in the PSD RLE decoding of SAIL Image Decoding Library v0.9.8. An attacker could craft a malicious .psd file that, when decoded, writes beyond the allocated buffer, potentially leading to remote code execution.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A memory corruption vulnerability exists in the PSD RLE Decoding functionality of the SAIL Image Decoding Library v0.9.8. When decompressing the image data from a specially crafted .psd file, a heap-based buffer overflow can occur which allows for remote code execution.

a member, 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

The run-length decoding loop does not check that the number of pixels to fill stays within the allocated scanline buffer, allowing writes past the buffer end.

Impact

A crafted PSD file could cause a heap-based buffer overflow, potentially leading to code execution under the context of the library.

What the attacker needed

Victim opens a malicious .psd file

The fix

The vendor released a patch on 2025-07-30.

How it was found

  1. Craft a PSD file with a header specifying small width and height but a large run-length encoded fill count.
  2. Set the compression field to RLE.
  3. Provide image data where the first byte indicates a fill count that exceeds the buffer size.
  4. Decode the file with the SAIL library to trigger the overflow.

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 a program reads a file, it often allocates a small memory area to hold the data. If the file is crafted so that the program writes more data than the area can hold, it spills into neighbouring memory. This is called a buffer overflow and can let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by A member

View all

110 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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.