This reproduction uses one server-delivered resource pack to launch Windows Calculator from the Mojang-signed Minecraft 26.3 client. The writeup below explains the native TrueType primitive and the complete chain from font bytecode to the Windows API call.
From 64-bit Python 3 on Windows, run:
The script prepares official Minecraft dependencies on first use, starts a local server and visible stock client, serves resource-pack.zip , and sends the fixed F/A font sequence. The terminal shows the pack's numeric memory layout, glyph code points, and each font face as it is sent. Calculator remains open for inspection when the proof succeeds. Generated dependencies and run output stay in ignored local directories.
The PoC configures its own localhost server as trusted for promptless pack loading. The same pack can also be used with normal resource-pack acceptance on an untrusted server.
This is a build-specific proof of code execution in the Mojang-signed Minecraft Java 26.3 Windows client with bundled FreeType 2.14.3 x64. A server supplies one resource pack containing crafted TrueType fonts, then sends ordinary actionbar text. Font hinting reaches a native out-of-bounds write, and the font's bytecode turns it into an ASLR-aware control-flow transfer. The benign action launches calc.exe and exits the client.
The PoC artifact is resource-pack.zip , SHA-1 F2E2859318152E32FC331D2291C2EC40FFB3C372 for the server's resource-pack-sha1 setting.
1. Native primitive: a composite-glyph SHZ sweep
The entry point is TrueType hinting during FreeType glyph loading. The crafted composite uses a 100-real-point grooming glyph to obtain an allocation for 104 FT_Vector points , or 0x340 bytes. Its nested component creates a zone whose cur pointer begins at point buffer P + 0x208 , with 66 apparent points. In FreeType 2.14.3 src/truetype/ttinterp.c , Ins_SHZ takes its limit from the zone's final contour and calls Move_Zp2_Point for each index without checking the physical point allocation. The crafted displacement is +0x80 on the x axis, sweeping vector x lanes through P + 0x410 , past the allocation ending at P + 0x340 .
The useful heap layout has the live 832-byte TT_ExecContextRec at P + 0x350 . The sweep then reaches interpreter fields, including error at context offset +0x20 and the zone cur pointer at +0xC0 . Adding 0x80 to the former produces FreeType's Invalid_Opcode error value. FreeType's error dispatch finds the font-defined IDEF for opcode 0x36 (SHZ), so execution enters a recovery program supplied by the same font. Adding 0x80 to zp2.cur changes the interpreter's later point operations into reads and writes of context memory. This is a same-glyph transition: the font does not need a second pack or a process-address oracle.
This geometry is conditional on allocator placement. The delivered pack includes 144 distinct font resources and exercises them in a fixed order to increase the chance that at least one has the required point/context adjacency. The sender never reads addresses or chooses a face from a scan.
2. Bytecode recovery and writable state
The IDEF body first uses GC to read the swept interpreter callback and the glyph-instruction pointer as low and high 32-bit values. It then uses SHPIX to repair the swept heap header and the context fields needed by the interpreter and allocator. The repair is deliberately limited to indices whose tag writes remain inside the 104-point tag buffer. The final builder also appends an inverse SHZ on the normal, non-IDEF path.
Before staging the payload, the bytecode checks that the context has the expected relative FreeType callback layout, that the presumed instruction pointer is the currently advancing IDEF instruction pointer, and that active storage equals the persistent glyph storage after its first WS . These checks reduce false context matches. They are not a formal proof that every near layout is harmless; a nonmatching SHZ sweep can still touch native memory before a check runs.
The F glyph performs a genuine TrueType WS , causing FreeType to allocate persistent glyfStorage for 16,384 32-bit cells. The A glyph's IDEF program writes the full ROP data there using WS , including pointers assembled from live values. The emitted bytecode handles 32-bit carry and borrow when constructing 64-bit addresses. No C-side writes or process-memory patching occur in the delivered run.
3. Native stack pivot with API headroom
The font declares maxp.maxStackElements = 8192 . In this FreeType build, src/truetype/ttobjs.c assigns stackSize = maxStackElements + max(maxStackElements / 2, 128) , yielding 12,288 FT_Long cells = 49,152 bytes for the TrueType VM stack. The bytecode preserves exec->stack and copies a small bootstrap to its base. It pushes 7,164 filler cells, then 94 ROP cells copied from persistent storage, placing the native chain at exec->stack + 0x7000 . The final VM top is 7,262 cells, below the 12,288-cell allocation. The interior chain address is 16-byte aligned and leaves 28 KiB below native RSP for Windows API frames.
At the end of the IDEF body, SCFS changes the interpreter callback to FreeType RVA 0x162506 and the context slot at +0x28 to the in-module pop rsp; ret gadget at RVA 0x1A0AE . The callback transfers native execution through that gadget to the bootstrap at the unchanged VM-stack base; the bootstrap pivots to the chain at stack + 0x7000 . The final write changes the slot that is normally stackSize , and no later bytecode opcode needs to push onto the VM stack.
The interior placement gives the Windows APIs space to create native stack frames beneath the initial pivot address. The declared VM stack size, filler count, and final top are chosen together so that the ROP chain stays within the allocation.
4. Runtime addresses and API chain
The delivered font contains RVAs, not absolute process addresses . GC reads the live relocated FreeType interpreter pointer; bytecode arithmetic derives other FreeType gadgets and IAT cells from it, handling low-word carry or borrow. It also reads the live glyfStorage and original VM-stack pointers from the context to form heap-relative and stack-relative qwords. In particular, the ROP output slot is rebased from the storage layout to stack + 0x7080 .
