Repository navigation
test(security): fuzz targets, a CI fuzz run and a replayed corpus - #331
Merged
Merged
Conversation
This was referenced Nov 3, 2026
homer6
force-pushed
the
security/300-hardening-page
branch
from
November 3, 2026 12:23
53a3b10 to
ffa3f6e
Compare
homer6
force-pushed
the
security/307-fuzz
branch
from
November 3, 2026 12:23
68b0046 to
6ee2c73
Compare
This was referenced Nov 3, 2026
Owner
Author
|
Merged into
|
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libFuzzer targets for the security pages' parsers, a CI fuzz run, and a corpus replayed as tests (#307). Stacked on #330.
fuzz/parsers.hpp:parse_port,payloadandnesting, the codeparsing-and-validation.mdandbounds.mdshow.targets.hpp: one target per parser that checks the page's properties (an accepted port is spelled exactly as its digits; a payload lies inside the packet; nesting is balanced and within the limit), and aborts if one breaks.fuzz_*.cpp: libFuzzer entry points.CMakeLists.txt: built withCPPDOCS_FUZZ=ON(root option; Clang only).-fsanitize=fuzzer,address,undefined, orfuzzer,addresson Apple, where Homebrew LLVM 22's objects with UBSan fail to link with the macOS 14 system linker ("invalid r_symbolnum").corpus/<target>/: seeds plus regressions.README.mdexplains it all.The fuzzer found a real bug in its first 30 seconds:
parse_port("05")returned 5, a second spelling of port 5. That's the ambiguityparsing-and-validation.mditself says to reject. Fixed here:"080","05"added) and inparsers.hpp;corpus/parse_port/leading-zerokeeps the input.After the fix, 60 s and 89 M runs found nothing.
Replay test:
tests/security/fuzz_corpus_test.cppreplays every saved input through the same targets on every platform and compiler, without libFuzzer. It gets the corpus path and include directory fromtests/CMakeLists.txt(security area only).CI:
fuzzjob inlinux.yml: Clang 22 from apt.llvm.org, runs when the tests do, 120 s per target via the newtools/ci/fuzz.sh, and uploads failing inputs.linux-toolchain.shinstallslibclang-rt-<ver>-devforCPPDOCS_FUZZtoo.check_workflows.py: OK.Tested
securityarea: gcc-15 66/66, clang-22 66/66, gcc-16 66/66.parse_portafter the fix, thentools/ci/fuzz.sh 5end to end.Docs:
fuzz/README.md;docs/testing.md"Fuzzing (#307)"; a CLAUDE.md "Fuzzing" paragraph (crash → fix → minimized input in the corpus); the workflows README; a README.md pointer tofuzz/.Related to #307, #286