Ad043 — STEP read raises uncaught exception on null / invalid entity reference

§12.11 (sub-class: null-deref / DoS)

P2 — spec deviation (no data loss)

silent-loss adversarial

Sources

Description

Reader paths assume non-null entity references and throw an uncaught exception (access violation, out-of-range, or similar) when a STEP file references a non-existent entity, supplies a null `swept_curve`, has an empty edge loop, a `STYLED_ITEM` with a null `item` reference, a vertex with null name/id, etc. The exception escapes across the reader's API boundary and aborts the import.

Reproducer recipe

any of the above patterns; e.g. `STYLED_ITEM('',(..),#null);` where `#null` is unresolved.

Expected kernel behavior

Every reader path must be defensive against null and dangling references; warn-and-accept (skip the offending instance with diagnostic), return an empty/partial result, or reject and signal failure via a status flag. Never let an unhandled exception escape across the parser/importer ABI; must not crash.

Notes

Cross-oracle: pure-Python Part-21 validator rejects (reject(E_UNRESOLVED_REFS)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation.

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Ad043: null / dangling entity reference: STYLED_ITEM.item = #999 (never declared); STYLED_ITEM references swept_curve = #998 (never declared); reader throws uncaught exception across ABI on unresolved ref; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('Ad043'),'2;1');
5FILE_NAME('Ad043.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#1=CARTESIAN_POINT('',(0.0,0.0,0.0));
10#2=GEOMETRIC_CURVE_SET('',(#1));
11#3=STYLED_ITEM('',(#1),#999);
12#4=SURFACE_STYLE_USAGE(.BOTH.,#999);
13#5=EXTRUDED_AREA_SOLID('',#999,#1,10.0);
14#6=VERTEX_POINT('',#999);
15ENDSEC;
16END-ISO-10303-21;