Hash: SHA256

             AUSCERT External Security Bulletin Redistribution

                  Ghostscript -- arbitrary code execution
                             5 September 2018


        AusCERT Security Bulletin Summary

Product:           ghostscript
Publisher:         CERT/CC
Operating System:  UNIX variants (UNIX, Linux, OSX)
Impact/Access:     Execute Arbitrary Code/Commands -- Remote/Unauthenticated
                   Denial of Service               -- Remote/Unauthenticated
Resolution:        Mitigation

Original Bulletin: 

- --------------------------BEGIN INCLUDED TEXT--------------------

Vulnerability Note VU#332928

Ghostscript contains multiple -dSAFER sandbox bypass vulnerabilities

Original Release date: 21 Aug 2018 | Last revised: 04 Sep 2018


Ghostscript contains multiple -dSAFER sandbox bypass vulnerabilities, which may
allow a remote, unauthenticated attacker to execute arbitrary commands on a
vulnerable system.


Ghostscript contains an optional -dSAFER option, which is supposed to prevent
unsafe PostScript operations. Multiple PostScript operations bypass the
protections provided by -dSAFER, which can allow an attacker to execute
arbitrary commands with arbitrary arguments. This vulnerability can also be
exploited in applications that leverage Ghostscript, such as ImageMagick,
GraphicsMagick, evince, Okular, Nautilus, and others.

Exploit code for this vulnerability is publicly available.


By causing Ghostscript or a program that leverages Ghostscript to parse a
specially-crafted file, a remote, unauthenticated attacker may be able to
execute arbitrary commands with the privileges of the Ghostscript code. This
action may be triggered with actions as simple as downloading a file from a


The CERT/CC is currently unaware of a practical solution to this problem.
Please consider the following workarounds:

Disable PS, EPS, PDF, and XPS coders in ImageMagick policy.xml

ImageMagick uses Ghostscript by default to process PostScript content.
ImageMagick can be controlled via the policy.xml security policy  to disable
the processing of PS, EPS, PDF, and XPS content. For example, this can be done
by adding these lines to the <policymap> section of the /etc/ImageMagick/
policy.xml file on a RedHat system:

    <policy domain="coder" rights="none" pattern="PS" />
    <policy domain="coder" rights="none" pattern="PS2" />
    <policy domain="coder" rights="none" pattern="PS3" />
    <policy domain="coder" rights="none" pattern="EPS" />
    <policy domain="coder" rights="none" pattern="PDF" />
    <policy domain="coder" rights="none" pattern="XPS" />

Check with your vendor for the proper location of this file on your platform.
Note that this workaround only mitigates the ImageMagick attack vector to

Remove Ghostscript

Because of the number of different attack vectors to get to Ghostscript and the
public availability of exploit code, the most effective protection for this
vulnerability is to remove Ghostscript from your system until a fixed version
is available.

Patch Ghostscript

Artifex software has made the following patches available for Ghostscript:


Vendor Information (Learn More)

        Vendor            Status    Date Notified Date Updated
Artifex Software, Inc. Affected     24 Aug 2018   24 Aug 2018
CentOS                 Affected     21 Aug 2018   22 Aug 2018
Debian GNU/Linux       Affected     21 Aug 2018   22 Aug 2018
Fedora Project         Affected     21 Aug 2018   22 Aug 2018
FreeBSD Project        Affected     21 Aug 2018   22 Aug 2018
Gentoo Linux           Affected     21 Aug 2018   22 Aug 2018
ImageMagick            Affected     24 Aug 2018   24 Aug 2018
Red Hat, Inc.          Affected     21 Aug 2018   21 Aug 2018
SUSE Linux             Affected     21 Aug 2018   22 Aug 2018
Synology               Affected     -             23 Aug 2018
Ubuntu                 Affected     21 Aug 2018   21 Aug 2018
Apple                  Not Affected 21 Aug 2018   27 Aug 2018
CoreOS                 Not Affected 21 Aug 2018   21 Aug 2018
Arch Linux             Unknown      21 Aug 2018   21 Aug 2018
Arista Networks, Inc.  Unknown      21 Aug 2018   21 Aug 2018

If you are a vendor and your product is affected, let us know.View More &raquo

CVSS Metrics (Learn More)

    Group     Score             Vector
Base          7.5   AV:N/AC:L/Au:N/C:P/I:P/A:P
Temporal      6.8   E:F/RL:W/RC:C
Environmental 6.8   CDP:ND/TD:ND/CR:ND/IR:ND/AR:ND


  o http://openwall.com/lists/oss-security/2018/08/21/2
  o https://bugs.chromium.org/p/project-zero/issues/detail-id=1640
  o https://www.imagemagick.org/script/security-policy.php
  o https://www.imagemagick.org/script/resources.php
  o https://www.ghostscript.com/doc/current/Use.htm#Safer
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=b575e1ec
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=8e9ce501
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=241d9111
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=c432131c
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=e01e77a3
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=e01e77a3
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=0edd3d6c
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=a054156d
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=0d390118
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=c3476dde
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=b326a716
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=78911a01
  o http://git.ghostscript.com/-p=ghostpdl.git;a=commitdiff;h=5516c614


This vulnerability was publicly disclosed by Tavis Ormandy.

This document was written by Will Dormann.

Other Information

  o CVE IDs: Unknown
  o Date Public: 21 Feb 2018
  o Date First Published: 21 Aug 2018
  o Date Last Updated: 04 Sep 2018
  o Document Revision: 44

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:


Australian Computer Emergency Response Team
The University of Queensland
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
Comment: http://www.auscert.org.au/render.html?it=1967