CVE-2016-9601
Medium · 5.5CVSS
5.5
EPSS
1.7%
Published
Apr 24, 2018
CISA due date
—
Cloudanix analysis
A bug in common PDF-handling software can let attackers crash programs simply by sending a specially made document.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in jbig2_decode_gray_scale_image function during JBIG2 halftone segment decoding, resulting in segmentation fault on malformed input.
Why it matters to the business
Disrupts document processing pipelines and print workflows that rely on Ghostscript, causing application crashes and potential denial of service for PDF/PostScript handling across many systems.
How an attack unfolds
An attacker crafts a JBIG2 image containing malformed halftone segments, embeds it inside a PostScript or PDF document, and delivers the file to a target system. Ghostscript processes the embedded image, triggering the overflow and crash.
How to fix it
Upgrade Ghostscript to version 9.21 or newer on all affected systems; replace or isolate any remaining instances of artifex gpl ghostscript or jbig2dec prior to that release. Restrict processing of untrusted documents until patched.
How to confirm the fix worked
Run 'gs --version' to confirm release 9.21 or later; reprocess known-good and known-bad sample documents to verify absence of crashes.
Typical attack path
- Create malicious JBIG2 image with crafted halftone data
- Embed image inside PDF or PostScript document
- Deliver document via email, web download, or file share
- Victim system opens document with vulnerable Ghostscript
How to detect it
Monitor process logs and system crash reports for Ghostscript segmentation faults during PDF or PostScript handling; search for repeated invocations of jbig2_decode_gray_scale_image in stack traces.
What your security team should do
- Prioritize upgrade of Ghostscript across all environments given the multi-year exposure window
- Implement sandboxing or container isolation for document processing services
- Add file-type filtering or pre-scanning for JBIG2 content in inbound documents
- Review and retire any remaining pre-9.21 deployments
The record
ghostscript before version 9.21 is vulnerable to a heap based buffer overflow that was found in the ghostscript jbig2_decode_gray_scale_image function which is used to decode halftone segments in a JBIG2 image. A document (PostScript or PDF) with an embedded, specially crafted, jbig2 image could trigger a segmentation fault in ghostscript.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | jbig2dec | 0 | 0.13-4 |
| Debian:12 | jbig2dec | 0 | 0.13-4 |
| Debian:13 | jbig2dec | 0 | 0.13-4 |
| Debian:7 | jbig2dec | 0 | 0.13-4~deb7u1 |
| Debian:8 | jbig2dec | 0 | 0.13-4~deb8u1 |
| Mageia:5 | ghostscript | 0 | 9.20-1.mga5 |
| Mageia:5 | gutenprint | 0 | 5.2.10-5.1.mga5 |
| Mageia:5 | jbig2dec | 0 | 0.13-1.mga5 |
| Mageia:5 | libspectre | 0 | 0.2.7-5.1.mga5 |
| SUSE:Linux Enterprise Desktop 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Desktop 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server 11 SP4 | ghostscript-library | 0 | 8.62-32.47.7.1 |
| SUSE:Linux Enterprise Server 11 SP4 | ghostscript-library | 0 | 8.62-32.47.10.1 |
| SUSE:Linux Enterprise Server 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server 12-LTSS | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | ghostscript-library | 0 | 8.62-32.47.7.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | ghostscript-library | 0 | 8.62-32.47.10.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | ghostscript-library | 0 | 8.62-32.47.7.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | ghostscript-library | 0 | 8.62-32.47.10.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | ghostscript | 0 | 9.15-22.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | ghostscript | 0 | 9.15-20.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | ghostscript | 0 | 9.15-22.1 |
| Ubuntu:14.04:LTS | jbig2dec | 0 | 0.11+20120125-1ubuntu1.1 |
| Ubuntu:16.04:LTS | jbig2dec | 0 | 0.12+20150918-1ubuntu0.1 |
Related vulnerabilities
- CVE-2017-9216 libjbig2dec.a in Artifex jbig2dec 0.13, as used in MuPDF and Ghostscript, has a NULL… Also affects jbig2dec
- CVE-2016-7976 The PS Interpreter in Ghostscript 9.18 and 9.20 allows remote attackers to execute… Also affects ghostscript
- CVE-2017-11714 psi/ztoken.c in Artifex Ghostscript 9.21 mishandles references to the scanner state… Also affects ghostscript
- CVE-2017-8291 Artifex Ghostscript through 2017-04-26 allows -dSAFER bypass and remote command execution… Also affects ghostscript
- CVE-2016-10317 The fill_threshhold_buffer function in base/gxht_thresh.c in Artifex Software, Inc. Also affects ghostscript
- CVE-2016-10217 The pdf14_open function in base/gdevp14.c in Artifex Software, Inc. Also affects ghostscript
- CVE-2015-3228 Integer overflow in the gs_heap_alloc_bytes function in base/gsmalloc.c in Ghostscript… Also affects ghostscript
- CVE-2013-5653 The getenv and filenameforall functions in Ghostscript 9.10 ignore the "-dSAFER"… Also affects ghostscript