step-examples/12-11-adversarial/Ad026.stp
Sources
- 12-adversarial.md A026
- 04-occt-translation.md Q023 (composite curve self-cyclic)
Description
`#1=(A() B(#1))`; sub-entity references outer instance during construction. Two-phase build that derefs `#1` while still constructing → half-initialised vtable use (UAF in C++).
Reproducer recipe
any complex entity whose attributes include `#self`.
Expected kernel behavior
Heal and accept: build attribute graph in two passes; allocate placeholder shells first, bind references after. Must not crash or infinite loop.
Notes
H; hard-to-reach UAF. **See also**: Ad004.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb'(?s)#(\d+)=\([^;]*#\1[^;]*\);')matches(rb'#\d+=\(')
Tier-3 assertions
load == "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Ad026: self-referencing complex entity during construction; #N=(A() B(#N)) â sub-entity references outer instance; vtable use before init â UAF; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Ad026'),'2;1'); 5FILE_NAME('Ad026.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=(NAMED_UNIT(*) DERIVED_UNIT_ELEMENT(#3, 1.0)); 12#4=COMPOSITE_CURVE('',(#5),.F.); 13#5=COMPOSITE_CURVE_SEGMENT(.CONTINUOUS.,.T.,#4); 14#6=(GEOMETRIC_REPRESENTATION_ITEM() REPRESENTATION_ITEM('self') STYLED_ITEM('',(#6),#6)); 15ENDSEC; 16END-ISO-10303-21;