AFL test harness for tree-sitter runtime and parsers
  • C 38.1%
  • Shell 35%
  • Makefile 22.3%
  • Dockerfile 2.9%
  • Ruby 0.7%
  • Other 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2017-03-28 14:09:46 -07:00
afl_in Go dictionary and fuzzing input 2017-03-23 11:22:28 -07:00
dictionaries Fix empty keyword in go dictionary 2017-03-28 14:09:46 -07:00
script Give the ramdisk a better name on macOS 2017-03-28 13:16:53 -07:00
vendor Add tree-sitter-go 2017-03-23 09:33:27 -07:00
.gitignore Build javascript and ruby parser, custom dictionaries 2017-03-23 08:11:25 -07:00
.gitmodules Add tree-sitter-go 2017-03-23 09:33:27 -07:00
afl.c Just print language version 2017-03-24 14:24:15 -07:00
afl.h Build javascript and ruby parser, custom dictionaries 2017-03-23 08:11:25 -07:00
afl_go.c Build tree-sitter-go afl test harness 2017-03-23 09:33:53 -07:00
afl_javascript.c Build javascript and ruby parser, custom dictionaries 2017-03-23 08:11:25 -07:00
afl_ruby.c Build javascript and ruby parser, custom dictionaries 2017-03-23 08:11:25 -07:00
Brewfile Initial project setup 2017-03-20 15:28:56 -07:00
Dockerfile Support building/running in docker (for future ci runs) 2017-03-22 14:08:13 -07:00
Makefile Give the ramdisk a better name on macOS 2017-03-28 13:16:53 -07:00
README.md Give the ramdisk a better name on macOS 2017-03-28 13:16:53 -07:00

afl-tree-sitter

afl fuzzing for tree-sitter.

Overview

This project focuses on fuzzing the tree-sitter runtime and associated parsers for each language tree-sitter supports. It does this through a small set of test harnesses, which are C programs—one for each language—that take an input file and (try to) parse it. The test harness, tree-sitter, and the language parsers are all compiled with afl-clang and hardening, after which fuzzing is performed with afl-fuzz.

Getting started

script/bootstrap
script/setup-ramdisk # Optional, but recommended b/c afl is hard on SSDs.
cd /Volumes/ramdisk/
./fuzz javascript

Bugs found so far

An incomplete list of interesting bugs found using afl-fuzz.

tree-sitter runtime

tree-sitter-ruby

Run parallel

You can fuzz in parallel to take full advantage of multi-core systems. See script/fuzz for specific options passed to afl-fuzz and for language setup.

# Fuzz in parallel with 1 primary and 3 secondary fuzzers.
./fuzz -p -n 3 javascript