Files
harfbuzz/test/fuzzing/fonts
Behdad EsfahbodandClaude Opus 4.8 a5235968bb [subset] Collect lookup-variation feature indices once in dedup
_GSUBGPOS_find_duplicate_features() compared every pair of same-tag
retained features and, for each pair, called
FeatureVariations::has_lookup_variations() twice -- a linear walk of the
FeatureVariations 1.1 LookupVariationRecord array -- so a font cost
features^2 x records with no work limit (31 s for a 144 KB font).

The FeatureVariationRecord half of the same question is already answered
once up front via collect_feature_indices() into the variable_features
set, so do the same for the LookupVariationRecord half:
has_lookup_variations() becomes collect_lookup_variation_feature_indices(),
called once before the loop, and the per-pair test only consults the
set.  It is collected regardless of all_axes_pinned because the old code
consulted the records in both cases, so dedup decisions are unchanged
for fonts with sorted records; the only behavioural difference is that a
record sitting after one with a larger featureIndex (which the old early
break skipped) now also keeps its feature distinct, which is the
conservative direction.  has_lookup_variations() had no other callers.

The remaining F^2/2 same-tag pair loop is pre-existing and not part of
this finding.

A timing-only regression font is added under test/fuzzing/fonts/.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 15:35:53 -06:00
..
2020-01-31 16:37:30 -05:00
2022-06-01 07:39:20 -06:00