PostScript’s sudden death in Sonoma

If there’s one language that’s been at the heart of the Macintosh for the last 39 years it’s PostScript, the page description language developed by the founders of Adobe, the late John Warnock and Charles Geschke, and their team of engineers. It brought the Mac’s first commercial success in desktop publishing, in PostScript fonts, and early PostScript printers including Apple’s game-changing LaserWriter. Although Mac OS X never inherited NeXTStep’s Display PostScript, its descendant Quartz and Core Graphics are still based on PostScript’s relative PDF.

Following a short illness that started in macOS Monterey 12.3, PostScript has died suddenly in Sonoma.

The first sign passed almost unnoticed in Apple’s release notes to macOS 12.3, where it recorded the “deprecation” of PostScript in WebKit: “Support for inline viewing of PostScript files is no longer available.”

Then in macOS 13.0, Preview lost the ability to convert PostScript and EPS: “The Preview app included with your Mac supports PostScript (.ps) and Encapsulated PostScript (.eps) files in macOS Monterey or earlier. Starting with macOS Ventura, Preview no longer supports these files. Other apps that can view or convert .ps and .eps files are available from the App Store and elsewhere.”

Finally, the complete removal of support for PostScript and EPS was recorded as another “deprecation” in the release notes for Sonoma: “macOS has removed the functionality for converting PostScript and EPS files to PDF format. As a result, CoreGraphics’ CGPSConverter returns an error when invoked, ImageIO no longer converts EPS files, NSEPSImageRep does not display EPS files, and PMPrinterPrintWithFile does not accept a PostScript file for non-PostScript print queues.”

Search of Apple’s previous release notes doesn’t reveal any prior warnings of this removal of support or deprecation (in the general meaning of the term), in contrast to other removals from Sonoma such as ATS/ATSUI. Although conversion from PostScript and EPS must now be in relatively little demand, its demise has been rapid, as if Apple can’t wait for macOS to be rid of it. The most likely reason is security.

PostScript is an old stack-based interpreted language designed at a time when code security had barely been conceived, and malicious software hardly existed. Among its attractive features is the fact that any PostScript object can be treated as data, or executed as part of a program, and can itself generate new objects that can in turn be executed. More recently, security researchers have drawn attention to the fact that it’s a gift for anyone wishing to write and distribute malicious code. As it’s effectively an image format, embedding malware inside a PostScript file could enable that to be run without user interaction, as with some other graphics formats.

There are three major PostScript interpreters in common use:

  • Adobe’s Distiller engine, built into its Acrobat products,
  • Apple’s PSNormalizer engine, built into macOS,
  • Artifex’s open source engine, built into Ghostscript, and widely used in Linux and other platforms.

Research into those engines has so far been relatively limited, but has revealed some serious vulnerabilities. Most recently, Kai Lu and Brett Stone-Gross of Zscaler’s ThreatLabz published an account of three vulnerabilities they found in Distiller, and one in PSNormalizer, in 2022. Those were fixed by Adobe and Apple last year, in the latter case in macOS Monterey 12.5 released on 20 July 2022, and its equivalent security updates for Big Sur and Catalina. From the dates, I suspect that the removal of support for inline viewing of PostScript files in WebKit in Monterey 12.3 may also have been part of Apple’s mitigations.

Apple was most probably prompted into conducting a security audit of PSNormalizer as a result of the vulnerability reported, and would have been faced with the choice of re-engineering it or removing it from macOS completely. Unlike the PDF engine in Quartz, PSNormalizer is now little used, and has no significant role in macOS. The first step was to make it inaccessible from the GUI by disabling that feature in Ventura’s Preview, then following that in Sonoma by removing PSNormalizer altogether, so removing its command tool pstopdf and Core Graphics’ CGPSConverter.

This leaves those still wishing to convert PostScript files with a choice between Adobe’s Distiller in its paid-for Acrobat products, and Artifex’s Ghostscript, which has had its own share of vulnerabilities. There is also a third option, of running a late version of macOS Monterey in a lightweight VM and continuing to use PSNormalizer through Preview there. For most, that will be the cheapest and simplest option.

John Warnock, co-founder of Adobe and driving force behind PostScript, died on 19 August this year. His page description language had brought success to the Mac for almost 39 years, but at least PDF lives on.

I’m very grateful to Ben for drawing my attention to the changes in Sonoma.

Postscript (it’s only appropriate)

I’m now starting to see warnings from third-party app developers that, in Sonoma, their apps will be unable to open or import EPS files, for example, as they can no longer convert them using Quartz in macOS 14. Although the impact on most of us should be very small or negligible, if you do still use EPS or PostScript at any scale, you will need to prepare a solution for continuing to do so after upgrading to Sonoma. I wish you success.