Nightly fuzzing on cnx01: text, uploads, the signed copy
.gitea/workflows/fuzz.yml runs cargo-fuzz (libFuzzer, nightly Rust) at 03:00 Chiang Mai time on runner02 on cnx01 (runs-on: cnx01; the label comes with cnx-network-clan PR #170), 10 minutes a target, under nice -n 19 (.gitea/scripts/fuzz.sh). Targets, bodies in src/fuzzing.rs: - text: passport zones and OCR output (whatever from_ocr returns must parse), positions, names, dates, Thai numbers, agreement texts and the contract diff. - upload: a file as files::sniff types it, through the pack's image and PDF code to a finished A4 page (pack::pdf::sides), EXIF orientation. - signed_copy: the drawn signature's PNG, or any text as the agreement, in the signed copy's PDF. fuzz/seeds/ holds small real files to start from (JPEG with JFIF and EXIF, PNG with pHYs, palette PNG, WebP lossy and lossless, A4 and landscape PDF, a drawn signature, zone, OCR, map links, Thai names). The grown corpus stays in the runner's cache; a crash fails the job and leaves its input as the artifact fuzz-findings, which goes into tests/fuzz_cases/<target>/ with the fix. tests/fuzz_cases.rs replays those and the seeds on every push, on stable. No sanitizer (safe Rust, about three times the inputs), debug assertions on, 10 s and 2 GB per input count as findings. DRAWING_LIMIT moved to agreements so the target uses the client page's limit. A local run of 60 s each in a Linux container: 635,522 / 9,763 / 4,089 inputs, peak 62 MB, nothing found.
This commit is contained in:
1 parent
7b5ec35e7c
commit
9b4d73c94b
38 files changed
+376
-16
No files matched your search
@@ -53,6 +53,13 @@ Lanna Desk (lannadesk.com, the app `visa`) holds passport data of real people. R
|
||||
smallest input and lands in `proptest-regressions/`: commit that file with
|
||||
the fix, so every run tries the case first. `PROPTEST_CASES=50000 cargo
|
||||
test --lib props` looks harder than the default 256.
|
||||
- **Fuzzing** runs every night on cnx01 (`.gitea/workflows/fuzz.yml`,
|
||||
`fuzz/`, bodies in `src/fuzzing.rs`). A finding arrives as the failed job's
|
||||
artifact `fuzz-findings`: put the input into `tests/fuzz_cases/<target>/`,
|
||||
named after what it broke, and fix the code until `cargo test` passes. A
|
||||
new reader of outside input belongs in a target's body. On Linux:
|
||||
`bash .gitea/scripts/fuzz.sh setup`, then `FUZZ_SECONDS=60 bash
|
||||
.gitea/scripts/fuzz.sh run`.
|
||||
- **Writing** for people (pages, docs) follows the house style: plain American
|
||||
English in whole sentences, no em dashes, "Nov 17, 2026" in tables.
|
||||
|
||||
|
||||
Reference in new issue
Block a user