step-examples/12-11-adversarial/Ad031.stp
Sources
- 12-adversarial.md A031
- ZDI-24-268 / CVE-2024-1847 (eDrawings UAF on file reading)
Description
Parser opens header parsing context, frees on `ENDSEC;`, but a deferred diagnostic emitter still holds a pointer to a string copied from the header. Common trigger: a `FILE_DESCRIPTION` header missing its `implementation_level` second argument (only one positional argument supplied), so a deferred diagnostic referencing the freed string fires after `ENDSEC;`.
Reproducer recipe
header with malformed `FILE_DESCRIPTION` followed by valid `DATA;` triggering deferred diagnostic referencing freed memory.
Expected kernel behavior
Reject malformed FILE_DESCRIPTION with diagnostic; own all diagnostic-bound strings via the diagnostic arena, not the parser's transient allocator. Must not crash via use-after-free.
Notes
H. **See also**: Ad084. Validation observed: silent-empty rather than the cited crash. The structural attack pattern (e.g., billion-laughs / cyclic-reference / very-large-string) is demonstrated; production-scale exploitation requires inflating the size factor as described. Kernel-mishandling-by-silent-acceptance is itself a defect signal at fixture scale.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb"FILE_DESCRIPTION\(\([^;]*\)\s*\)\s*;")matches(rb'FILE_DESCRIPTION\(\([^)]+\)\s*\)\s*;')
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/* Ad031: malformed FILE_DESCRIPTION: missing implementation_level second argument; deferred diagnostic holds pointer into freed header allocator â UAF; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Ad031')); 5FILE_NAME('Ad031.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)); 11ENDSEC; 12END-ISO-10303-21;