CVE-2025-59734 Details
Description
It is possible to cause an use-after-free write in SANM decoding with a carefully crafted animation using subversion <2. When a STOR chunk is present, a subsequent FOBJ chunk will be saved in ctx->stored_frame. Stored frames can later be referenced by FTCH chunks. For files using subversion < 2, the undecoded frame is stored, and decoded again when the FTCH chunks are parsed. However, in process_frame_obj if the frame has an invalid size, there’s an early return, with a value of 0. This causes the code in decode_frame to still store the raw frame buffer into ctx->stored_frame. Leaving ctx->has_dimensions set to false. A subsequent chunk with type FTCH would call process_ftch and decode that frame obj again, adding to the top/left values and calling process_frame_obj again. Given that we never set ctx->have_dimensions before, this time we set the dimensions, calling init_buffers, which can reallocate the buffer in ctx->stored_frame, freeing the previous one. However, the GetByteContext object gb still holds a reference to the old buffer. Finally, when the code tries to decode the frame, codecs that accept a GetByteContext as a parameter will trigger a use-after-free read when using gb. GetByteContext is only used for reading bytes, so at most one could read invalid data. There are no heap allocations between the free and when the object is accessed. However, upon returning to process_ftch, the code restores the original values for top/left in stored_frame, writing 4 bytes to the freed data at offset 6, potentially corrupting the allocator’s metadata. This issue can be triggered just by probing whether a file has the sanm format. We recommend upgrading to version 8.0 or beyond.
A use-after-free write vulnerability has been identified in the SANM decoding process for animations using subversion prior to 2. When a STOR chunk is present, a subsequent FOBJ chunk is saved in the context's stored_frame. This stored frame can later be accessed by FTCH chunks. However, for files with subversion prior to 2, the frame is stored undecoded and then decoded when FTCH chunks are processed. If the frame size is invalid, the decoding process returns early, but the raw frame buffer is still stored, leaving the context's dimension flag false. When an FTCH chunk is later processed, the missing dimensions are set, which can trigger a buffer reallocation that frees the old buffer while a reference to it is still held. This mismanagement can lead to a use-after-free read, potentially allowing codecs that read bytes to access invalid data. Although this read could be exploited to corrupt allocator metadata by writing to the freed memory, the vulnerability can be triggered simply by checking if a file is in the SANM format.
Users are advised to upgrade to version 8.0 or later.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 6, 2025CISA-ADP
Assessed Oct 8, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://issuetracker.google.com/440183164 | [email protected] |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-416 | Use After Free | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Google SANM | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 19, 2025 | CVE Modified | [email protected] |
| Oct 6, 2025 | New CVE Received | [email protected] |
Volerion