Instituto Nacional de ciberseguridad. Sección Incibe
Instituto Nacional de Ciberseguridad. Sección INCIBE-CERT

CVE-2025-59734

Gravedad CVSS v4.0:
ALTA
Tipo:
CWE-416 Utilización después de liberación
Fecha de publicación:
06/10/2025
Última modificación:
19/10/2025

Descripción

*** Pendiente de traducción *** It is possible to cause an use-after-free write in SANM decoding with a carefully crafted animation using subversion stored_frame. Stored frames can later be referenced by FTCH chunks. For files using subversion stored_frame. Leaving ctx-&gt;has_dimensions set to false.<br /> <br /> 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.<br /> Given that we never set ctx-&gt;have_dimensions before, this time we set the dimensions, calling init_buffers, which can reallocate the buffer in ctx-&gt;stored_frame, freeing the previous one. However, the GetByteContext object gb still holds a reference to the old buffer.<br /> <br /> <br /> <br /> <br /> 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.<br /> <br /> 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.<br /> <br /> This issue can be triggered just by probing whether a file has the sanm format.<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> We recommend upgrading to version 8.0 or beyond.

Referencias a soluciones, herramientas e información