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 1142 62.2%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 693 37.7%
All colors 1835 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
246 1280 pypdf._writer.PdfWriter.write_stream call site: 01280 pypdf._writer.PdfWriter.write
131 1102 pypdf._writer.PdfWriter.__init__ call site: 01102 pypdf._writer.PdfWriter.clone_document_from_reader
89 833 pypdf._reader.PdfReader._read_xref call site: 00833 pypdf._reader.PdfReader._read_pdf15_xref_stream
61 964 pypdf._encryption.Encryption.verify call site: 00964 pypdf._encryption.AlgV4.verify_owner_password
58 458 pypdf._reader.PdfReader.cache_indirect_object call site: 00458 pypdf._reader.PdfReader.read
56 591 pypdf.generic._data_structures.ArrayObject.read_from_stream call site: 00591 pypdf.generic._base.BooleanObject.read_from_stream
52 712 pypdf._reader.PdfReader._read_standard_xref_table call site: 00712 pypdf._reader.PdfReader._rebuild_xref_table
48 407 pypdf._crypt_providers._fallback.CryptRC4.encrypt call site: 00407 pypdf._reader.PdfReader.read
27 232 pypdf.generic._data_structures.DictionaryObject.read_from_stream call site: 00232 pypdf._reader.PdfReader.read
24 784 pypdf._reader.PdfReader._read_standard_xref_table call site: 00784 pypdf._reader.PdfReader.read
19 386 pypdf._encryption.Encryption._make_crypt_filter call site: 00386 pypdf._encryption.CryptFilter.decrypt_object
16 1622 pypdf._encryption.CryptFilter.encrypt_object call site: 01622 pypdf._crypt_providers._cryptography.CryptAES.encrypt

Runtime coverage analysis

Covered functions
265
Functions that are reachable but not covered
302
Reachable functions
397
Percentage of reachable functions covered
23.93%
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 9
pypdf._writer 116
pypdf._reader 86
pypdf._utils 19
pypdf.generic._data_structures 87
pypdf.generic._base 38
pypdf._encryption 87
pypdf._crypt_providers._cryptography 17
pypdf._crypt_providers._fallback 7
pypdf._crypt_providers._pycryptodome 7
pypdf.generic._utils 26
pypdf._doc_common 10
pypdf._page 9
pypdf.filters 63

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._writer.PdfWriter.update_page_form_field_values pypdf._writer 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 85 0 6 23 12 307 1 1080 293
pypdf._writer.PdfWriter.append pypdf._writer 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 86 0 3 4 5 294 0 1038 250
pypdf._page.VirtualListImages.__getitem__ pypdf._page 2 ['N/A', 'N/A'] 87 0 0 5 5 293 0 1029 237
pypdf.xmp.XmpInformation.dc_date pypdf.xmp 2 ['N/A', 'N/A'] 4 0 4 2 4 50 0 159 144
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 112
pypdf._page.PageObject._merge_page pypdf._page 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 85 0 12 9 7 271 5 943 90
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'] 87 0 2 13 8 292 0 1021 83
pypdf.generic._data_structures.ContentStream._parse_content_stream pypdf.generic._data_structures 2 ['N/A', 'N/A'] 82 0 5 4 5 183 1 654 77
pypdf._doc_common.PdfDocCommon.get_form_text_fields pypdf._doc_common 2 ['N/A', 'N/A'] 9 0 1 3 4 37 0 125 76
pypdf._writer.PdfWriter.remove_text pypdf._writer 2 ['N/A', 'N/A'] 85 0 3 4 5 259 0 908 54

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

Functions statically reachable by fuzzers
40.0%
338 / 851
Cyclomatic complexity statically reachable by fuzzers
45.0%
1421 / 3142

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._add_page 33 0 0.0% []
pypdf._writer.PdfWriter.update_page_form_field_values 63 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 41 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 22 29.33% ['fuzz_encryption']
pypdf._reader.PdfReader.read 41 19 46.34% ['fuzz_encryption']
pypdf._reader.PdfReader._rebuild_xref_table 39 0 0.0% ['fuzz_encryption']
Crypto.Cipher.ARC4.ARC4Cipher 36 10 27.77% ['fuzz_encryption']
Crypto.Util.Padding.pad.encode 36 8 22.22% ['fuzz_encryption']
pypdf.generic._appearance_stream.TextStreamAppearance._scale_text 36 0 0.0% []
pypdf.generic._appearance_stream.TextStreamAppearance._generate_appearance_stream_data 61 0 0.0% []
pypdf.generic._appearance_stream.TextStreamAppearance.from_text_annotation 53 0 0.0% []
pypdf.generic._data_structures.DictionaryObject._clone 50 0 0.0% []
pypdf.generic._data_structures.DictionaryObject.read_from_stream.read_unsized_from_stream 101 30 29.70% ['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.Destination.__init__ 32 0 0.0% []
pypdf.generic._image_inline.extract_inline_default 32 0 0.0% []
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._page.PageObject._merge_resources.compute_unique_key 33 0 0.0% []
pypdf._page.PageObject.replace_contents 33 0 0.0% []
pypdf._page.PageObject._merge_page 46 0 0.0% []
pypdf._page.PageObject._merge_page_writer 70 0 0.0% []
pypdf._page.PageObject._extract_text 74 0 0.0% []
pypdf._page._VirtualList.__delitem__ 36 0 0.0% []
pypdf._cmap._parse_encoding 40 0 0.0% []
pypdf._cmap.parse_bfrange 35 0 0.0% []
pypdf._cmap.build_font_width_map 63 0 0.0% []
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.generic._utils.read_string_from_stream 43 0 0.0% ['fuzz_encryption']

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

Directories in report

Directory