open62541/tests/fuzz
2025-01-02 23:41:14 +01:00
..
fuzz_binary_message_corpus/generated ci: Correctly name fuzz corpus to avoid name clash 2019-10-10 10:28:03 +02:00
fuzz_json JSON: Add encoding/decoding fuzzing 2019-01-03 00:05:00 +01:00
check_build.sh Fuzz: Add check_build script to verify successful build 2019-05-06 14:55:48 +02:00
CMakeLists.txt feat(test): Add fuzz test for parsing UA_AttributeOperand 2024-10-27 22:00:08 +01:00
corpus_generator.c refactor(examples,tests): avoid spaces for mDNS records 2024-07-09 11:23:00 +02:00
custom_memory_manager.c fix(core): Remove double ";" at end of line (#3938) 2020-10-06 10:47:07 +02:00
custom_memory_manager.h Move header files to a more unix-like structure 2019-03-21 20:16:31 +01:00
fuzz_attributeoperand.cc refactor(core): Update RelativePath browsing for the new QualifiedName format 2025-01-02 23:41:14 +01:00
fuzz_base64_decode.cc refactor(core): Move architecture-specific definition out of the public headers 2023-07-28 21:42:56 +02:00
fuzz_base64_encode.cc refactor(core): Move architecture-specific definition out of the public headers 2023-07-28 21:42:56 +02:00
fuzz_binary_decode.cc feat(core): Extend the binary encoding to take encoding options 2024-12-07 23:03:22 +01:00
fuzz_binary_message_header.dict Fuzz: Correct path to dicts 2018-11-17 21:15:24 +01:00
fuzz_binary_message.cc refactor(server): Move all binary protocol definitions inside ua_server_binary.c 2023-04-29 22:25:30 +02:00
fuzz_binary_message.options Fuzz: Correct path to dicts 2018-11-17 21:15:24 +01:00
fuzz_json_decode_encode.cc fix(core): Ensure that decode->encode->decode yields the identical result 2025-01-02 23:41:14 +01:00
fuzz_json_decode.cc refactor(core): Fold the <type>_generated_handling.h into <type>_generated.h 2024-05-29 06:14:56 +02:00
fuzz_src_ua_util_endpoints.dict Fuzz: Correct path to dicts 2018-11-17 21:15:24 +01:00
fuzz_src_ua_util.cc ci(fuzz): Add author to license header 2019-11-07 19:28:33 +01:00
fuzz_src_ua_util.options Fuzz: Correct path to dicts 2018-11-17 21:15:24 +01:00
fuzz_tcp_message.cc refactor(examples,tests): avoid spaces for mDNS records 2024-07-09 11:23:00 +02:00
generate_corpus.sh fix(tests): Make tests less verbose 2020-11-25 16:04:48 +01:00
oss-fuzz-copy.sh ci: Add tcp_fuzz_message fuzzer 2019-10-14 15:59:05 +02:00
README.md Fuzz: Add check_build script to verify successful build 2019-05-06 14:55:48 +02:00
ua_debug_dump_pkgs_file.c refactor(server): Only use logging-pointer instead of inline structure 2023-11-10 08:38:53 +01:00

I Can haz fuzz

open62541 is continuously tested with the awesome oss-fuzz project from Google: https://github.com/google/oss-fuzz

Currently tested is processing of binary messages and encoding/decoding of binary encoded data.

Reproduce locally

Reproduce build failure

You can just execute the script under tests/fuzz/check_build.sh, which does the following:

# clone oss-fuzz repo
cd oss-fuzz
# Change $OPEN62541_DIR to your local checkout of open62541
python infra/helper.py build_fuzzers --sanitizer address open62541 $OPEN62541_DIR && python infra/helper.py check_build --sanitizer address open62541

Reproduce issues

Download the testcase file and store it e.g. in your Download folder.

# clone oss-fuzz repo
cd oss-fuzz
# Change $OPEN62541_DIR to your local checkout of open62541
# And change $DOWNLOADS to your download location
python infra/helper.py build_fuzzers --sanitizer address open62541 $OPEN62541_DIR && python infra/helper.py reproduce open62541 fuzz_binary_decode $DOWNLOADS/clusterfuzz-testcase-minimized-fuzz_binary_decode-5686300273803264

Status

Update the corpus

To update the current corpus used for fuzzing you need to follow these steps. It will execute all the unit tests, dump the received data packages to a directory and then update and merge the corpus.

  1. The script will create two directories: open62541/build_fuzz and open62541/build_corpus. Make sure that these directories are not existing or do not contain any important data.

  2. Run the generate script:

    open62541/tests/fuzz/generate_corpus.sh

    This script will build all the unit tests, dump the packages and then merge the current corpus with the new packages.

  3. If there is new coverage with the generated data there will be new files in the directory:

    open62541/fuzz/fuzz_binary_message_corpus/generated

    Commit the new files and then you can delete the build directories created in step 1.