CVE-2026-59959

SAIL: WebP decoder division by zero through malformed animated canvas metadata

Published Oct 28, 2026 CVSS 4.0 · 4.8 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The SAIL library contains a WebP decoder bug that can lead to a division by zero during loader initialization when a malformed animated WebP file contains inconsistent container or frame metadata. The bug causes the decoder to compute a pixel width of zero and use it as a divisor, triggering an arithmetic fault that terminates the process. As a result, any application that loads trusted or untrusted WebP images could be made unavailable through crafted input, representing a denial‑of‑service attack. This weakness is mapped to CWE‑369 (Divide By Zero).

Affected Systems

The vulnerability is confined to the HappySeaFox SAIL library version 1.0.1 and earlier. Systems that include this library, such as browsers, media players or any custom application that relies on SAIL for image loading, are affected. The fix is provided in version 1.0.2 and later.

Risk and Exploitability

The CVSS score of 4.8 indicates a moderate severity. No EPSS score is available, so the exploitation probability cannot be quantified, and the vulnerability is not present in the CISA KEV catalog. The likely attack vector is indirect; an attacker can supply a malicious WebP file to any application using the vulnerable SAIL decoder, causing the application to crash and become unavailable. While the bug does not disclose confidential data, it can be leveraged to disrupt services that depend on image parsing.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the HappySeaFox SAIL library to version 1.0.2 or later so that the fixed WebP decoder is used
  • If replacing the library is not immediately possible, ensure the application performs strict input validation or sandbox decoding of WebP files to detect malformed frames or zero canvas dimensions before decoding
  • For environments that process untrusted images, consider temporarily disabling animated WebP support or restricting file size and metadata checks to mitigate potential crashes

Generated by OpenCVE AI on October 28, 2026 at 14:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Happyseafox
Happyseafox sail
Vendors & Products Happyseafox
Happyseafox sail
Type Values Removed Values Added
Description 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.
Title SAIL: WebP decoder division by zero through malformed animated canvas metadata
Weaknesses CWE-369
References
Metrics cvssV4_0

{'score': 4.8, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 29, 2026, 6:39 PM
Reserved
Jul 7, 2026, 6:49 PM
Status
Deferred
Published
Oct 28, 2026, 2:17 PM
Modified
Oct 29, 2026, 7:17 PM