---
id: "CVE-2026-59959"
kind: "vulnerability"
aliases: ["CVE-2026-59959"]
title: "SAIL image library: malformed animated WebP crashes the decoder"
severity: "medium"
cvss: 4.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c", "image-processing", "package", "sail", "webp"]
not_affected_if: ["trusted-input-only", "webp-codec-not-built"]
published_at: "2026-10-28T14:17:05+00:00"
first_seen_at: "2026-10-28T14:33:23+00:00"
updated_at: "2026-10-28T14:34:34+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-59959", "first_seen_at": "2026-10-28T14:33:23+00:00"}]
---

# SAIL image library: malformed animated WebP crashes the decoder

SAIL, a cross-platform image loading and saving library, divides by zero when initializing its built-in WebP decoder on a malformed animated WebP file. An attacker who gets a crafted WebP into an application that decodes untrusted images can terminate the process, causing denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed SAIL version and whether it is below `1.0.2`.
- Check whether the build includes the built-in WebP codec (`sail-codecs/webp`).

## Fix

- Upgrade SAIL to `1.0.2` or later.

## Timeline

- 2026-10-28T14:33:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-59959

## From the sources

SAIL is a cross-platform library for loading and saving images with support for animation, metadata, and ICC profiles. Prior to version 1.0.2, the built-in WebP decoder can crash during loader initialization when processing a malformed animated WebP file with inconsistent container or `ANMF` frame metadata. In `sail_codec_load_init_v8_webp()` in `src/sail-codecs/webp/webp.c`, `WebPDemuxGetI` with `WEBP_FF_CANVAS_WIDTH` can return a zero `image_local->width`, which is then used as a divisor when calculating `bytes_per_pixel` from the image row size. The division happens before frame decoding and before generic image skeleton validation in `src/sail/sail_advanced.c`, causing an arithmetic fault and process termination. Applications accepting untrusted WebP images can consequently suffer denial of service; builds must include the affected WebP codec. This issue is fixed in version 1.0.2.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
