Open
Conversation
OpenCASCADE (OCCT) is a C++ open source CAD kernel used by FreeCAD, KiCad, LibreCAD, and many web-based CAD services. This adds a libFuzzer harness for the IGES file format parser (src/DataExchange/TKDEIGES), which processes untrusted geometry files. Sanitizers: ASan + UBSan. Engines: libFuzzer, AFL, honggfuzz.
|
Sheri98 is integrating a new project: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenCASCADE (OCCT) IGES parser fuzzing
Summary
IGESControl_Reader::ReadFile()which dispatches into the core IGESparsing routines (analiges.c, liriges.c, structiges.c)
Hollerith string prefixes, and overflow triggers
covering minimal files, line entities, transformation matrices, multi-entity
files, long parameter fields, and Hollerith length mismatches
Motivation
OpenCASCADE is a widely used open-source CAD kernel. Its IGES parser processes
untrusted input in many CAD/CAM workflows. The 80-column fixed-format IGES
specification has complex parsing logic involving Hollerith strings, section
interleaving, and fixed-width numeric fields -- all of which are historically
prone to buffer overflows and out-of-bounds reads.
Build notes
OCCT is built as static libraries with most optional modules disabled. The IGES
parser lives in TKDEIGES, which depends on TKService (requiring X11 headers).
The harness writes fuzzer input to a tmpfs file and passes the path to
IGESControl_Reader::ReadFile().Test plan
python3 infra/helper.py build_image opencascadepython3 infra/helper.py build_fuzzers --sanitizer address opencascadepython3 infra/helper.py run_fuzzer opencascade occt_fuzz_iges -- -max_total_time=60python3 infra/helper.py build_fuzzers --sanitizer undefined opencascadepython3 infra/helper.py check_build opencascade