CVE-2019-14812: High severity Artifex Ghostscript vulnerability
A flaw was found in all ghostscript versions 9.x before 9.50, in the .setuserparams2 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.
Other sources
In Ghostscript 9.27, some ephemeral routines in .setuserparams2 can expose .forceput operator when hooking errors. This issue is similar to upstream bug https://bugs.ghostscript.com/showbug.cgi?id=700317.
The actual root-cause is in .setuserparams2 however there is no direct path to invoke the operator.
http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=Resource/Init/gslev2.ps;h=98d55fe74251e2b8f384a0a97d0a92a9f88949b6;hb=ebfaa2db4cb518a2bc99c1532d4429201a13dfab#l156
156 /userparams .systemvar 3 1 roll .forceput % userparams is read-only 157 } executeonly 158 { 159 pop pop 160 } ifelse 161 } forall
We can reach .setuserparams2 via setuserparams.
http://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=Resource/Init/gslev2.ps;h=98d55fe74251e2b8f384a0a97d0a92a9f88949b6;hb=ebfaa2db4cb518a2bc99c1532d4429201a13dfab#l169
169 /setuserparams { % <dict> setuserparams - 170 {.setuserparams2} stopped 171 {/setuserparams load $error /errorname get signalerror} if 172 } .bind odef
This can be used to disable -dSAFER and, for example, access files outside of the restricted area, or command execution.
Reference: https://bugs.ghostscript.com/showbug.cgi?id=701444
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/ghostscriptto a version that resolves this vulnerability.Fixed in 9.27~dfsg-2+deb10u5Fixed in 9.27~dfsg-2+deb10u9Fixed in 9.53.3~dfsg-7+deb11u6Fixed in 9.53.3~dfsg-7+deb11u5Fixed in 10.0.0~dfsg-11+deb12u2Fixed in 10.0.0~dfsg-11+deb12u1Fixed in 10.02.0~dfsg-2 - Upgrade
Upgrade
alpine/ghostscriptto a version that resolves this vulnerability.Fixed in 9.27-r3 - Upgrade
Upgrade
alpine/ghostscriptto a version that resolves this vulnerability.Fixed in 9.26-r4 - Upgrade
Upgrade
redhat/ghostscriptto a version that resolves this vulnerability.Fixed in 9.50 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 9.50
Event History
Frequently Asked Questions
What is the vulnerability ID for this flaw?
The vulnerability ID for this flaw is CVE-2019-14812.
What is the severity of CVE-2019-14812?
The severity of CVE-2019-14812 is high, with a severity value of 7.8.
Which versions of ghostscript are affected by CVE-2019-14812?
All ghostscript versions 9.x before 9.50 are affected by CVE-2019-14812.
How can an attacker exploit CVE-2019-14812?
An attacker can exploit CVE-2019-14812 by using a specially crafted PostScript file to disable security protection and gain unauthorized access.
Is there a fix available for CVE-2019-14812?
Yes, a fix is available for CVE-2019-14812. It is recommended to update to ghostscript version 9.50 or later.