ghostscript before 6.53 allows attackers to execute arbitrary commands by using .locksafe or .setsafe to reset the current pagedevice.
http://www.securityfocus.com/bid/4937
http://www.redhat.com/support/errata/RHSA-2003-209.html
http://www.redhat.com/support/errata/RHSA-2002-123.html
http://www.redhat.com/support/errata/RHSA-2002-083.html
http://www.iss.net/security_center/static/9254.php
http://www.ghostscript.com/pipermail/gs-code-review/2002-January/001801.html
http://www.ghostscript.com/pipermail/gs-code-review/2002-February/001900.html