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.
https://security.gentoo.org/glsa/202004-03
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-14812
https://bugs.ghostscript.com/show_bug.cgi?id=701444