Fuzzing C Parsers in 1.7 GB RAM on ARM64 PRoot with wrfuzz
Source repository by Mr.Cupcake (mscupcakegkill): https://gitlab.com/mscupcakegkill/wrfuzz Running an in-process coverage-guided C/C++ fuzzer inside an Android ARM64 PRoot container with 1.7 GB of RAM rules out standard
Source repository by Mr.Cupcake (mscupcakegkill): https://gitlab.com/mscupcakegkill/wrfuzz
Running an in-process coverage-guided C/C++ fuzzer inside an Android ARM64 PRoot container with 1.7 GB of RAM rules out standard AddressSanitizer builds immediately because shadow memory reservation fails under constrained virtual address spaces. Over the past few updates to wrfuzz, I reworked the instrumentation, bug detection, and state tracking so it stays fast without external dependencies.
What changed in wrfuzz
-
8-bit hit-count buckets: Coverage tracking now records logarithmic loop-depth buckets (
1..8) in the existing byte map with zero extra memory overhead. -
Gated 128-slot I2S ring buffer + linker
--wraphooks: Interceptsmemcmp,strcmp, andstrncmpalongside-fsanitize-coverage=trace-cmponly while executing insidefuzz_target, avoiding comparison table pollution. -
Trap-mode UBSan + zero-syscall guard-page heap pool (
GUARD_HEAP=1): Combines-fsanitize=undefined -fsanitize-trap=undefinedwith a pre-mapped 64-slotPROT_NONEguard-page allocator (~256 KB footprint) and tail byte verification to catch 1-byte heap OOB writes and UAF in-process. -
Periodic
ITIMER_REALtimeout (TIMEOUT_MS): Avoids per-iteration timer syscalls, which otherwise bottleneck severely under PRootptracetranslation. -
8-guard recent-path crash deduplication & delta-debugging minimizer (
-m): Deduplicates crashes by hashing recent unique coverage guard transitions rather than raw faultingsi_addr, and shrinks crashing inputs down to minimal reproducers. -
Corpus persistence & AFL dictionary support (
-x): Content-addressed 64-bit FNV-1a seed storage plus.dicttoken injection and gracefulSIGINTsummary on unbounded runs (./fuzz 0).
Quick test against cJSON
Pointing wrfuzz at cJSON (1,421 guards) from an empty corpus on ARM64 PRoot with both trap-mode UBSan and GUARD_HEAP=1 active sustained ~24k-55k exec/s, synthesizing JSON object/array syntax, escape sequences (\uXXXX), /* ... */ comments for cJSON_Minify, and null/false literals directly via the string hooks. Micro-targets run at 500k-620k exec/s in-process.
Full C++ source, build flags, and Windows SEH / Linux POSIX runner code are available on GitLab:
https://gitlab.com/mscupcakegkill/wrfuzz (by Mr.Cupcake / mscupcakegkill).
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.