Add fuzzing dictionaries and document them in FUZZING.md - #1191
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds HTTP, JSON, SQL, and TOML libFuzzer dictionaries. It documents the SQL fuzz target, dictionary usage, dictionary paths, and libFuzzer startup reporting. It also ignores fuzzing coverage output. ChangesFuzzing dictionaries
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@FUZZING.md`:
- Line 34: Update the fuzzing guide’s dictionary command to use the
crate-relative path fuzz/dict/[target].dict when run from the fuzz directory,
and limit the documented targets to pest_grammars’ http, json, sql, and toml
targets.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9dd1c7de-55af-4f05-9790-ba08724335d4
📒 Files selected for processing (6)
FUZZING.mdgrammars/fuzz/.gitignoregrammars/fuzz/dict/http.dictgrammars/fuzz/dict/json.dictgrammars/fuzz/dict/sql.dictgrammars/fuzz/dict/toml.dict
|
|
||
| ## Dictionaries | ||
|
|
||
| Dictionaries of syntax tokens for the `pest_grammars` fuzz targets live in `grammars/fuzz/dict`. Passing one dictionary to libFuzzer lets it splice whole keywords and punctuation into inputs instead of rediscovering them one byte at a time. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)FUZZING\.md$|fuzz|grammars' | sed -n '1,200p'
echo
echo "== FUZZING.md relevant lines =="
if [ -f FUZZING.md ]; then
nl -ba FUZZING.md | sed -n '1,90p'
fi
echo
echo "== target/dict references =="
rg -n "pest_grammars|fuzz/dict|grammars/fuzz/dict|fuzz run|dict=|toml|http|json|sql" FUZZING.md grammars fuzz 2>/dev/null | sed -n '1,240p'
echo
echo "== cargo fuzz files =="
if [ -d grammars ]; then
find grammars -maxdepth 3 -type f \( -path '*Cargo.toml*' -o -name 'fuzz'* \) | sort | sed -n '1,200p'
fi
if [ -d fuzz ]; then
find fuzz -maxdepth 3 -type f | sort | sed -n '1,200p'
fiRepository: pest-parser/pest
Length of output: 1670
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
for p in [Path("FUZZING.md"), Path("grammars/FUZZING.md")]:
if p.exists():
txt = p.read_text()
print(f"\n== {p} ==")
print(f"has grammars/fuzz/dict: {'grammars/fuzz/dict' in txt}")
print(f"has fuzz/dict: {'fuzz/dict' in txt}")
PYRepository: pest-parser/pest
Length of output: 221
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== FUZZING.md line numbers and content =="
awk '{printf "%5d\t%s\n", NR, $0}' FUZZING.md | sed -n '1,120p'
echo
echo "== directory indicators in FUZZING.md =="
awk '{printf "%5d\t%s\n", NR, $0}' FUZZING.md | rg -i "dir|directory|crate|grammars|cargo fuzz|dict" -C2 || true
echo
echo "== repository path setup =="
awk '{printf "%5d\t%s\n", NR, $0}' FUZZING.md | sed -n '1,20p'
echo
echo "== fuzz target list =="
find grammars/fuzz/fuzz_targets -maxdepth 1 -type f -name '*.rs' | sort | xargs -r -n1 basename
find grammars/fuzz/dict -maxdepth 1 -type f -name '*.dict' | sort | xargs -r -n1 basenameRepository: pest-parser/pest
Length of output: 6678
Use the crate-relative dictionary path for pest_grammars.
When users run the command from the crate’s fuzz directory as the guide describes, grammars/fuzz/dict/[target].dict points to fuzz/grammars/fuzz/dict/[target].dict. Use fuzz/dict/[target].dict instead, or state that the command must be run from the repository root.
The dictionary command only supports the pest_grammars targets: http, json, sql, and toml.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@FUZZING.md` at line 34, Update the fuzzing guide’s dictionary command to use
the crate-relative path fuzz/dict/[target].dict when run from the fuzz
directory, and limit the documented targets to pest_grammars’ http, json, sql,
and toml targets.
Source: MCP tools
Adding dictionaries for dictionary-guided fuzzing for the following fuzz targets:
Also, updating the FUZZING.md file with the latests contributions.
Summary by CodeRabbit
Documentation
Testing