Files
harfbuzz/src/OT
Behdad EsfahbodandClaude Opus 4.8 0c8b00908b [GPOS] Charge propagate_attachment_offsets() base-to-mark walk to max_ops
propagate_attachment_offsets() turns a mark's stored attachment into an
offset by summing the advances of every glyph between the mark and its
base.  That distance can be up to 32767 glyphs (the range of
attach_chain), and position_finish_offsets() runs the pass once per
attached glyph, so the total work is the sum of all mark-to-base
distances and is not bounded by the font; it was never charged to
buffer->max_ops.  Attacker-chosen text over a cooperating font (or the
kerx path) could thus make hb_shape() spend several times the budgeted
CPU.

Thread the buffer into propagate_attachment_offsets() and charge the
base-to-mark distance to buffer->max_ops before the summation loops,
failing the shape when the budget runs out (the same budget the
unsafe_to_break walk over this range already uses).  Normal text, whose
marks sit next to their base, pays a negligible amount.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-4JGOSACZ.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-11 12:43:10 -06:00
..