Add libFuzzer harness for PAC parsing#246
Open
Tushar98644 wants to merge 1 commit into
Open
Conversation
Adds a libFuzzer target under fuzz/ that drives pacparser_parse_pac_string() followed by pacparser_find_proxy(), exercising the library's C layer and the PAC helper functions (myIpAddress, dnsResolve, isInNet, shExpMatch, ...) on top of the embedded QuickJS engine. - fuzz/fuzz_pac.c: harness; input is NUL-split into <script>\0<url>\0<host> - fuzz/build.sh: ASan + libFuzzer build; honours $CC/$CFLAGS/$LIB_FUZZING_ENGINE so it drops straight into an OSS-Fuzz build.sh - fuzz/corpus: a few readable PAC seeds covering distinct helper paths - fuzz/README.md: build/run notes (incl. Homebrew LLVM on macOS) No library code is changed.
Tushar98644
force-pushed
the
add-libfuzzer-harness
branch
from
June 29, 2026 07:04
c4080cc to
46c1573
Compare
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.
Adds a libFuzzer target under
fuzz/that exercises the PAC parsing path. It drivespacparser_parse_pac_string()followed bypacparser_find_proxy(), so it covers pacparser's own C layer and the PAC helper functions (myIpAddress,dnsResolve,isInNet,shExpMatch, ...) on top of the embedded QuickJS engine.What's included
fuzz/fuzz_pac.c— the harness. Each input is split on NUL bytes into<pac script>\0<url>\0<host>, with fixed defaults for missing fields, so a bare PAC script is also a valid input.fuzz/build.sh— ASan + libFuzzer build. Honours$CC,$CFLAGS, and$LIB_FUZZING_ENGINE, so it drops straight into an OSS-Fuzzbuild.shwith no changes.fuzz/corpus/— a few readable PAC seeds covering distinct helper paths.fuzz/README.md— build/run notes (incl. using Homebrew LLVM on macOS, since Apple's stock clang doesn't ship libFuzzer).Notes
fuzz/directory.fuzz/.gitignore.Built and run locally with
CC=<llvm>/clang ./fuzz/build.sh(ASan + libFuzzer); the harness builds clean and runs against the seed corpus.