First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 128647
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Martin von Gagern <Martin.vGagern@gmx.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 128647 depends on: Show dependency tree
Show dependency graph
Bug 128647 blocks: 132213

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-04-03 08:51 0000
ps2epsi from the ESP version of GhostScript deletes a temporary file created by
mktemp. This file is later an argument to gs, although with -dSAFER specified.

A malicious user could watch the temporary directory, e.g. using inotify. Once
a file is created and deleted, it could try to replace it with an own copy,
which would then be processed with the privileges of the user calling ps2epsi.
The attack would depend on the watching process getting processing time before
ps2epsi can recreate the file but after it has checked the file is really gone.
This is at least possible, although I don't know if it's probable.

At the very least he could introduce his own contents instead or additionally
to the document provided by the user. I don't know if -dSAFER is safe enough to
prevent worse attacks.

As a solution, the file should be kept and overwritten, and only deleted by the
signal handler already present.

------- Comment #1 From Stefan Cornelius (RETIRED) 2006-04-03 09:02:07 0000 -------
printing please verify and provide fixed ebuilds if needed, thank you.

------- Comment #2 From Stefan Schweizer 2006-04-03 14:51:13 0000 -------
ebuild done, ghostscript-esp-8.15.1-r1.ebuild

------- Comment #3 From Stefan Schweizer 2006-04-03 14:58:59 0000 -------
actually, gs-esp-8 cannot be marked stable due to the numerous unsolved bugs in
bugzilla. I would like the afpl one in the other bug be marked stable though.
Do you want me to patch the stable -7 series of gs-esp? Or do you want to tell
people to use -gnu or -afpl in the GLSA?

Also -gnu is now the global default with the new-style virtual/ghostscript
because -esp-8 has so many bugs.

------- Comment #4 From Thierry Carrez (RETIRED) 2006-04-15 05:16:16 0000 -------
Stefan: probably better to patch the -7 line if you can.

------- Comment #5 From Thierry Carrez (RETIRED) 2006-04-22 03:24:26 0000 -------
Printing herd please patch the current stable series or advise

------- Comment #6 From Stefan Schweizer 2006-04-22 11:05:11 0000 -------
well, advice is to not recommend either ghostscript-esp in a security GLEP
because both series have serious bugs.

Just tell people to switch to -gnu, ok?

------- Comment #7 From Thierry Carrez (RETIRED) 2006-04-23 10:17:09 0000 -------
The vulnerability is not serious enough to warrant a MaskGLSA so we'll probably
just security.mask the two as having persistent security problems and not issue
anything. The message will recommand users to switch to the gnu version.

Security, please comment

------- Comment #8 From Sune Kloppenborg Jeppesen 2006-04-23 12:45:05 0000 -------
I agree with comment #7.

------- Comment #9 From Stefan Schweizer 2006-04-30 04:56:24 0000 -------
ghostscript-esp-8.15.1_p20060430 fixes a thus far serious bug in gs-esp. I
cannot find any other bugs open for gs-esp-8 so
probably it should be marked stable instead of just masking the old version.

------- Comment #10 From Thierry Carrez (RETIRED) 2006-05-02 09:41:12 0000 -------
We can try...
Arches please test and mark ghostscript-esp-8.15.1_p20060430 stable if you can

------- Comment #11 From Thomas Cort (RETIRED) 2006-05-02 12:08:41 0000 -------
(In reply to comment #10)
> Arches please test and mark ghostscript-esp-8.15.1_p20060430 stable if you can

I've done some testing on a stable amd64 system and have encountered a problem
with either ps2epsi or epstopdf (from tetex). Using paper.ps[1] I ran `ps2epsi
paper.ps` and got paper.epsi[2] (which is 57M, is that normal?). I then ran
`epstopdf paper.epsi` and got a pdf[3]. However, when I open the pdf in gpdf it
is all on one page. I ran `ps2pdf paper.ps` and got a good looking pdf[4]. Am I
doing something completely wrong here (note, I have 0 experience with
encapulated ps)? There were no warnings or errors when I ran the commands I
mentioned.

[1] http://dev.gentoo.org/~tcort/examples/paper.ps
[2] http://dev.gentoo.org/~tcort/examples/paper.epsi.bz2
[3] http://dev.gentoo.org/~tcort/examples/paper-from-epsi.pdf
[4] http://dev.gentoo.org/~tcort/examples/paper-from-ps.pdf

app-text/ghostscript-esp-8.15.1_p20060430  +X -cjk +cups -emacs +gtk -threads
-xml
app-text/tetex-2.0.2-r9  +X -doc -tcltk
app-text/gpdf-2.10.0-r4  -debug

# emerge --info
Portage 2.0.54 (default-linux/amd64/2006.0, gcc-3.4.5, glibc-2.3.5-r2,
2.6.15-gentoo-r7 x86_64)
=================================================================
System uname: 2.6.15-gentoo-r7 x86_64 AMD Turion(tm) 64 Mobile Technology ML-32
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig collision-protect cvs distlocks multilib-strict
sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrored.ca/ http://adelie.polymtl.ca/
http://gentoo.arcticnetwork.ca/ http://gentoo.osuosl.org/ "
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="amd64 X aac acpi aim alsa audacious audiofile avi berkdb bitmap-fonts
browserplugin bzip2 cdr cli crypt cups curl dbus dri eds emboss encode esd exif
expat fam flac foomaticdb gif glut gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml
hal icq idn imlib ipv6 isdnlog jabber java jpeg kde lcms libwww lua lzw
lzw-tiff mad mikmod mng mono mozilla moznocompose moznoirc moznomail mp3 mpeg
msn ncurses nls nocd nptl nptlonly nsplugin offensive ogg oggvorbis openal
opengl oscar pam pcre pdflib perl png pppd python qt quicktime readline
reflection sdl session shorten sndfile spell spl ssl symlink tcpd tetex tiff
truetype truetype-fonts type1-fonts udev usb userlocales vorbis wxgtk1 xml2
xmms xorg xpm xv xvid yahoo zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS

------- Comment #12 From Matthias Langer 2006-05-02 18:36:08 0000 -------
I've done some testing with ghostscript-esp-8.15.1_p20060430 [  +X -cjk +cups
-emacs +gtk -threads +xml ] on x86. For testing i've opened a view ps files and
verified that they are displayed correctly using evnince-0.4.0-r3 [  +dbus
-debug -doc +dvi +nautilus -t1lib +tiff ]. However, i can also confirm the
behavour mentioned in comment #11 (with evenice instead of gpdf). Btw. i'm
using tetex-2.0.2-r8  [ +X -doc +tcltk ].

Portage 2203-svn (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.6-r3,
2.6.16-gentoo-r3 i686)
=================================================================
System uname: 2.6.16-gentoo-r3 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks sandbox sfperms strict test"
GENTOO_MIRRORS="http://gentoo.inode.at/ "
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LINGUAS="en de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.0.1/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac aalib acpi alsa apm audiofile avi berkdb
bitmap-fonts bonobo bzip2 cairo cdr cli crypt css cups curl dbus directfb dri
dts dvd dvdr dvdread eds emboss encode exif expat fam fbcon ffmpeg firefox flac
foomaticdb fortran gd gdbm gif ginac glut gmp gnome gphoto2 gpm gstreamer gtk
gtk2 gtkhtml guile hal icq idn imagemagick imlib ipv6 isdnlog java javascript
jpeg jpeg2k junit lcms libg++ libwww mad mikmod mime mmx mmxext mng motif
mozsvg mp3 mpeg msn nautilus ncurses nls nptl nsplugin nvidia offensive ogg
oggvorbis openal opengl pam pcre pdflib perl plotutils png posix pppd python
quicktime readline real reflection ruby sdl session slang sockets speex spell
spl sqlite sqlite3 sse ssl subtitles svg svga tcltk tcpd tetex theora tiff
truetype truetype-fonts type1-fonts udev unicode usb vcd vorbis win32codecs wma
xine xml xml2 xmms xorg xv xvid zlib linguas_en linguas_de userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LDFLAGS

------- Comment #13 From Matthias Langer 2006-05-02 18:59:27 0000 -------
When trying to reproduce the behavour in comment #11 with
ghostscript-gnu-8.16-r3 [ +X -cjk +cups -emacs +gtk ] on the box descibed in
comment #12 (x86) i got basically the same results, with the exception that i
got a warning:

$ ps2epsi paper.ps
sed: -e expression #1, char 42: Invalid range end

If i should try the same with different ghostscript-(gnu/esp) versions, let me
know.

------- Comment #14 From Stefan Schweizer 2006-05-05 06:40:00 0000 -------
*** Bug 132342 has been marked as a duplicate of this bug. ***

------- Comment #15 From Stefan Schweizer 2006-05-05 06:46:28 0000 -------
Adding kde metabug

 Matthias: Yes, please open a separate bug for ps2epsi if it is indeed a bug
and the behavious in other ghostscripts is different.

------- Comment #16 From Matthias Langer 2006-05-06 14:02:01 0000 -------
I've now also tried to reproduce comment #11 with ghostscript-gnu-8.16-r1 [ +X
-cjk +cups +gtk ] and got exactly the same results as decribed in comment #13.
After that i did the same again, but this time with another ps file as source
(215 pages / 1.1MB) and got:

$ ps2epsi a1.ps
Error: /stackoverflow in --roll--
Operand stack:
   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--  
--nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3  
%oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
--nostringval--   --nostringval--   --nostringval--   --nostringval--   false  
1   %stopped_push   --nostringval--   --nostringval--   --nostringval--   421  
1   660   --nostringval--   %for_pos_int_continue   --nostringval--  
--nostringval--   50365 6   %oparray_pop   --nostringval--
Dictionary stack:
   --dict:1118/1686(ro)(G)--   --dict:0/20(G)--   --dict:73/200(L)--  
--dict:36/47(L)--   --dict:139/300(L)--   --dict:36/47(L)--
Current allocation mode is local
Last OS error: 2
GNU Ghostscript 8.16: Unrecoverable error, exit code 1
sed: -e expression #1, char 42: Invalid range end

------- Comment #17 From Matthias Langer 2006-05-06 14:57:34 0000 -------
I've now tested ps2epsi with all ghostscript versions in portage (afpl, gnu,
esp) and it seems to be broken for all of them. Thus i think comment #11 -
comment #16 should not be a reason to leave ghostscript-esp-8.15.1_p20060430 in
~arch.

------- Comment #18 From Thierry Carrez (RETIRED) 2006-05-09 09:50:31 0000 -------
Yes, please mark stable if it doesn't do worse than the current stable...

------- Comment #19 From Thomas Cort (RETIRED) 2006-05-09 10:26:47 0000 -------
(In reply to comment #10)
> Arches please test and mark ghostscript-esp-8.15.1_p20060430 stable if you can

alpha and amd64 stable.

------- Comment #20 From Mark Loeser 2006-05-11 11:36:33 0000 -------
x86 done, thanks for testing Matthias

------- Comment #21 From Emanuele Giaquinta (RETIRED) 2006-05-13 01:52:12 0000 -------
ppc done.

------- Comment #22 From Jason Wever (RETIRED) 2006-05-13 16:05:47 0000 -------
SPARC'd

------- Comment #23 From Markus Rothe 2006-05-14 00:20:50 0000 -------
stable on ppc64

------- Comment #24 From Marko Steinberger 2006-05-14 08:46:48 0000 -------
Just an additional note. After updating ghostscript-esp my printer stopped
working. Switching to ghostscript-gnu did not solve my problem at first. I also
had to reemerge gimp-print.
I am just reporting this because some people already seem to have similar
problems: 

http://forums.gentoo.org/viewtopic-t-434182-highlight-ghostscript.html

If there will be a GLSA then I suggest thinking about mentioning this.

------- Comment #25 From Thierry Carrez (RETIRED) 2006-05-14 09:55:52 0000 -------
Ready for GLSA vote, I vote NO, because ps2epsi is rather uncommon use.

------- Comment #26 From Raphael Marichez 2006-05-14 15:04:20 0000 -------
another no

------- Comment #27 From Marko Steinberger 2006-05-14 17:30:51 0000 -------
Bug #133123 is about broken gimp-print.

------- Comment #28 From Sune Kloppenborg Jeppesen 2006-05-14 22:41:27 0000 -------
Closing without GLSA.

------- Comment #29 From René Nussbaumer 2006-05-15 10:36:49 0000 -------
stable on hppa. Forgot to remove us from CC.

First Last Prev Next    No search results available      Search page      Enter new bug