Skip to content

Format-aware crash input minimization #77

Description

@Ella-Hoeppner

Motivation

Standard crash minimizers (e.g., afl-tmin) operate at the byte level and routinely destroy the semantic structure of the crashing input. For structured-format parsers (XML, ELF, PNG, JSON), the minimized input often fails to parse at all — making crash triage significantly harder because the LLM can't reason about what semantic property caused the crash.

R17 from the lit review recommends format-aware minimization using the LLM to reduce the input while preserving the semantic property that triggers the crash. This dramatically improves triage quality.

Deliverables

  • corpus/minimizer.py:
    • format_aware_minimize(crash_input: bytes, format: str, crash_report: CrashReport, binary: Path) -> bytes
    • Algorithm:
      1. Run afl-tmin as a fast baseline (byte-level, often good enough for binary formats)
      2. If format is structured (xml/json/png/elf): run LLM-guided semantic minimization
      3. LLM prompt: "Here is an input that crashes the parser at <stack_frame>. Reduce it to the smallest semantically valid input that still triggers the crash. Here is the current input: <input>. Here is the crash output: <asan_output>."
      4. Verify each LLM-proposed reduction by running the binary
      5. Return the smallest verified crashing input
    • Budget: 5 LLM rounds + binary verification per round
  • corpus/minimizer.py also exports:
    • batch_minimize(crashes: list[CrashReport], ...) — async, minimize in parallel
  • Integration:
    • Called after deduplication (Cross-agent crash deduplication #50) for each unique crash
    • Minimized inputs stored in targets/<target>/crashes/minimized/
    • Minimized input (not raw input) is what gets passed to triage scorers and blueteam

Design notes

  • For binary formats, the byte-level minimizer often works fine — LLM pass only needed when afl-tmin produces an input that doesn't parse
  • LLM should operate on a hex dump + structural annotation (e.g., "bytes 0–3: PNG magic, bytes 4–7: chunk length...") not raw bytes
  • This is a quality-of-life improvement for crash triage — not blocking for initial Phase 2, but high value for usable results

Dependencies

Blocks

  • Nothing critical (quality improvement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraBuild, CI, project infrastructurephase-2Phase 2: Live Fuzzing + Swarm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions