Chapter 08
Triage and disclosure
From a file in crashes/ to a report a maintainer can act on: reproduce, reduce, deduplicate, assess, and disclose.
After a campaign, crashes/ and hangs/ may contain files. Each one is a lead. Turning a lead into a bug report takes a few steps, and doing them carefully is what makes the report useful to the people who maintain the parser.
1. Reproduce
Run the saved file through the normal harness, outside the fuzzer:
$ parsarium run png c stb runs/stb-afl/afl-out/default/crashes/id:000000,* --results runs/stb-triage
A reproducible crash gives target_nonzero with the error in stderr_tail; a hang gives timeout. Run it a few times. If the result changes between runs, note that: it may depend on memory layout, timing, or the limits of the fuzzing environment rather than the input alone.
2. Reduce
Fuzzer outputs are usually larger than they need to be. A smaller input makes the cause easier to see. For compiled targets, AFL++ includes afl-tmin, which removes bytes while the crash still happens. For any target, you can also reduce by hand with the format in mind: drop chunks, shorten fields, and re-run after each change. Keep the original file next to the reduced one.
3. Deduplicate
A campaign often saves many files for one bug. Group them by where they fail: the top frames of the stack trace for native crashes, the exception type and location for managed languages. Then group again by parser family. If eight PHP packages crash in the same GD function, that is one report to GD.
4. Check the latest release
Parsarium pins releases so results are reproducible. The bug you found may already be fixed upstream. Before reporting, try the input against the latest release and look through the project's issue tracker and changelog.
5. Assess
Describe what the bug allows, as precisely as you can:
- A memory-safety error in C or C++ (out-of-bounds read or write, use after free) is usually the most serious. AddressSanitizer output helps the maintainer see it.
- An unhandled exception in a managed language is often a denial of service: the parser stops a request or a worker.
- A hang or a huge allocation from a small input is a resource problem, also usually a denial of service.
- A disagreement between parsers matters when two of them sit on the same path, for example a checker and a consumer.
6. Disclose
Look for a SECURITY.md file or a security policy in the project's repository, and use the channel it names. Many GitHub projects accept private vulnerability reports directly. A good report includes the reduced input, the exact release, the command that reproduces it, the observed result, and what you think the impact is. Offer a fix if you can. Give the maintainers time; ninety days is a common default, and most maintainers are glad to hear from someone who did the work to make the problem clear.
For a serious issue, the maintainers or a CVE Numbering Authority such as GitHub can assign a CVE once it is fixed.
Key ideas
- Every file in
crashes/orhangs/is a lead until it is reproduced outside the fuzzer. - Reduce inputs before analysing them; a smaller file makes the cause visible.
- Deduplicate by failure location, then by parser family.
- Check the latest upstream release before reporting.
- Report privately through the project's security policy, with the reduced input, the exact release, and the command to reproduce.
Check yourself
Answer all five to see your score
AFL++ saved a file in crashes/. What is it?
- A confirmed bug
- A lead to reproduce and triage
- A false positive
It may be a real bug, a harness problem, or an environment effect. Reproduction outside the fuzzer is the first test.
What is the first step of triage?
- Reproduce the input with
parsarium.py runoutside the fuzzer - Write the report
- Request a CVE
Everything else depends on being able to trigger the behaviour reliably.
A Python parser raises an unhandled exception on a crafted file. What is the most likely impact?
- Remote code execution
- Memory corruption
- Denial of service: the request or worker stops
Managed languages protect memory, so an exception usually stops processing rather than corrupting state. That can still matter for a service.
Where should you send a security report for a parser?
- A public issue with the proof-of-concept file
- The channel named in the project's security policy, usually private
- A social media post tagging the maintainers
Private disclosure gives maintainers time to fix the problem before it is public.
Why test the input against the latest release before reporting?
- The bug may already be fixed upstream.
- Pinned releases are not allowed in reports.
- Newer releases always crash more.
Parsarium pins releases for reproducibility. A quick check upstream saves everyone time.
Exercises
Exercise 8.1Warm-up
Take any campaign from chapter 7 and run afl summary on it. If crashes/ or hangs/ is not empty, reproduce one file with parsarium.py run and fill in the log described above. If both are empty, run the control through run and read the receipt as if it were a lead.
Hint
Saved files are named like id:000000,sig:11,.... Quote the path in the shell.
Solution
A reproduced crash shows target_nonzero with the error in stderr_tail; a hang shows timeout. Record the target, input hash, status, the first lines of the error, the family, and today's date. That row is the start of your triage log.
Exercise 8.2Practice
Five crashes were saved in a campaign on several PHP PNG packages. Group them into distinct bugs.
A nette_utils Error: imagecreatefromstring() gd_png.c:212 png_read_info B league_glide Error: imagecreatefromstring() gd_png.c:212 png_read_info C nette_utils TypeError: Image::fromString() argument must be string D intervention Error: imagecreatefromstring() gd_png.c:212 png_read_info E league_glide Error: imagecreatefromstring() gd_png.c:340 png_read_image
(These traces are made up for the exercise.)
Hint
Group first by the deepest frame that belongs to the parser, then ask whether the remaining differences are in wrapper code.
Solution
Three groups. A, B, and D fail at the same place in GD (gd_png.c:212): one bug in the shared engine, one report to GD. E fails at a different line in GD: probably a second engine bug. C is a type error in the wrapper's own code, not in the parser: a separate, smaller report to that package. Five files, three reports.
Exercise 8.3Challenge
Write a disclosure report for lead A from the previous exercise, as if you had reproduced it. Use headings a maintainer can scan.
Hint
Think about what the maintainer needs to reproduce it in five minutes without asking you anything.
Solution
Title: Out-of-bounds read in PNG header parsing (gd_png.c:212)
Affected: libgd X.Y.Z (also current main as of YYYY-MM-DD)
Reached through: imagecreatefromstring() in PHP; wrappers nette/utils, league/glide, intervention/image
Reproduce:
php -r 'imagecreatefromstring(file_get_contents("crash.png"));'
(crash.png attached, 57 bytes, sha256 ...)
Observed: process aborts; ASan report attached
Expected: imagecreatefromstring() returns false
Cause (as far as I can tell): IHDR length is not checked before ...
Impact: denial of service; possible information disclosure
Fix suggestion: ...
Found with Parsarium (commit ..., target png/php/nette_utils).
I am happy to keep this private for 90 days or until a fix is released.