Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Fuzzer details

Fuzzer: fuzzer-tiff_parser

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 10 3.87%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 3 1.16%
lawngreen 50+ 245 94.9%
All colors 258 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
0 0 None 0 5 piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:190
0 0 None 0 5 piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:209
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::restrictPageToSubArray()const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:239
0 0 None 0 0 piex::binary_parse::Get16u(piex::binary_parse::RangeCheckedBytePtrconst&,bool,piex::binary_parse::MemoryStatus*) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:321
0 0 None 0 0 piex::binary_parse::Get32u(piex::binary_parse::RangeCheckedBytePtrconst&,bool,piex::binary_parse::MemoryStatus*) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:381
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::remainingLength()const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:472
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::operator[](unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:489
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::operator+=(unsignedlong) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:571

Runtime coverage analysis

Covered functions
67
Functions that are reachable but not covered
34
Reachable functions
147
Percentage of reachable functions covered
76.87%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/piex/fuzzers/tiff_parser.cpp 2
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/datasource/datasource.hpp 6
/src/piex/fuzzers/./shared.h 2
/src/piex/fuzzers/../src/piex_types.h 5
/src/piex/fuzzers/../src/tiff_parser.cc 23
/src/piex/fuzzers/../src/tiff_parser.h 2
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.cc 13
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.h 3
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc 6
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h 8

Fuzzer: fuzzer-piex

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 44 12.8%
gold [1:9] 9 2.63%
yellow [10:29] 8 2.33%
greenyellow [30:49] 22 6.43%
lawngreen 50+ 259 75.7%
All colors 342 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
0 0 None 6 6 piex::binary_parse::RangeCheckedBytePtr::pointerToSubArray(unsignedlong,unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:118
0 0 None 4 4 piex::(anonymousnamespace)::GetOlympusPreviewImage(piex::StreamInterface*,piex::PreviewImageData*) call site: 00000 /src/piex/fuzzers/../src/piex.cc:244
0 0 None 0 696 piex::GetFullDimension32(piex::tiff_directory::TiffDirectoryconst&,unsignedint*,unsignedint*) call site: 00000 /src/piex/fuzzers/../src/tiff_parser.cc:554
0 0 None 0 5 piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:190
0 0 None 0 5 piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:209
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::extractBytes(unsignedlong,unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:156
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::restrictPageToSubArray()const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:239
0 0 None 0 0 piex::binary_parse::Get16u(piex::binary_parse::RangeCheckedBytePtrconst&,bool,piex::binary_parse::MemoryStatus*) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:321
0 0 None 0 0 piex::binary_parse::Get32u(piex::binary_parse::RangeCheckedBytePtrconst&,bool,piex::binary_parse::MemoryStatus*) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc:381
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::remainingLength()const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:472
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::operator[](unsignedlong)const call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:489
0 0 None 0 0 piex::binary_parse::RangeCheckedBytePtr::operator+=(unsignedlong) call site: 00000 /src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h:571

Runtime coverage analysis

Covered functions
149
Functions that are reachable but not covered
74
Reachable functions
224
Percentage of reachable functions covered
66.96%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/src/piex/fuzzers/piex.cpp 1
/src/piex/fuzzers/./shared.h 2
/src/piex/fuzzers/../src/piex_types.h 6
/src/piex/fuzzers/../src/piex.cc 22
/src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc 22
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc 6
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h 8
/src/piex/fuzzers/../src/tiff_parser.h 2
/src/piex/fuzzers/../src/tiff_parser.cc 23
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.cc 13
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.h 3

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
piex::image_type_recognition::(anonymousnamespace)::ArwTypeChecker::IsMyType(piex::binary_parse::RangeCheckedBytePtrconst&)const /src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc 2 ['class.std::bad_alloc *', 'class.piex::binary_parse::RangeCheckedBytePtr *'] 7 0 288 67 65 47 0 177 129
piex::tiff_directory::TiffDirectory::Get(unsignedint,piex::tiff_directory::SRational*)const /src/piex/fuzzers/../src/tiff_directory/tiff_directory.cc 3 ['class.piex::tiff_directory::TiffDirectory *', 'int', 'struct.piex::PreviewImageData::Rational *'] 6 0 52 10 2 37 0 126 69
piex::image_type_recognition::(anonymousnamespace)::DngTypeChecker::IsMyType(piex::binary_parse::RangeCheckedBytePtrconst&)const /src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc 2 ['class.std::bad_alloc *', 'class.piex::binary_parse::RangeCheckedBytePtr *'] 7 0 289 51 46 39 0 128 46
piex::image_type_recognition::(anonymousnamespace)::DcrTypeChecker::IsMyType(piex::binary_parse::RangeCheckedBytePtrconst&)const /src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc 2 ['class.std::bad_alloc *', 'class.piex::binary_parse::RangeCheckedBytePtr *'] 7 0 226 47 44 39 0 126 44
piex::GetDngInformation(piex::StreamInterface*,unsignedint*,unsignedint*,std::__1::vector >*) /src/piex/fuzzers/../src/piex.cc 4 ['class.std::exception *', 'int *', 'int *', 'class.std::__1::vector.42 *'] 7 0 67 11 11 92 0 312 40
piex::image_type_recognition::(anonymousnamespace)::KdcTypeChecker::IsMyType(piex::binary_parse::RangeCheckedBytePtrconst&)const /src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc 2 ['class.std::bad_alloc *', 'class.piex::binary_parse::RangeCheckedBytePtr *'] 7 0 196 38 36 39 0 118 36

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
48.0%
138 / 288
Cyclomatic complexity statically reachable by fuzzers
69.0%
1377 / 1991

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Fuzz engine guidance

This sections provides heuristics that can be used as input to a fuzz engine when running a given fuzz target. The current focus is on providing input that is usable by libFuzzer.

/src/piex/fuzzers/tiff_parser.cpp

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['piex::tiff_directory::TiffDirectory::Get(unsigned int, std::__1::vector >*) const', 'piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsigned long) const', 'LLVMFuzzerTestOneInput', 'piex::binary_parse::RangeCheckedBytePtr::remainingLength() const', 'piex::(anonymous namespace)::FillPreviewImageData(piex::tiff_directory::TiffDirectory const&, piex::StreamInterface*, piex::PreviewImageData*)']

/src/piex/fuzzers/piex.cpp

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['piex::(anonymous namespace)::GetMakernoteIfd(piex::tiff_directory::TiffDirectory const&, piex::tiff_directory::Endian, unsigned int, piex::StreamInterface*, unsigned int*, piex::tiff_directory::TiffDirectory*)', 'piex::GetPreviewImageData(piex::StreamInterface*, piex::PreviewImageData*)', 'piex::binary_parse::RangeCheckedBytePtr::loadPageForOffset(unsigned long) const', 'LLVMFuzzerTestOneInput', 'piex::image_type_recognition::(anonymous namespace)::TypeCheckerList::TypeCheckerList()', 'piex::image_type_recognition::(anonymous namespace)::TypeCheckerList::TypeCheckerList()', 'piex::image_type_recognition::(anonymous namespace)::TypeCheckerList::TypeCheckerList()', 'piex::image_type_recognition::(anonymous namespace)::TypeCheckerList::TypeCheckerList()', 'piex::image_type_recognition::(anonymous namespace)::TypeCheckerList::TypeCheckerList()']

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
/src/piex/fuzzers/../src/binary_parse/cached_paged_byte_array.h [] []
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.cc ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/memory.hpp [] []
/usr/local/bin/../include/c++/v1/exception [] []
/src/piex/fuzzers/../src/tiff_parser.h ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/../src/binary_parse/cached_paged_byte_array.cc [] []
/src/piex/fuzzers/../src/piex.cc ['fuzzer-piex'] []
/src/piex/fuzzers/../src/image_type_recognition/image_type_recognition_lite.cc ['fuzzer-piex'] []
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/piex/fuzzers/piex.cpp ['fuzzer-piex'] ['fuzzer-piex']
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.h ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/../src/tiff_directory/tiff_directory.h ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/../src/tiff_parser.cc ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/types.hpp [] []
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/exception.hpp [] []
/src/piex/fuzzers/../src/binary_parse/range_checked_byte_ptr.cc ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/tiff_parser.cpp ['fuzzer-tiff_parser'] ['fuzzer-tiff_parser']
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/datasource/datasource.hpp ['fuzzer-tiff_parser'] ['fuzzer-tiff_parser']
/src/piex/fuzzers/../src/piex_types.h ['fuzzer-tiff_parser', 'fuzzer-piex'] []
/src/piex/fuzzers/./shared.h ['fuzzer-tiff_parser', 'fuzzer-piex'] []

Directories in report

Directory
/src/piex/fuzzers/../src/binary_parse/
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/datasource/
/src/piex/fuzzers/../src/tiff_directory/
/src/piex/fuzzers/fuzzing-headers/include/fuzzing/
/src/piex/fuzzers/../src/image_type_recognition/
/src/piex/fuzzers/
/src/piex/fuzzers/../src/
/usr/local/bin/../include/c++/v1/
/src/piex/fuzzers/./