-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add CLI11 to OSS-Fuzz (CLI parsing fuzzer) #14131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheodorNEngoy
wants to merge
14
commits into
google:master
Choose a base branch
from
TheodorNEngoy:add-cli11
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7ea34af
cli11: initial OSS-Fuzz integration (CLI parsing fuzzer)
TheodorNEngoy 95cb13a
cli11: add Apache-2.0 license headers to new files
TheodorNEngoy 562fd85
trigger CLA recheck
TheodorNEngoy 895c7aa
cli11: add maintainer to auto_ccs
TheodorNEngoy e7b3e81
cli11: enable i386 builds
TheodorNEngoy f7e089e
cli11: use upstream fuzz harness (cli11_app_fuzz) and package diction…
TheodorNEngoy 857bba3
cli11: honor $LIB_FUZZING_ENGINE in build.sh
TheodorNEngoy 042a0e0
cli11: set primary_contact to [email protected]
TheodorNEngoy 78998b4
cli11: enable AFL & Honggfuzz engines
TheodorNEngoy 233ed01
cli11: add non-crashing seeds; flatten seed zip for AFL++
TheodorNEngoy 8ceffc8
cli11: ship seeds as zip + plain dir (make AFL check_build happy)
TheodorNEngoy 9c78aa8
cli11: rebuild upstream harness; ship seeds as zip + dir for AFL/libF…
TheodorNEngoy 758303c
cli11: temporarily disable AFL (dry-run treats seeds as crashes); kee…
TheodorNEngoy ea72da3
cli11: app fuzzer should use only fuzz_dictionary1 (drop dictionary2 …
TheodorNEngoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2025 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM gcr.io/oss-fuzz-base/base-builder | ||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | ||
RUN git clone --depth=1 https://github.com/CLIUtils/CLI11.git $SRC/cli11 | ||
COPY build.sh $SRC/ | ||
WORKDIR $SRC |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash -eu | ||
# Copyright 2025 Google LLC | ||
# Licensed under the Apache License, Version 2.0 | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -o pipefail | ||
|
||
# --- Build the upstream CLI11 fuzz harness --- | ||
"$CXX" ${CXXFLAGS:-} -std=c++17 -I"$SRC/cli11/include" \ | ||
"$SRC/cli11/fuzz/cli11_app_fuzz.cpp" "$SRC/cli11/fuzz/fuzzApp.cpp" \ | ||
-o "$OUT/cli11_app_fuzzer" $LIB_FUZZING_ENGINE ${LDFLAGS:-} | ||
|
||
# --- Package dictionary (if present) --- | ||
if [[ -f "$SRC/cli11/fuzz/fuzz_dictionary1.txt" ]]; then | ||
cp "$SRC/cli11/fuzz/fuzz_dictionary1.txt" "$OUT/cli11_app_fuzzer.dict" || true | ||
fi | ||
|
||
# --- Tiny, non-crashing seed corpus (zip + plain dir) --- | ||
seeddir=/tmp/cli11_seeds | ||
rm -rf "$seeddir" "$OUT/cli11_app_fuzzer_seed_corpus" || true | ||
mkdir -p "$seeddir" "$OUT/cli11_app_fuzzer_seed_corpus" | ||
|
||
: > "$seeddir/empty" # zero-byte; must not crash | ||
printf -- '--help\n' > "$seeddir/help" | ||
|
||
# 1) Flat zip (no subdirectories) for libFuzzer/Honggfuzz | ||
zip -j -q "$OUT/cli11_app_fuzzer_seed_corpus.zip" "$seeddir/empty" "$seeddir/help" | ||
|
||
# 2) Plain directory for AFL++ (used by check_build) | ||
cp -f "$seeddir/empty" "$seeddir/help" "$OUT/cli11_app_fuzzer_seed_corpus/" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
homepage: https://github.com/CLIUtils/CLI11 | ||
main_repo: https://github.com/CLIUtils/CLI11 | ||
language: c++ | ||
fuzzing_engines: | ||
- honggfuzz | ||
- libfuzzer | ||
sanitizers: | ||
- address | ||
- undefined | ||
architectures: | ||
- i386 | ||
- x86_64 | ||
auto_ccs: | ||
- [email protected] | ||
primary_contact: [email protected] |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fuzz_dictionary2 file is meant for the file_fuzzer, it probably isn't that useful to concatenate them. For the app fuzzer just fuzz_dictionary1 should be used.