Bug 1743737 (CVE-2019-14813)

Summary: CVE-2019-14813 ghostscript: Safer mode bypass by .forceput exposure in setsystemparams (701443)
Product: [Other] Security Response Reporter: Cedric Buissart <cbuissar>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: chazlett, dkaspar, mosvald, sbunciak, security-response-team, twaugh, zdohnal
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ghostscript 9.50 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the setsystemparams procedure where it did not properly secure its privileged calls, enabling scripts to bypass `-dSAFER` restrictions. A specially crafted PostScript file could disable security protection and then have access to the file system, or execute arbitrary commands.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-02 13:07:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1744003, 1744004, 1744005, 1744006, 1747906    
Bug Blocks: 1743530    

Description Cedric Buissart 2019-08-20 14:50:37 UTC
In Ghostscript 9.27, some ephemeral routines in setsystemparams can expose .forceput operator when hooking errors. This issue is similar to upstream bug https://bugs.ghostscript.com/show_bug.cgi?id=700317. 

http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=Resource/Init/gs_lev2.ps;h=98d55fe74251e2b8f384a0a97d0a92a9f88949b6;hb=ebfaa2db4cb518a2bc99c1532d4429201a13dfab#l227

 227          //pssystemparams 3 1 roll .forceput    % pssystemparams is read-only
 228        } executeonly
 229        { pop pop
 230        }
 231       ifelse
 232     }
 233    forall pop

Reference:
https://bugs.ghostscript.com/show_bug.cgi?id=701443

Comment 4 Cedric Buissart 2019-08-21 06:42:57 UTC
Mitigation:

Please refer to the "Mitigation" section of CVE-2018-16509 : https://access.redhat.com/security/cve/cve-2018-16509

Comment 10 Cedric Buissart 2019-08-27 15:21:33 UTC
Acknowledgments:

Name: Artifex Software
Upstream: Hiroki MATSUKUMA (Cyber Defense Institute)

Comment 11 errata-xmlrpc 2019-09-02 07:54:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2586 https://access.redhat.com/errata/RHSA-2019:2586

Comment 12 errata-xmlrpc 2019-09-02 07:54:23 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:2591 https://access.redhat.com/errata/RHSA-2019:2591

Comment 13 Cedric Buissart 2019-09-02 08:52:57 UTC
Created ghostscript tracking bugs for this issue:

Affects: fedora-all [bug 1747906]

Comment 14 Product Security DevOps Team 2019-09-02 13:07:22 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-14813