Go-fuzz is a coverage-guided fuzzing solution for testing of Go packages. Fuzzing is mainly applicable to packages that parse complex inputs (both text and binary), and is especially useful for hardening of systems that parse inputs from potentially malicious users (e.g. anything accepted over a network).
Note: go-fuzz has recently added preliminary support for fuzzing Go Modules. See the section below for more details. If you encounter a problem with modules, please file an issue with details. A workaround might be to disable modules via export GO111MODULE=off
.
First, you need to write a test function of the form:
funcFuzz(data []byte) int
Data is a random input generated by go-fuzz, note that in most cases it is invalid. The function must return 1 if the fuzzer should increase priority of the given input during subsequent fuzzing (for example, the input is lexically correct and was parsed successfully); -1 if the input must not be added to corpus even if gives new coverage; and 0 otherwise; other values are reserved for future use.
The Fuzz
function must be in a package that go-fuzz
can import. This means the code you want to test can't be in package main
. Fuzzing internal
packages is supported, however.
In its basic form the Fuzz function just parses the input, and go-fuzz ensures that it does not panic, crash the program, allocate insane amount of memory nor hang. Fuzz function can also do application-level checks, which will make testing more efficient (discover more bugs). For example, Fuzz function can serialize all inputs that were successfully deserialized, thus ensuring that serialization can handle everything deserialization can produce. Or, Fuzz function can deserialize-serialize-deserialize-serialize and check that results of first and second serialization are equal. Or, Fuzz function can feed the input into two different implementations (e.g. dumb and optimized) and check that the output is equal. To communicate application-level bugs Fuzz function should panic (os.Exit(1) will work too, but panic message contains more info). Note that Fuzz function should not output to stdout/stderr, it will slow down fuzzing and nobody will see the output anyway. The exception is printing info about a bug just before panicking.
Here is an example of a simple Fuzz function for image/png package:
package png import ( "bytes""image/png" ) funcFuzz(data []byte) int { png.Decode(bytes.NewReader(data)) return0 }
A more useful Fuzz function would look like:
funcFuzz(data []byte) int { img, err:=png.Decode(bytes.NewReader(data)) iferr!=nil { ifimg!=nil { panic("img != nil on error") } return0 } varw bytes.Buffererr=png.Encode(&w, img) iferr!=nil { panic(err) } return1 }
The second step is collection of initial input corpus. Ideally, files in the corpus are as small as possible and as diverse as possible. You can use inputs used by unit tests and/or generate them. For example, for an image decoding package you can encode several small bitmaps (black, random noise, white with few non-white pixels) with different levels of compressions and use that as the initial corpus. Go-fuzz will deduplicate and minimize the inputs. So throwing in a thousand of inputs is fine, diversity is more important.
Put the initial corpus into the workdir/corpus directory (in our case examples/png/corpus
). Go-fuzz will add own inputs to the corpus directory. Consider committing the generated inputs to your source control system, this will allow you to restart go-fuzz without losing previous work.
The go-fuzz-corpus repository contains a bunch of examples of test functions and initial input corpuses for various packages.
The next step is to get go-fuzz:
$ go install github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
Then, download the corpus and build the test program with necessary instrumentation:
$ git clone https://github.com/dvyukov/go-fuzz-corpus.git $ cd go-fuzz-corpus $ cd png $ go-fuzz-build
This will produce png-fuzz.zip archive.
Now we are ready to go:
$ go-fuzz
Go-fuzz will generate and test various inputs in an infinite loop. Workdir is used to store persistent data like current corpus and crashers, it allows fuzzer to continue after restart. Discovered bad inputs are stored in workdir/crashers dir; where file without a suffix contains binary input, file with .quoted suffix contains quoted input that can be directly copied into a reproducer program or a test, file with .output suffix contains output of the test on this input. Every few seconds go-fuzz prints logs to stderr of the form:
2015/04/25 12:39:53 workers: 500, corpus: 186 (42s ago), crashers: 3, restarts: 1/8027, execs: 12009519 (121224/sec), cover: 2746, uptime: 1m39s
Where workers
means number of tests running in parallel (set with -procs flag). corpus
is current number of interesting inputs the fuzzer has discovered, time in brackets says when the last interesting input was discovered. crashers
is number of discovered bugs (check out workdir/crashers dir). restarts
is the rate with which the fuzzer restarts test processes. The rate should be close to 1/10000 (which is the planned restart rate); if it is considerably higher than 1/10000, consider fixing already discovered bugs which lead to frequent restarts. execs
is total number of test executions, and the number in brackets is the average speed of test executions. cover
is number of bits set in a hashed coverage bitmap, if this number grows fuzzer uncovers new lines of code; size of the bitmap is 64K; ideally cover
value should be less than ~5000, otherwise fuzzer can miss new interesting inputs due to hash collisions. And finally uptime
is uptime of the process. This same information is also served via http (see the -http
flag).
go-fuzz has preliminary support for fuzzing Go Modules. go-fuzz respects the standard GO111MODULE
environment variable, which can be set to on
, off
, or auto
.
go-fuzz-build will add a require
for github.com/dvyukov/go-fuzz
to your go.mod. If desired, you may remove this once the build is complete.
Vendoring with modules is not yet supported. A vendor
directory will be ignored, and go-fuzz will report an error if GOFLAGS=-mod=vendor
is set.
Note that while modules are used to prepare the build, the final instrumented build is still done in GOPATH mode. For most modules, this should not matter.
go-fuzz-build can also generate an archive file that can be used with libFuzzer instead of go-fuzz (requires linux).
Sample usage:
$ cd $GOPATH/src/github.com/dvyukov/go-fuzz-corpus/fmt $ go-fuzz-build -libfuzzer # produces fmt.a $ clang -fsanitize=fuzzer fmt.a -o fmt.libfuzzer $ ./fmt.libfuzzer
When run with -libfuzzer
, go-fuzz-build adds the additional build tag gofuzz_libfuzzer
when building code.
Just as unit-testing, fuzzing is better done continuously.
Currently there are 2 services that offer continuous fuzzing based on go-fuzz:
go-fuzz-build builds the program with gofuzz build tag, this allows to put the Fuzz function implementation directly into the tested package, but exclude it from normal builds with // +build gofuzz
directive.
If your inputs contain a checksum, it can make sense to append/update the checksum in the Fuzz
function. The chances that go-fuzz will generate the correct checksum are very low, so most work will be in vain otherwise.
Go-fuzz can utilize several machines. To do this, start the coordinator process separately:
$ go-fuzz -workdir=examples/png -coordinator=127.0.0.1:8745
It will manage persistent corpus and crashers and coordinate work of worker processes. Then run one or more worker processes as:
$ go-fuzz -bin=./png-fuzz.zip -worker=127.0.0.1:8745 -procs=10
- go-fuzz github.com/arolek/ase: A step-by-step tutorial
- DNS parser, meet Go fuzzer: A success story with suggestions on how to write the
Fuzz
function - Automated Testing with go-fuzz
- Going down the rabbit hole with go-fuzz
- Fuzzing markdown parser with go-fuzz
go-fuzz repository history was recently rewritten to exclude examples directory to reduce total repository size and download time (see #88, #114 and https://github.com/dvyukov/go-fuzz-corpus). Unfortunately, that means that go get -u
command will fail if you had a previous version installed. Please remove $GOPATH/github.com/dvyukov/go-fuzz before running go get
again.
Go-fuzz fuzzing logic is heavily based on american fuzzy lop, so refer to AFL readme if you are interested in technical details. AFL is written and maintained by Michal Zalewski. Some of the mutations employed by go-fuzz are inspired by work done by Mateusz Jurczyk, Gynvael Coldwind and Felix Gröbert.
- spec: non-integral constant can be converted to intfixed
- cmd/compile: out of fixed registersfixed
- cmd/compile: truncates constantsfixed
- cmd/compile: overflow in int -> stringfixed
- cmd/compile: bad HMULfixed
- cmd/compile: treecopy Namefixed
- cmd/compile: accepts invalid identifiersfixed
- cmd/compile: hangs compiling hex fp constantfixed
- cmd/compile: mishandles int->complex conversionfixed
- cmd/compile: allows to define blank methods on builtin typesfixed
- cmd/compile: mis-calculates a constantfixed
- cmd/compile: interface conversion panicfixed
- cmd/compile: nil pointer dereferencefixed
- cmd/compile: nil pointer dereference (2)fixed
- cmd/compile: internal compiler error: plain block b3 len(Succs)==2, want 1fixed
- cmd/compile: internal compiler error: b3.Succs has duplicate block b3fixed
- cmd/compile: internal compiler error: newname nilfixed
- cmd/compile: accepts invalid function typefixed
- cmd/compile: internal compiler error: getinarg: not a func intfixed
- cmd/compile: hangs converting int const to complex64fixed
- cmd/compile: nil deref in error messagefixed
- cmd/compile: use of untyped nil in switchfixed
- cmd/compile: implicitly converts complex constant to integerfixed
- cmd/compile: assignment to entry in nil mapfixed
- cmd/compile: does not diagnose constant division by zerofixed
- cmd/compile: does not detect a missing returnfixed
- cmd/compile: symbol ""._.args_stackmap listed multiple timesfixed
- cmd/compile: "0"[0] should not be a constantfixed
- cmd/compile: unexpected %!(NOVERB)fixed
- cmd/compile: wrong line number in error messagefixed
- cmd/compile: not-deterministic outputfixed
- cmd/compile: parsing problemfixed
- cmd/compile: compiles incorrect programfixed
- cmd/compile: does not compile correct program
- cmd/compile: compiles incorrect program (2)fixed
- cmd/compile: internal compiler error: want FUNC, but have intfixed
- cmd/compile: nil dereffixed
- cmd/asm: index out of rangefixed
- cmd/asm: index out of range (2)fixed
- cmd/asm: index out of range (3)fixed
- cmd/asm: index out of range (4)fixed
- cmd/asm: slice bounds out of rangefixed
- cmd/asm: hangfixed
- cmd/asm: hang (2)fixed
- cmd/asm: hang (3)fixed
- cmd/asm: nil dereffixed
- cmd/asm: nil deref (2)fixed
- cmd/asm: nil deref (3)fixed
- cmd/asm: nil deref (4)fixed
- cmd/asm: nil deref (5)fixed
- cmd/asm: cannot happen: slice colfixed
- cmd/asm: unactionable "invalid local variable type 0"
- internal/trace: index out of rangefixed
- internal/trace: index out of range (2)fixed
- internal/trace: nil dereffixed
- internal/trace: nil deref (2)fixed
- fmt: Printf loops on invalid verb specfixed
- fmt: incorrect overflow detectionfixed
- fmt: index out of rangefixed
- fmt: index out of range (2)fixed
- fmt: index out of range (3)fixed
- fmt: index out of range (4)fixed
- fmt: index out of range (5)fixed
- fmt: index out of range (6)fixed
- regexp: slice bounds out of rangefixed
- regexp: slice bounds out of range (2)fixed
- regexp: LiteralPrefix lies about completeness
- regexp: LiteralPrefix lies about completeness (2)
- regexp: POSIX regexp takes 4 seconds to execute
- regexp: confusing behavior on invalid utf-8 sequences
- regexp: considers "\Q\E*" as valid regexpfixed
- time: allows signs for year/tz in format string
- time: RFC3339 time.Parse can not parse string that come from time.Format
- time: Parse panic: runtime error: index out of rangefixed
- math/big: incorrect string->Float conversionfixed
- math/big: MakeFromLiteral with 0 mantissa and large exponent hangsfixed
- net/http: can't send star requestfixed
- net/http: allows empty header namesfixed
- net/http: allows invalid characters in header valuesfixed
- net/http: allows %-encoding after []fixed
- net/mail: ParseAddress/String corrupt addressfixed
- net/mail: parses invalid addressfixed
- net/mail: fails to escape addressfixed
- net/textproto: fails to trim header valuefixed
- archive/zip: cap out of rangefixed
- archive/zip: bad file sizefixed
- archive/zip: unexpected EOFfixed
- archive/zip: file with wrong checksum is successfully decompressedfixed
- archive/zip: unexpected EOF when reading archivefixed
- archive/tar: slice bounds out of rangefixed
- archive/tar: slice bounds out of range (2)fixed
- archive/tar: slice bounds out of range (3)fixed
- archive/tar: slice bounds out of range (4)fixed
- archive/tar: slice bounds out of range (5)fixed
- archive/tar: deadly hangfixed
- archive/tar: invalid memory address or nil pointer dereferencefixed
- archive/tar: invalid memory address or nil pointer dereference (2)fixed
- archive/tar: Reader.Next returns nil headerfixed
- archive/tar: Writer incorrectly encodes header datafixed
- archive/tar: incorrectly claims huge file size
- archive/tar: reader returns bogus headersfixed
- encoding/gob: panic: dropfixed
- encoding/gob: makeslice: len out of range [3 bugs] fixed
- encoding/gob: stack overflowfixed
- encoding/gob: excessive memory consumptionfixed
- encoding/gob: decoding hangsfixed
- encoding/gob: pointers to zero values are not initialized in Decode
- encoding/gob: crash on malicious input
- encoding/xml: allows invalid comments
- encoding/json: detect circular data structures when encoding
- encoding/asn1: index out of rangefixed
- encoding/asn1: incorrectly handles incorrect utf8 stringsfixed
- encoding/asn1: slice is lost during marshal/unmarshalfixed
- encoding/asn1: call of reflect.Value.Type on zero Valuefixed
- encoding/asn1: Unmarshal accepts negative datesfixed
- encoding/pem: can't decode encoded messagefixed
- crypto:x509: input not full blocksfixed
- crypto/x509: division by zerofixed
- image/jpeg: unreadByteStuffedByte call cannot be fulfilledfixed
- image/jpeg: index out of rangefixed
- image/jpeg: invalid memory address or nil pointer dereferencefixed
- image/jpeg: Decode hangsfixed
- image/jpeg: excessive memory usagefixed
- image/png: slice bounds out of rangefixed
- image/png: slice bounds out of range (2)fixed
- image/png: interface conversion: color.Color is color.NRGBA, not color.RGBAfixed
- image/png: nil dereffixed
- image/gif: image block is out of boundsfixed
- image/gif: Decode returns an image with empty palettefixed
- image/gif: LoopCount changes on round tripfixed
- image/gif: Disposal is corrupted after round trip
- image/gif: EOF instead of UnexpectedEOF
- compress/flate: hangfixed
- compress/lzw: compress/decompress corrupts datafixed
- text/template: leaks goroutines on errors
- text/template: Call using string as type intfixed
- text/template: Call using complex128 as type stringfixed
- text/template: stack overflow
- html/template: unidentified node type in allIdentsfixed
- html/template: unidentified node type in allIdents (2)fixed
- html/template: unidentified node type in allIdents (3)fixed
- html/template: unidentified node type in allIdents (4)fixed
- html/template: escaping {{else}} is unimplementedfixed
- html/template: runtime error: slice bounds out of rangefixed
- html/template: runtime error: slice bounds out of range (2)fixed
- html/template: invalid memory address or nil pointer dereferencefixed
- html/template: panic: Call using zero Value argumentfixed
- html/template: nil pointer dereferencefixed
- html/template: slice bounds out of rangefixed
- mime: ParseMediaType parses invalid media typesfixed
- mime: Parse/Format corrupt parametersfixed
- mime: Parse/Format corrupt parameters (2)fixed
- go/constant: hang evaluating "-6e-1886451601"fixed
- go/constant, math/big: panic while constructing constant "1i/1E-612198397"
- go/scanner: accepts floating point literals with no decimals after Efixed
- go/parser: eats \r in comments
- go/format: turns correct program into incorrect one
- go/format: non-idempotent formatfixed
- go/format: adds }fixed
- go/types: panics on invalid constantfixed
- go/types: compiling hangsfixed
- go/types: stupid shiftfixed
- go/types: line number out of range
- go/types: assertion failedfixed
- go/types: converts fp constant to stringfixed
- go/types: converts complex constant to stringfixed
- go/types: misses '-' in error messagefixed
- go/types: compiles invalid program with overflow
- go/types: allows duplicate switch casesfixed
- go/types: can shift complex numbersfixed
- go/types: parses comma terminated fieldsfixed
- go/types: int overflow in switch expressionfixed
- go/types: allows multiple-value in switch and casefixed
- go/types: invalid error message for valid conversion to complex64fixed
- debug/elf: index out of range
- debug/elf: makeslice: len out of rangefixed
- debug/elf: slice bounds out of range
- debug/pe: panic on interface conversion
- debug/pe: slice bounds out of range
- x/image/webp: index out of rangefixed
- x/image/webp: invalid memory address or nil pointer dereferencefixed
- x/image/webp: excessive memory consumption
- x/image/webp: excessive memory consumption (2)
- x/image/tiff: integer divide by zerofixed
- x/image/tiff: index out of rangefixed
- x/image/tiff: slice bounds out of rangefixed
- x/image/tiff: index out of rangefixed
- x/image/tiff: slice bounds out of rangefixed
- x/image/tiff: integer divide by zerofixed
- x/image/tiff: index out of rangefixed
- x/image/tiff: index out of range
- x/image/tiff: excessive memory consumption
- x/image/{tiff,bmp}: EOF instead of UnexpectedEOF
- x/image/bmp: hang on degenerate imagefixed
- x/image/bmp: makeslice: len out of rangefixed
- x/image/bmp: out of memoryfixed
- x/net/icmp: runtime error: slice bounds out of range
- x/net/html: void element has child nodes
- x/net/spdy: unexpected EOFfixed
- x/net/spdy: EOFfixed
- x/net/spdy: fatal error: runtime: out of memoryfixed
- x/net/spdy: stream id zero is disallowedfixed
- x/net/spdy: processing of 35 bytes takes 7 secondsfixed
- x/net/spdy: makemap: size out of rangefixed
- x/net/spdy: makeslice: len out of rangefixed
- x/crypto/ssh: Server panic on invalid inputfixed
- x/crypto/openpgp: ReadMessage(): Panic on invalid input in packet.nextSubpacketfixed
- x/crypto/openpgp: ReadMessage(): Panic on invalid input in packet.PublicKeyV3.setFingerPrintAndKeyIdfixed
- x/crypto/openpgp: ReadMessage(): Panic on invalid input in math/big.nat.divfixed
- gccgo: bogus index out of boundsfixed
- gccgo: does not see stupidness of shift countfixed
- gccgo: bogus integer constant overflowfixed
- gccgo: segmentation faultfixed
- gccgo: segmentation fault (2)fixed
- gccgo: segmentation fault (3)fixed
- gccgo: segmentation fault (4)fixed
- gccgo: internal compiler error in set_typefixed
- gccgo: internal compiler error in global_variable_set_initfixed
- gccgo: internal compiler error: in wide_int_to_treefixed
- gccgo: internal compiler error in wide_int_to_tree (2)fixed
- gccgo: internal compiler error in record_var_depends_onfixed
- gccgo: internal compiler error in Builtin_call_expressionfixed
- gccgo: internal compiler error in check_boundsfixed
- gccgo: internal compiler error in do_determine_typefixed
- gccgo: internal compiler error in do_determine_type (2)fixed
- gccgo: internal compiler error in backend_numeric_constant_expressionfixed
- gccgo: internal compiler error in type_sizefixed
- gccgo: internal compiler error in type_size (2)fixed
- gccgo: internal compiler error in type_size (3)fixed
- gccgo: internal compiler error in do_get_backendfixed
- gccgo: internal compiler error in do_get_backend (2)fixed
- gccgo: internal compiler error in do_get_backend (3)fixed
- gccgo: internal compiler error in do_get_backend (4)fixed
- gccgo: internal compiler error in create_tmp_varfixed
- gccgo: internal compiler error in methodsfixed
- gccgo: internal compiler error in do_flattenfixed
- gccgo: internal compiler error in do_flatten (2)fixed
- gccgo: internal compiler error in do_flatten (3)fixed
- gccgo: internal compiler error in declare_functionfixed
- gccgo: internal compiler error: in definefixed
- gccgo: internal compiler error: in do_export
- gccgo: internal compiler error in do_lowerfixed
- gccgo: internal compiler error in insertfixed
- gccgo: internal compiler error in uniform_vector_pfixed
- gccgo: accepts invalid UTF-8fixed
- gccgo: spurious expected newline errorfixed
- gccgo: can apply ^ to truefixed
- gccgo: hangsfixed
- gccgo: hangs (2)fixed
- gccgo: hangs (3)fixed
- gccgo: rejects valid imaginary literalfixed
- gccgo: rejects valid fp literalfixed
- gccgo: accepts program with invalid identifierfixed
- gccgo: accepts program with invalid identifier (2)fixed
- gccgo: compiles weird constructfixed
- gccgo: can do bitwise or on fp constantsfixed
- gccgo: treats nil as typefixed
- gccgo: does not understand greek capiltal letter yotfixed
- gccgo: does not understand CUNEIFORM SIGN DUG TIMES MIfixed
- gccgo: allows to refer to builtin function not in call expressionfixed
- gccgo: bogus incompatible types in binary expression errorfixed
- gccgo: allows multiple definitions of a functionfixed
- gccgo: can shift by complex numberfixed
- gccgo: knowns unknown escape sequencefixed
- gccgo: internal compiler error in start_functionfixed
- gccgo: internal compiler error: in start_function (2)fixed
- gccgo: heap-buffer-overflow in Lex::skip_cpp_commentfixed
- gccgo: does not convert untyped complex 0i to int in binary operation involving an int
- gccgo: does not detect missing returnfixed
- gccgo: invalid error message for valid conversion to complex64
- gccgo: can shift complex numbersfixed
- gccgo: does not error on unused varfixed
- gccgo: treats 0 as channelfixed
- gccgo: does not recognize unused importfixed
- gccgo: can shift by stringfixed
- github.com/golang/protobuf: call of reflect.Value.SetMapIndex on zero Valuefixed
- github.com/golang/protobuf: call of reflect.Value.Interface on zero Value in MarshalTextfixed
- github.com/golang/protobuf: Invalid map is successfully decoded
- github.com/golang/protobuf: MarshalText incorrectly handles unknown bytes
- github.com/golang/protobuf: MarshalText fails and prints to stderr
- github.com/golang/protobuf: Unmarshaling errors for packed fieldsfixed
- Equal prints to stderr and fails on what's handled by Marshal/Unmarshal
- code.google.com/p/freetype-go: 42 crashers [42 bugs]
- github.com/cryptix/wav: 2 panics in header decodingfixed
- github.com/spf13/hugo: 7 crashers7 fixed
- github.com/Sereal/Sereal: 8 crashersfixed
- github.com/bradfitz/http2: Server.handleConn hangsfixed
- github.com/bradfitz/http2: nil pointer dereference in hpack.HuffmanDecodefixed
- github.com/bradfitz/http2: serverConn.readFrames goroutine leak
- github.com/golang/snappy: index out of range panicfixed
- github.com/bkaradzic/go-lz4: slice bounds out of rangefixed
- github.com/kurin/blazer: string escape/unescape edge-cases, need to escape filename in DownloadFileByName()fixed
- github.com/gocql/gocql: slice bounds out of rangefixed
- github.com/gocql/gocql: slice bounds out of rangefixed
- github.com/mdlayher/aoe: binary marshal/unmarshal inconsistencyfixed
- github.com/mdlayher/arp: slice bounds out of rangefixed
- github.com/mdlayher/ethernet: slice bounds out of rangefixed
- github.com/mdlayher/ndp: multiple crashersfixed
- github.com/mdlayher/netlink: slice bounds out of rangefixed
- github.com/mdlayher/netlink: slice bounds out of rangefixed
- github.com/russross/blackfriday: index out of range panic in scanLinkReffixed
- github.com/russross/blackfriday: index out of range panic in isReferencefixed
- github.com/rwcarlsen/goexif: index out of range
- github.com/tdewolff/minify: 8 crashersfixed
- github.com/youtube/vitess/go/vt/sqlparser: index out of rangefixed
- github.com/youtube/vitess/go/vt/sqlparser: statement serialized incorrectlyfixed
- github.com/youtube/vitess/go/vt/sqlparser: statement serialized incorrectly (2)
- gopkg.in/mgo.v2/bson: slice bounds out of rangefixed
- gopkg.in/mgo.v2/bson: Document is corruptedfixed
- gopkg.in/mgo.v2/bson: Attempted to marshal empty Raw documentfixed
- cockroachdb/cockroach: crash on x % 0fixed
- cockroachdb/cockroach: panic when dealing with empty sql identfixed
- cockroachdb/cockroach: parse literals more like Postgresfixed
- cockroachdb/cockroach: SELECT ("*") parse odditiesfixed
- cockroachdb/cockroach: weird QualifiedName.Base panics on reproduce
- github.com/google/open-location-code: Extremely long codes can cause underflow errors
- github.com/akrennmair/gopcap: incorrectly formed IP, UDP, TCP, ICMP packets can cause out of range errorsfixed
- github.com/gogo/protobuf: gogofast generates Unmarshal code that can panicfixed
- github.com/DHowett/go-plist: Various panics found through go-fuzz
- github.com/streadway/amqp: go-fuzz fixes
- github.com/andybalholm/cascadia: panic when parsing selectors like
:contains(
fixed - github.com/Azure/go-pkcs12: panic on malformed certificates
- github.com/nats-io/gnatsd: panic on malformed input
- github.com/miekg/dns: 8 crashersfixed
- github.com/influxdb/influxdb: index out of rangefixed
- collectd.org/network: 2 crashersfixed
- collectd.org/network: index out of rangefixed
- github.com/arolek/ase: 2 crashersfixed
- github.com/lytics/confl: infinite loop on malformed inputfixed
- github.com/zeebo/bencode: reject strings with negative lengthfixed
- github.com/hydrogen18/stalecucumber: 4 crashers
- github.com/gonum/blas: cgo indexing errorfixed
- OpenBLAS: incorrect idamax with NaN value
- github.com/eaburns/flac: 3 crashers
- github.com/yvasiyarov/php_session_decoder: 4 crashers
- xi2.org/x/xz: index out of boundsfixed
- github.com/pierrec/lz4: 2 crashersfixed
- github.com/dustin/go-coap: slice bounds out of range (1)fixed
- github.com/dustin/go-coap: slice bounds out of range (2)fixed
- github.com/dgryski/go-quicklz: many array-out-of-bounds issuesfixed
- github.com/rasky/go-lzo: possible infinite loop with single byte inputfixed
- github.com/ulikunitz/xz: panic in lzma.writeRep
- github.com/Preetam/sflow: excessive memory consumptionfixed
- github.com/hashicorp/go-version: unhandled value out of rangefixed
- github.com/atlassian/gostatsd: Return an error instead of nil when parseline gets nil/empty input
- github.com/flynn/flynn/pkg/syslog/rfc5424: off-by-onefixed
- github.com/flynn/flynn/json5: decoder out of sync with scannerfixed
- github.com/flynn/flynn/json5: broken carriage return parsingfixed
- github.com/ipfs/go-ipfs: nil pointer deference in DHT RPC handlerfixed
- github.com/buger/goreplay: fix panic in http headers parser functionfixed
- github.com/digitalocean/captainslog: incomplete timestamp caused panicfixed
- github.com/jlaffaye/ftp: panic: runtime error: index out of rangefixed
- github.com/unidoc/unidoc: panic: interface conversion: pdf.PdfObject is nil, not *pdf.PdfObjectIntegerfixed
- github.com/unidoc/unidoc: panic: runtime error: invalid memory address or nil pointer dereferencefixed
- github.com/unidoc/unidoc: runtime: goroutine stack exceeds 1000000000-byte limitfixed
- github.com/spenczar/tdigest: check slice bounds when unmarshalingfixed
- github.com/spenczar/tdigest: check expected invariants while unmarshalingfixed
- github.com/vcabbage/amqp: index out of rangefixed
- github.com/gomarkdown/markdown: inifinite loopfixed
- github.com/gomarkdown/markdown: inifinite loopfixed
- github.com/gomarkdown/markdown: index out of rangefixed
- github.com/hajimehoshi/go-mp3: index out of range (1)fixed
- github.com/hajimehoshi/go-mp3: index out of range (2)fixed
- github.com/hajimehoshi/go-mp3: index out of range (3)fixed
- github.com/dhowden/tag: slice bounds out of range (1)fixed
- github.com/dhowden/tag: slice bounds out of range (2)fixed
- github.com/dhowden/tag: len out of range (3)fixed
- github.com/dhowden/tag: slice bounds out of range (4)fixed
- github.com/tealeg/xlsx: slice bounds out of range (1)fixed
- github.com/hashicorp/hcl: crasher (logic error)fixed
- github.com/hashicorp/hcl: crasher (off-by-one)fixed
- github.com/hashicorp/hcl: format produces unparsable output (1)fixed
- github.com/hashicorp/hcl: format produces unparsable output (2)fixed
- github.com/hashicorp/hcl: format produces unparsable output (3)fixed
- github.com/hashicorp/hcl: format produces unparsable output (4)fixed
- github.com/francoispqt/gojay: panic on malformed JSON integersfixed
- github.com/francoispqt/gojay: panic on malformed JSON floatsfixed
- github.com/eapache/go-xerial-snappy multiple panics with malformed inputsfixed
- github.com/trustelem/zxcvbn: multiple panics in password strength estimatorfixed
- https://github.com/google/syzkaller: 6 crashers ( 1, 2, 3, 4, 5, 6)
- github.com/chai2010/guetzli-go: index out of range
- github.com/pixiv/go-libjpeg: segmentation violation (1)fixed
- github.com/pixiv/go-libjpeg: segmentation violation (2)
- github.com/pixiv/go-libjpeg: panic on encoding after decodingfixed
- github.com/z7zmey/php-parser: index out of range and nil pointer dereference
- github.com/uber/makisu: index out of range (1)fixed
- github.com/uber/makisu: index out of range (2)
- github.com/google/go-attestation: out of memoryfixed
- github.com/buger/jsonparser index out of range
- github.com/buger/jsonparser infinite loop
- github.com/hjson/hjson-go: panic on nilfixed
- github.com/hjson/hjson-go: panic on invalid syntaxfixed
- github.com/google/gofuzz: off-by-one errorfixed
- github.com/bookingcom/nanotube: index out of rangefixed
- github.com/ProtonMail/crypto: panic on fingerpring subpacketfixed
- github.com/robfig/cron: panic on malformed schedule string
- github.com/cronokirby/saferith: infinite loop in ModSqrtfixed
- github.com/go-git/go-git: infinite loop in revision parser
If you find some bugs with go-fuzz and are comfortable with sharing them, I would like to add them to this list. Please either send a pull request for README.md (preferable) or file an issue. If the source code is closed, you can say just "found N bugs in project X". Thank you.