Skip to content
Memory corruption Write-up Advanced

(CVE-2020-9816) macOS libFontParser HeapOverflow Vulnerability

A heap overflow exists in the Type1 font parser of libFontParser when calculating decrypted buffer size from the IV and encrypted buffer size. An attacker could craft a malicious PDF containing a malicious font to potentially achieve remote code execution on Apple devices.

starlabs.sg

Published on starlabs.sg

This vulnerability exists in libFontParser.dylib, which is a part of CoreGraphic library is widely used in macOS, iOS, iPadOS to parse Font. Attacker can craft an evil PDF contains malicious font could leads to remote code execution in Apple devices.

The author, on starlabs.sg

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the parser calculates the decrypted buffer size from the IV and encrypted buffer size but fails to verify that the decrypted buffer size matches or is bounded by the encrypted buffer size, leading to a heap overflow.

What the attacker needed

Victim opens a malicious PDF

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A font parser is a program that reads font files to display text. This parser made a mistake when calculating how much memory to reserve for decrypted font data, so a specially crafted font inside a PDF could overflow that memory. That overflow could let an attacker run their own code on the device.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.