Cloudanix VulnDB

CVE-2017-6362

High · 7.5

CVSS

7.5

EPSS

5.1%

Published

Sep 7, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in a common image-handling library lets attackers crash programs that process certain PNG pictures, potentially disrupting services that rely on those programs.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Double free in gdImagePngPtr when processing a PNG palette containing zero colors, resulting in memory corruption that crashes the process.

Why it matters to the business

Applications relying on libgd for image handling can be crashed remotely, causing denial of service and potential downtime for image-dependent services.

How an attack unfolds

An attacker crafts a minimal PNG with an empty color palette and supplies it to any application that calls gdImagePngPtr; the double-free triggers on the second free of the same palette structure, crashing the process.

How to fix it

Upgrade libgd to the commit 8255231b68889597d04d451a72438ab92a405aba or later release containing the fix; rebuild and redeploy all dependent applications.

How to confirm the fix worked

Confirm the installed libgd version or commit hash is at or beyond 8255231b68889597d04d451a72438ab92a405aba; re-test the service with a zero-color-palette PNG to verify it no longer crashes.

Typical attack path

  1. Identify a network endpoint or file upload that invokes libgd PNG encoding
  2. Generate a PNG containing a zero-color palette
  3. Deliver the image to the target function via HTTP, file upload, or API
  4. Trigger gdImagePngPtr to cause the double free and crash

How to detect it

Review application and system logs for repeated crashes or segmentation faults during PNG encoding; correlate with inbound image uploads or API calls that process user-supplied PNG data.

What your security team should do

  • Immediately update all instances of libgd to the fixed commit
  • Scan internal codebases and containers for older libgd versions
  • Add the fixed version to dependency pinning and CI build checks
  • Monitor crash logs for segmentation faults during PNG processing until patches are deployed

The record

Double free vulnerability in the gdImagePngPtr function in libgd2 before 2.2.5 allows remote attackers to cause a denial of service via vectors related to a palette with no colors.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.4 gd 0 2.2.5-r0
Alpine:v3.5 gd 0 2.2.5-r0
Alpine:v3.6 gd 0 2.2.5-r0
Debian:11 libgd2 0 2.2.5-1
Debian:12 libgd2 0 2.2.5-1
Debian:13 libgd2 0 2.2.5-1
Debian:14 libgd2 0 2.2.5-1
Debian:7 libgd2 0 2.0.36~rc1~dfsg-6.1+deb7u10
Debian:8 libgd2 0 2.1.0-5+deb8u11
Debian:9 libgd2 0 2.2.4-2+deb9u2
Mageia:5 libgd 0 2.2.5-1.mga5
Mageia:5 libwmf 0 0.2.8.4-32.5.mga5
Mageia:6 libgd 0 2.2.5-1.mga6
Mageia:6 libwmf 0 0.2.8.4-37.1.mga6
SUSE:Linux Enterprise Desktop 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Desktop 12 SP3 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Server 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Server 12 SP3 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Server for SAP Applications 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Server for SAP Applications 12 SP3 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Software Development Kit 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Software Development Kit 12 SP3 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Workstation Extension 12 SP2 gd 0 2.1.0-24.3.4
SUSE:Linux Enterprise Workstation Extension 12 SP3 gd 0 2.1.0-24.3.4
Ubuntu:14.04:LTS libgd2 0 2.1.0-3ubuntu0.8
Ubuntu:16.04:LTS libgd2 0 2.1.1-4ubuntu0.16.04.8
openSUSE:Tumbleweed gd 0 2.3.3-1.1

Related vulnerabilities