mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 22:41:10 +01:00
cff2_cs_opset_t::process_blend() walks all (k+1)*n values of a blend (n default values plus k deltas each) but charged only the k*n deltas, total - n. With a VarData of regionIndexCount 0 (or no variation store) k is 0, so `n blend` charges nothing, pops nothing, and the same operands can be blended again and again for the price of two tokens. Charge `total` = (k+1)*n, exactly what the loop touches. spend_budget() is a no-op without a caller budget, so only budgeted callers (draw, extents, paint, shape, and the subsetter passes that now pass a budget) are affected, and a well-formed charstring pays one extra unit per blended value. Adds test_hb_draw_cff2_blend_budget: a charstring that pushes 100 numbers and blends them 100 times over a region-less VarData must consume at least 100 x 100 units and fail under a 5000-unit budget. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-0DAQUESS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>