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

SAIL Image Decoding Library PSD Image Decoding integer overflow vulnerability

An integer overflow in the SAIL image decoding library when processing a crafted PSD file causes an undersized heap buffer to be allocated, leading to a heap-based buffer overflow during decoding. An attacker could exploit this to achieve remote code execution by convincing a victim to open a malicious PSD file.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A memory corruption vulnerability exists in the PSD Image Decoding functionality of the SAIL Image Decoding Library v0.9.8. When loading a specially crafted .psd file, an integer overflow can be made to occur when calculating the stride for decoding.

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 width and height from the PSD header are multiplied by the bytes per pixel without checking for integer overflow, resulting in a small buffer allocation that is later overflowed during decoding.

Impact

A remote attacker could cause a heap-based buffer overflow, potentially leading to code execution under the context of the library, if a user opens a malicious PSD file.

What the attacker needed

Victim opens a malicious PSD file; library used to decode PSD files

The fix

The vulnerability was fixed by the vendor in a patch release.

How it was found

  1. Craft a PSD file with a valid signature and version, and set the width to a large value such that width times bytes per pixel overflows 32 bits.
  2. Set the compression type to RLE and provide image data that will be written into the undersized buffer.
  3. Open the crafted PSD file with the SAIL library or a program using it.
  4. The library allocates a buffer based on the overflowed size and then writes decoded pixel data beyond its bounds, causing a heap buffer 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 an image file, it calculates how much memory to set aside for the image data. If the numbers in the file are very large, the calculation can wrap around to a small number, so the program sets aside too little memory. Later, when it writes the actual image data into that small space, it overflows into other memory, which an attacker can use to 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.