Graphite Programs, Signatures and Smuggled Tables: What a Font File Really Contains
Nov 25, 2026, 2:40:36 PM by Joerg Schneider-Simon
A font file is not just a set of letter shapes. It is a directory of tables, some of them programs, and the attacker decides what the directory says. This is episode 13 of File Security 101, our series on file-based threats your anti-malware does not see.
The video explains it in about two minutes.
The article adds the details and the research behind it.
A font is a small database
Fonts reach a computer more often than people think: web pages load them through CSS, PDF and Office documents embed them, and email clients render both. Nobody opens a font on purpose. The font engine in the operating system, the browser or the office suite parses it automatically, as soon as the text is drawn.
Tables: the font's directory
An OpenType or TrueType font starts with a table directory. For each table, it records a four-letter tag, a checksum, an offset from the start of the file and a length (OpenType specification). Standard tables hold the outlines (glyf), the horizontal spacing (hmtx), the mapping from characters to glyphs (cmap) and the names (name). The specification also allows platform vendors and tools to define tables of their own. WOFF, the web font container, wraps the same tables and adds an XML metadata block and a private data block.
Some tables contain programs. Graphite, a technology for "smart fonts" that handle complex writing systems, stores its layout rules in a table called Silf, which the Graphite engine executes. DSIG holds a digital signature, a PKCS#7 block that is not needed to draw a single letter.
The attack: tables that lie
An attacker has two levers. First, extra tables: a Graphite program, a signature table or a private table with any content they want, all of which look like legitimate font data. Second, the directory itself. Offsets and lengths are just numbers. A table can claim to start beyond the end of the file, two tables can claim the same bytes, and the loca table, which records where each glyph begins, can point outside the glyph data. A font engine that trusts those numbers reads or writes outside the memory it allocated. With a carefully built font, that becomes code execution, often with high privileges, because on older Windows versions the font engine ran in the kernel.
It happened
- CVE-2015-2426, 2015. In July 2015, researchers found a flaw in the Windows Adobe Type Manager Library (atmfd.dll) in emails leaked from the spyware vendor Hacking Team. FireEye called it "a straight-to-kernel remote code execution vulnerability" (Computerworld). A crafted OpenType font in a document or on a web page let an attacker take complete control of the system. Microsoft released bulletin MS15-078 out of band on July 20, 2015 (Microsoft). CVE-2015-2426 is in CISA's Known Exploited Vulnerabilities catalog.
- Graphite, 2016. Yves Younan of Cisco Talos found four vulnerabilities in the Libgraphite library used by Firefox, LibreOffice and Linux distributions, triggered by a crafted font served with a web page (Cisco Talos). One of them, CVE-2016-1521, sits in the interpreter that runs Graphite programs and allows arbitrary code execution; another, CVE-2016-1526, in the lookup of the
locatable. Firefox 43 and ESR 38.6.1 shipped the fix.
Why it slips through
A malicious font does contain an exploit, so why does it get through? Every table looks like a valid font table. To check the tables at all, a filter must parse the same directory the attacker wrote, and a new malformed font, built for a specific engine, matches no known signature. Fonts also arrive silently inside documents and web pages, so the user never sees a file to be suspicious of.
What to do
- Keep operating systems, browsers and office suites updated. Font engines receive security fixes regularly.
- On Windows, enable the Group Policy "Untrusted Font Blocking" (Computer Configuration, Administrative Templates, System, Mitigation Options). It blocks fonts outside
%windir%\Fontsfrom being processed by the Windows graphics engine, GDI (Microsoft). Test it first in audit mode.
bowbridge Content Disarm and Reconstruct rebuilds a font from an allow-list of tables: the outlines, spacing, character map and the few tables a renderer needs. Graphite, signature, color and private tables, and the WOFF metadata and private blocks, are not copied. A font whose table directory is malformed, with out-of-bounds or overlapping tables, is refused as a whole.
Join the bowbridge CDR beta program
Sources
- OpenType font file, Microsoft Typography, OpenType 1.9.1 specification
- Microsoft Security Bulletin MS15-078, Microsoft, July 20, 2015
- Microsoft patches Windows zero-day found in Hacking Team's leaked docs, Computerworld, July 20, 2015
- CVE-2015-2426, National Vulnerability Database
- Vulnerability Spotlight: Libgraphite, Cisco Talos, February 5, 2016
- CVE-2016-1521, National Vulnerability Database
- Block untrusted fonts in an enterprise, Microsoft Learn
Share this on social: