Add Atheris fuzzing coverage for convert_capec.py#2174
Add Atheris fuzzing coverage for convert_capec.py#2174prasunsrivastav123-lang wants to merge 3 commits intoOWASP:masterfrom
Conversation
cdbac20 to
1edc5a3
Compare
|
Hi @sydseter |
There was a problem hiding this comment.
Ï am getting the following error locally:
File "convert_capec_fuzzer.py", line 16, in
ModuleNotFoundError: No module named 'convert_capec'
[PYI-107:ERROR] Failed to execute script 'convert_capec_fuzzer' due to unhandled exception!
ERROR: 50.0% of fuzz targets seem to be broken. See the list above for a detailed information.
ERROR:main:Check build failed.
There was a problem hiding this comment.
Happens when I run:
python infra/helper.py check_build --external $env:PATH_TO_PROJECT --sanitizer address
There was a problem hiding this comment.
Whole trace:
INFO:__main__:Running: docker run --privileged --shm-size=2g --platform linux/amd64 --rm -i -e FUZZING_ENGINE=libfuzzer -e SANITIZER=address -e ARCHITECTURE=x86_64 -e FUZZING_LANGUAGE=python -e HELPER=True -v 'C:\Users\JSydseter\src\oss-fuzz\build\out\cornucopia-prasunsrivastav123-lang:/out' -t gcr.io/oss-fuzz-base/base-runner:latest test_all.py.
INFO: performing bad build checks for /tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer
INFO: performing bad build checks for /tmp/not-out/tmpmr6pu2_v/convert_fuzzer
Retrying failed fuzz targets sequentially 1
INFO: performing bad build checks for /tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer
Broken fuzz targets 1
('/tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer', CompletedProcess(args=['bad_build_check', '/tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer'], returncode=1, stdout=b'BAD BUILD: /tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer seems to have either startup crash or exit:\nvm.mmap_rnd_bits = 28\n/tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer -- -rss_limit_mb=2560 -timeout=25 -seed=1337 -runs=4 < /dev/null\nfuzzing now, this is what is here\nTraceback (most recent call last):\n File "convert_capec_fuzzer.py", line 16, in <module>\nModuleNotFoundError: No module named \'convert_capec\'\n[PYI-54:ERROR] Failed to execute script \'convert_capec_fuzzer\' due to unhandled exception!\n', stderr=b''))
BAD BUILD: /tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer seems to have either startup crash or exit:
vm.mmap_rnd_bits = 28
/tmp/not-out/tmpmr6pu2_v/convert_capec_fuzzer -- -rss_limit_mb=2560 -timeout=25 -seed=1337 -runs=4 < /dev/null
fuzzing now, this is what is here
Traceback (most recent call last):
File "convert_capec_fuzzer.py", line 16, in <module>
ModuleNotFoundError: No module named 'convert_capec'
[PYI-107:ERROR] Failed to execute script 'convert_capec_fuzzer' due to unhandled exception!
ERROR: 50.0% of fuzz targets seem to be broken. See the list above for a detailed information.
ERROR:__main__:Check build failed.
1edc5a3 to
e62729a
Compare
|
@sydseter I’ve updated the fuzzer to prepend |
|
Still the same issue: INFO: performing bad build checks for /tmp/not-out/tmp_t3n6kdo/convert_capec_fuzzer |
|
@sydseter |
|
@sydseter Added an Atheris fuzzer for convert_capec. |
d2cefdc to
a4b4053
Compare
- Add Atheris-based fuzz target for convert_capec - Ensure stable startup under OSS-Fuzz - Defer imports to avoid fuzzer initialization crashes - Use safe argument handling for fuzz execution _
2ea329a to
96389d5
Compare
|
@sydseter |
|
@sydseter Thanks for confirming! |
|
It's not about baseline coverage. The reason this fails has to do with how the fuzzer is including and finding modules. So in order to fix this there need to be a way of including the modules and using the right path to the module in the test: |
|
You need to either develop the fuzzers locally or use your repository to build. Tweak around the cflite_pr.yml pipeline to make it work. Please tell me if you want to throw in the towel. It's no shame in admitting defeat. It took me months to understand how to run the test we have. |
|
@sydseter Thanks for the context — I’d like to keep working on this and learn the setup rather than give up. |
|
Hi @sydseter |
fixes #2166
Changes