* [gpos] Skip non-increasing Coverage indices in PairPosFormat1::intersects fast path The slow-population fast path of PairPosFormat1_3::intersects() walked the glyph set and indexed pairSet by the Coverage index of each glyph. In a well-formed font those indices increase with glyph id, but a broken Coverage can repeat an index, so one PairSet could be scanned once per glyph, giving quadratic time. Track the last index used and skip any that does not increase (and any NOT_COVERED), following the existing "Broken table. Skip." convention, so each PairSet is scanned at most once. Well-formed fonts are unchanged. Adds a fuzzer regression font. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-6GSU471N. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * [subset] Skip PairPosFormat2 classes outside the class matrix when collecting variation indices collect_pair_variation_indices() added every class returned by the two ClassDefs to class1_set / class2_set without bounding them by class1Count / class2Count. A ClassDef can map glyphs to classes far outside the value matrix, so the collected sets could be enormous and the subsequent nested loop quadratic, although apply() and the serialization loops only ever touch classes inside the matrix. Bound the collected classes by class1Count / class2Count, the same bound the rest of the code already uses. Output is byte-identical; adds a fuzzer regression font. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-C60AYSA3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Security Fuzzers
To build the fuzzers with libFuzzer to perform actual fuzzing, build with:
CXX=clang++ CXXFLAGS="-fsanitize=address,fuzzer-no-link" meson fuzzbuild --default-library=static -Dfuzzer_ldflags="-fsanitize=address,fuzzer"
ninja -Cfuzzbuild
Then, run the fuzzer like this:
fuzzbuild/test/fuzzing/hb-{shape,raster,vector,subset,repacker,depend}-fuzzer [-max_len=2048] [CORPUS_DIR]
Where max_len specifies the maximal length of font files to handle. The smaller the faster.
Note: The depend fuzzer requires -Ddepend_api=true meson option.
For more details consult the following locations:
Depend Closure Parity Test
The hb-depend-closure-parity test is distinct from the security fuzzers.
While security fuzzers test robustness against malformed input, the closure
parity test validates correctness by emulating the glyph closure calculation
used for subsetting with one generated from the dependency graph to avoid
implementation divergence. It should only be run on valid fonts.