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

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined 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

Fuzzer details

Fuzzer: fuzz_encryption

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 2082 98.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 42 1.97%
All colors 2124 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
686 421 pypdf.generic._utils.create_string_object call site: 00421 pypdf._reader.PdfReader.read
676 1444 ...fuzz_encryption.TestInputOne call site: 01444 pypdf._writer.PdfWriter.generate_file_identifiers
255 3 ...fuzz_encryption.TestInputOne call site: 00003 pypdf._reader.PdfReader.__init__
204 1133 pypdf._writer.PdfWriter.__init__ call site: 01133 pypdf._writer.PdfWriter.clone_document_from_reader
145 270 pypdf.generic._base.IndirectObject.get_object call site: 00270 pypdf._utils.read_non_whitespace
56 1370 ...fuzz_encryption.TestInputOne call site: 01370 pypdf.generic._fit.Fit.__init__
12 1427 pypdf.generic._fit.Fit.__init__ call site: 01427 pypdf.generic._base.is_null_or_none
11 1121 pypdf._writer.PdfWriter.__init__._get_clone_from call site: 01121 .isinstance
7 259 pypdf._writer.PdfWriter.get_object call site: 00259 pypdf._reader.PdfReader.get_object
6 1341 pypdf._writer.PdfWriter.__init__ call site: 01341 pypdf.generic._base.TextStringObject.get_original_bytes
6 1348 pypdf.generic._base.encode_pdfdocencoding call site: 01348 pypdf.generic._base.TextStringObject.get_original_bytes
5 1111 pypdf._writer.PdfWriter._add_object call site: 01111 pypdf._writer.PdfWriter._add_object

Runtime coverage analysis

Covered functions
172
Functions that are reachable but not covered
394
Reachable functions
440
Percentage of reachable functions covered
10.45%
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
/ 1
...fuzz_encryption 11
pypdf._writer 145
pypdf._reader 86
pypdf._utils 21
pypdf.generic._data_structures 94
pypdf.generic._base 55
pypdf._encryption 90
pypdf._crypt_providers._cryptography 17
pypdf._crypt_providers._fallback 7
pypdf._crypt_providers._pycryptodome 7
pypdf.generic._utils 35
pypdf._doc_common 10
pypdf._page 9
pypdf.generic._fit 2
pypdf.generic 1
pypdf.filters 59

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
pypdf._page.PageObject.extract_text pypdf._page 9 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 63 0 2 13 8 313 0 1098 290
pypdf._writer.PdfWriter.append pypdf._writer 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 64 0 3 4 5 318 0 1113 246
pypdf._page.VirtualListImages.__getitem__ pypdf._page 2 ['N/A', 'N/A'] 62 0 0 5 5 306 0 1064 208
pypdf._text_extraction._layout_mode._fixed_width_page.text_show_operations pypdf._text_extraction._layout_mode._fixed_width_page 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 10 6 5 49 0 163 109
pypdf._doc_common.PdfDocCommon.get_form_text_fields pypdf._doc_common 2 ['N/A', 'N/A'] 6 0 1 3 4 37 0 125 80
pypdf._page.PageObject._merge_page pypdf._page 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 60 0 12 9 7 279 5 964 80
pypdf._writer.PdfWriter.update_page_form_field_values pypdf._writer 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 61 0 7 19 11 235 1 831 74
pypdf.generic._data_structures.ContentStream._parse_content_stream pypdf.generic._data_structures 2 ['N/A', 'N/A'] 57 0 5 4 5 189 1 671 64
pypdf._writer.PdfWriter.remove_text pypdf._writer 2 ['N/A', 'N/A'] 61 0 3 4 5 268 0 932 54
pypdf.generic._data_structures.DictionaryObject._clone pypdf.generic._data_structures 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 1 0 4 11 7 18 0 61 37

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

Functions statically reachable by fuzzers
42.0%
324 / 772
Cyclomatic complexity statically reachable by fuzzers
48.0%
1375 / 2875

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 Runtime reached by Fuzzers Combined 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

Runtime coverage analysis

This section shows analysis of runtime coverage data.

For futher technical details on how this section is generated, please see the Glossary .

Complex functions with low coverage

Func name Function total lines Lines covered at runtime percentage covered Reached by fuzzers
pypdf._writer.PdfWriter.__init__._get_clone_from 37 17 45.94% ['fuzz_encryption']
pypdf._writer.PdfWriter._update_field_annotation 65 1 1.538% ['fuzz_encryption']
pypdf._writer.PdfWriter.update_page_form_field_values 50 0 0.0% []
pypdf._writer.PdfWriter._write_increment 34 0 0.0% ['fuzz_encryption']
pypdf._writer.PdfWriter.compress_identical_objects.replace_in_obj 39 0 0.0% []
pypdf._writer.PdfWriter.remove_objects_from_page.clean_forms 40 0 0.0% []
pypdf._writer.PdfWriter.merge._process_named_dests 53 0 0.0% []
pypdf._writer.PdfWriter._insert_filtered_annotations 36 0 0.0% []
pypdf._reader.PdfReader.get_object 75 0 0.0% ['fuzz_encryption']
pypdf._reader.PdfReader.read 41 0 0.0% ['fuzz_encryption']
pypdf._reader.PdfReader._read_standard_xref_table 75 0 0.0% ['fuzz_encryption']
pypdf._reader.PdfReader._rebuild_xref_table 39 0 0.0% ['fuzz_encryption']
pypdf._doc_common.PdfDocCommon._get_named_destinations 46 0 0.0% []
pypdf._doc_common.PdfDocCommon.get_pages_showing_field._get_inherited 39 2 5.128% ['fuzz_encryption']
pypdf._doc_common.PdfDocCommon._build_outline_item 46 0 0.0% []
pypdf._doc_common.PdfDocCommon._flatten 36 0 0.0% ['fuzz_encryption']
pypdf.generic._data_structures.DictionaryObject._clone 50 0 0.0% []
pypdf.generic._data_structures.DictionaryObject.read_from_stream.read_unsized_from_stream 101 0 0.0% ['fuzz_encryption']
pypdf.generic._data_structures.TreeObject.insert_child 38 0 0.0% []
pypdf.generic._data_structures.ContentStream._read_inline_image 51 0 0.0% []
pypdf.generic._data_structures.read_object 40 2 5.0% ['fuzz_encryption']
pypdf.generic._data_structures.Destination.__init__ 32 0 0.0% ['fuzz_encryption']
pypdf._cmap._parse_encoding 40 0 0.0% []
pypdf._cmap.parse_bfrange 35 0 0.0% []
pypdf._cmap.build_font_width_map 59 1 1.694% ['fuzz_encryption']
pypdf.generic._utils.read_string_from_stream 43 0 0.0% ['fuzz_encryption']
pypdf.generic._utils.create_string_object 45 2 4.444% ['fuzz_encryption']
pypdf._page.PageObject._merge_resources.compute_unique_key 33 0 0.0% []
pypdf._page.PageObject._merge_page 51 0 0.0% []
pypdf._page.PageObject._merge_page_writer 70 0 0.0% []
pypdf._page.PageObject._extract_text 34 0 0.0% []
pypdf._page.PageObject._extract_text.process_operation 139 0 0.0% []
pypdf._page._VirtualList.__delitem__ 36 0 0.0% []
pypdf._encryption.Encryption.write_entry 36 0 0.0% ['fuzz_encryption']
pypdf._encryption.Encryption.read 40 0 0.0% ['fuzz_encryption']
Crypto.Util.Padding.pad.tell 36 4 11.11% ['fuzz_encryption']
pypdf.filters.FlateDecode.decode 36 0 0.0% ['fuzz_encryption']
pypdf.filters.FlateDecode._decode_png_prediction 46 0 0.0% ['fuzz_encryption']
pypdf.filters.decode_stream_data 38 0 0.0% ['fuzz_encryption']
pypdf.filters._xobj_to_image._apply_alpha 76 0 0.0% []
pypdf.generic._image_inline.extract_inline_AHx 31 0 0.0% []
pypdf.generic._image_inline.extract_inline_default 32 0 0.0% []
pypdf._codecs._codecs.LzwCodec.decode 34 0 0.0% []
Crypto.Cipher.ARC4.ARC4Cipher 36 10 27.77% ['fuzz_encryption']
Crypto.Cipher.AES.new 59 29 49.15% ['fuzz_encryption']
pypdf._text_extraction.crlf_space_check 37 0 0.0% []
pypdf._text_extraction._layout_mode._fixed_width_page.recurs_to_target_op 84 0 0.0% []
pypdf._text_extraction._layout_mode._font.Font.__post_init__ 34 0 0.0% []

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
[] []
secrets [] []
hashlib [] []
subprocess [] []
pypdf.annotations._markup_annotations [] []
pypdf._page ['fuzz_encryption'] []
[] []
pypdf.papersizes [] []
pypdf.annotations._base [] []
math [] []
pypdf [] []
pypdf.generic._data_structures ['fuzz_encryption'] []
datetime [] []
pypdf._codecs.symbol [] []
pypdf._text_extraction._layout_mode._fixed_width_page [] []
pypdf._merger [] []
pypdf._page_labels [] []
decimal [] []
pypdf._text_extraction._layout_mode._text_state_manager [] []
pypdf._crypt_providers._fallback ['fuzz_encryption'] []
base64 [] []
pypdf._xobj_image_helpers [] []
pypdf._crypt_providers._pycryptodome ['fuzz_encryption'] []
pypdf.annotations._non_markup_annotations [] []
pypdf.filters ['fuzz_encryption'] []
json [] []
pypdf.generic._utils ['fuzz_encryption'] []
pypdf._text_extraction._layout_mode._font [] []
struct [] []
pypdf._codecs [] []
zlib [] []
pypdf.generic._base ['fuzz_encryption'] []
pypdf._protocols [] []
pypdf._doc_common ['fuzz_encryption'] []
pypdf._utils ['fuzz_encryption'] []
Crypto [] []
pypdf._codecs.pdfdoc [] []
pypdf._text_extraction._layout_mode [] []
pypdf._writer ['fuzz_encryption'] []
itertools [] []
pypdf.errors [] []
cryptography [] []
pypdf._codecs.adobe_glyphs [] []
pypdf._crypt_providers._cryptography ['fuzz_encryption'] []
tempfile [] []
typing [] []
pypdf._cmap [] []
pypdf.generic._fit ['fuzz_encryption'] []
os [] []
pypdf._version [] []
pypdf.pagerange [] []
pypdf._codecs.std [] []
pypdf._crypt_providers._base [] []
binascii [] []
pypdf.generic._image_inline [] []
logging [] []
pathlib [] []
pypdf._reader ['fuzz_encryption'] []
pypdf._text_extraction [] []
re [] []
pypdf.generic._rectangle [] []
pypdf.generic._files [] []
pypdf._codecs.zapfding [] []
pypdf.generic._outline [] []
warnings [] []
collections [] []
io [] []
pypdf._text_extraction._layout_mode._text_state_params [] []
pypdf._codecs._codecs [] []
pypdf._crypt_providers [] []
atheris [] []
xml [] []
pypdf.annotations [] []
pypdf._encryption ['fuzz_encryption'] []
enum [] []
...fuzz_encryption ['fuzz_encryption'] []
pypdf.generic ['fuzz_encryption'] []
dataclasses [] []
pypdf.types [] []
shutil [] []
uuid [] []
pypdf.generic._viewerpref [] []
_codecs [] []
pypdf._text_extraction._layout_mode._font_widths [] []
pypdf.constants [] []
PIL [] []
pypdf.xmp [] []

Directories in report

Directory