From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,c98fddd80d5f5aed,start X-Google-Attributes: gid10d4db,public From: juphoff@tarsier.cv.nrao.edu (Jeff Uphoff) Subject: SECURITY: Ghostscript problem. Date: 1995/08/22 Message-ID: #1/1 X-Deja-AN: 108700304 followup-to: poster x-palindrome: Doc, note, I dissent: a fast never prevents a fatness; I diet on cod. organization: National Radio Astronomy Observatory keywords: security ghostscript ghostview postscript x-attribution: Up newsgroups: comp.os.linux.announce -----BEGIN PGP SIGNED MESSAGE----- Hi all, There's another problem with ghostscript that makes you vulnerable to attacks via postscript code. Ghostscript has a file type that lets you execute arbitrary commands through the shell. While the -dSAFER option to gs protects you from ordinary file write/rename/removal attacks, it does not check for this special file type. The hole is present in all GNU versions up to 2.6.2 and Aladdin versions earlier than 3.22. Below's a fix to gs_init.ps that fixes this. Please also make sure that all programs that use ghostscript set the -dSAFER option. ghostview 1.5 does by default, but version 1.4 does not. I'd suggest you also check your ps printer filter if you print postscript files using gs, and xdvi if you use a version that uses ghostscript to display postscript \special's. I checked only xdvi-20, and it's safe. Olaf PS: Patch follows. PGP will garble initial `-' characters in the patch; make sure to replace `- -' with `-' before applying it. - ------------------------------------------------------------------ - --- gs_init.ps.orig Sun Aug 20 23:22:01 1995 +++ gs_init.ps Sun Aug 20 23:22:46 1995 @@ -302,7 +302,8 @@ % If we want a "safer" system, disable some obvious ways to cause havoc. SAFER not { (%END SAFER) .skipeof } if /file - - { dup (r) eq + { exch dup /..fname exch def exch + dup (r) eq ..fname (%pipe%*) .stringmatch not and { file } { /invalidfileaccess signalerror } ifelse - ------------------------------------------------------------------ - -- Olaf Kirch | --- o --- Nous sommes du soleil we love when we play okir@monad.swb.de | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax For my PGP public key, finger okir@brewhq.swb.de. -----BEGIN PGP SIGNATURE----- Version: 2.6 iQCVAgUBMDowAOFnVHXv40etAQH3swP8CrvRFW2+wXgqJqQTdCVIgUGk/QasREgP PPwaYKy/oD0ak2HFXXdvkUoMbGlhDqlVbDY7cm0M7wuTAxpejtPxspDlacvQSuO7 XA50N9++2P5npmFWa6IBupz4X69nPlnAVBjk/qF4PbpMKdrgIWx23CqecccBrmeC kezpwwcp32Y= =dhSU -----END PGP SIGNATURE----- ------------------------------------------------------------------------ The normal moderators for this newsgroup (Matt Welsh and Lars Wirzenius) were bypassed for this announcement; we (Olaf Kirch and Jeff Uphoff) have their implicit approval for important security announcements, by prior arrangement. ------------------------------------------------------------------------