covfuzz 0.1.0 copy "covfuzz: ^0.1.0" to clipboard
covfuzz: ^0.1.0 copied to clipboard

Reader-robustness fuzzing for Dart parsers: blind and coverage-guided, with crash minimization and CLI tools.

example/example.dart

import 'dart:typed_data';
import 'package:covfuzz/covfuzz.dart';

// A parser with a deliberate bug: it trusts a length byte from the input.
void parse(Uint8List b) {
  if (b.isEmpty) throw const FormatException('empty');
  final n = b[0];
  Uint8List.sublistView(b, 0, n); // RangeError when n > b.length
}

void main() {
  final report = fuzz<Uint8List>(
    seeds: [
      Uint8List.fromList([2, 0, 0])
    ],
    entry: parse,
    mutate: mutateBytes,
    iterations: 5000,
  );
  // Prints the escape and its minimized reproducer; exit 1 = a contract leak.
  report.report();
}
0
likes
160
points
651
downloads

Documentation

API reference

Publisher

verified publishercrispstro.be

Weekly Downloads

Reader-robustness fuzzing for Dart parsers: blind and coverage-guided, with crash minimization and CLI tools.

Repository (GitHub)
View/report issues

Topics

#fuzzing #testing #security #parser

License

MIT (license)

Dependencies

vm_service

More

Packages that depend on covfuzz