CVE-2021-45909
High · 7.8CVSS
7.8
EPSS
0.9%
Published
Dec 28, 2021
CISA due date
—
Cloudanix analysis
A program that turns GIF pictures into another format can be tricked by a bad image file into letting an attacker take over the computer.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Patch
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in the DecodeLZW function permits writing arbitrary attacker-controlled data beyond allocated buffer boundaries, resulting in memory corruption and potential arbitrary code execution.
Why it matters to the business
Processing untrusted GIF images with the affected converter can lead to full system compromise on user workstations or build servers, enabling malware deployment or data theft with no vendor fixes available.
How an attack unfolds
An attacker creates a specially crafted GIF containing an oversized LZW stream that triggers the overflow during decoding; the victim opens or converts the file locally, allowing the overflow to corrupt heap structures and redirect execution to attacker-supplied code.
How to fix it
Immediately discontinue use of gif2apng 1.9; replace with alternative GIF conversion utilities or updated forks that have addressed the DecodeLZW bounds issue; isolate or remove the binary from all build and user environments.
How to confirm the fix worked
Confirm absence of the gif2apng 1.9 binary; run version checks across systems and CI pipelines; test conversion of known malformed GIF samples in isolated environments to verify no overflow occurs.
Typical attack path
- Generate malicious GIF with oversized LZW data targeting DecodeLZW
- Deliver file via email, web download, or archive
- Victim invokes gif2apng on the file
- Overflow occurs, enabling code execution or crash
How to detect it
Search process execution logs and EDR telemetry for gif2apng invocations on untrusted GIF files; inspect crash dumps or heap corruption indicators around LZW decoding routines; review file-access histories for recently converted suspicious images.
- gif2apng
- DecodeLZW
What your security team should do
- Inventory all instances of gif2apng and remove or replace them
- Block execution of the binary via application allow-listing
- Scan mail and file shares for GIFs that may trigger the flaw
- Monitor endpoint logs for gif2apng crashes or unexpected child processes
The record
An issue was discovered in gif2apng 1.9. There is a heap-based buffer overflow vulnerability in the DecodeLZW function. It allows an attacker to write a large amount of arbitrary data outside the boundaries of a buffer.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | gif2apng | 0 | 1.9+srconly-3+deb11u1 |
| Debian:9 | gif2apng | 0 | 1.9+srconly-2+deb9u2 |
| Ubuntu:18.04:LTS | gif2apng | 0 | 1.9+srconly-2ubuntu0.1 |
| Ubuntu:20.04:LTS | gif2apng | 0 | 1.9+srconly-3ubuntu0.1 |
| Ubuntu:Pro:16.04:LTS | gif2apng | 0 | 1.7-3ubuntu0.1~esm1 |
| Ubuntu:Pro:18.04:LTS | gif2apng | 0 | No fix |
Related vulnerabilities
- CVE-2021-45911 An issue was discovered in gif2apng 1.9. Also affects gif2apng
- CVE-2021-45910 An issue was discovered in gif2apng 1.9. Also affects gif2apng
- CVE-2026-111497 A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli… CWE-787
- CVE-2026-112397 Pillow is a Python imaging library. CWE-787
- CVE-2026-112059 libLAS through 1.8.1 contains a heap out-of-bounds write vulnerability in the point… CWE-787
- CVE-2026-89088 A flaw was found in parted. CWE-787
- CVE-2026-89085 A flaw was found in parted. CWE-787
- CVE-2026-85746 MariaDB server is a community developed fork of MySQL server. CWE-787