Safeguard
Vulnerability Analysis•

CVE-2020-36773: Critical Memory Corruption in Ghostscript txtwrite

CVE-2020-36773 is a critical memory flaw in Ghostscript before 9.53.0, in the txtwrite device. Upgrade to 9.53.0 or later and check bundled copies.

Safeguard Security Team
3 min read

CVE-2020-36773 is a critical (CVSS 9.8) out of bounds write and use after free in Ghostscript's txtwrite device. A single PDF character code that maps to more than one Unicode code point, such as a ligature, triggers it. Versions before 9.53.0 are affected. Upgrade to 9.53.0 or later.

What's affected

  • Artifex Ghostscript before 9.53.0, per the record. Listed affected releases include 9.51, 9.52 and 9.52.1.
  • Fixed: 9.53.0. The release page I fetched shows the 9.53.0 tag and does not name this CVE, so rely on the record and the project's bug 702229.

The record scores it 9.8 (Critical) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. The record does not flag it as a CISA Known Exploited Vulnerability, and none of the pages I read report exploitation in the wild.

How to check if you're exposed

Run gs --version to see the version. Also check tools that embed or call Ghostscript, such as document converters and image libraries, because they may bundle their own copy. On Debian family systems use dpkg -l ghostscript, and note distributions often backport fixes without changing the upstream version number.

What to do now

  1. Run gs --version on servers and build hosts.
  2. Find software that shells out to Ghostscript.
  3. Upgrade to 9.53.0 or later, or a distribution package that lists this CVE as fixed.
  4. Where conversion of untrusted PDFs is needed, run Ghostscript in a sandbox.
  5. Specifically avoid the txtwrite device on untrusted input until patched.

After you patch, record the new version for Ghostscript in your asset inventory, and confirm it with the same check you used above. A fix that was never verified is easy to forget, and an inventory that shows versions is what lets you answer the next advisory in minutes instead of days.

Why it matters

The record maps this to CWE-787, out of bounds write, and CWE-416, use after free. The text extraction code assumed one character code produces one Unicode value. When a ligature produces several, the buffer is too small, and memory is written outside it.

Ghostscript often sits behind other tools, so the question is not whether you installed it but whether something calls it. Reachability checks help here by showing which of your applications actually invoke the vulnerable path.

To check open source components in your own projects for known CVEs like this one, try the free in-browser dependency scan at gold.safeguard.sh/scan, or look the CVE up in the Gold directory.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Does a distribution backport change the version number?

Often it does not. Check your distribution's security tracker for this CVE rather than relying on the upstream version string.

How do I find every place Ghostscript is used?

Start with an inventory of installed software and versions, because you cannot patch what you have not found. Check servers, build hosts, test copies and anything a vendor bundles. For open source libraries, a dependency scan or SBOM gives the same list for your code.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

We email you a link to confirm, and only then add you to the list. Unsubscribe in one click. Privacy

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.