step-examples/12-1a-encoding/Le015.stp
Sources
- T009/stepcode Str.cc:162-169, expscan.l:240-244
- A008/CVE-2024-1847-style OOB-read pattern
Description
A string with an opening apostrophe but no matching close advances the scanner past the end of the intended attribute and may swallow the rest of the file or read sensitive memory until a lucky `'` byte is found.
Reproducer recipe
`#1=IFCPERSON($,$,'unterminated,$);\n#2=..` or `#1=PERSON('unclosed_string_then_eof`
Expected kernel behavior
bound the scan to remaining buffer size; emit `E_UNTERMINATED_STRING` with offset; do not silently re-synchronise on a later `'`.
Notes
Often pairs with subsequent OOB write when the caller allocates `(end - start)` bytes. **See also**: Ad001, Ls029. Synonyms: "unterminated string in STEP", "missing closing quote", "string runs to EOF", "parser hangs on unclosed string", "STEP string never closes".
Expected validation
occt=reject/reject gmsh=reject ifc=schema_n/a
Byte assertions
matches(rb"'unclosed_string_then_eof")not_contains(b'END-ISO-10303-21;')matches(rb"#20=PERSON\(")
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/* Le015: Unterminated string literal at EOF: PERSON entity opens an apostrophe and never closes it; no trailing parameters, no semicolon, no ENDSEC, no file-footer; a bounded scanner must emit E_UNTERMINATED_STRING; the open-quote IS the mechanism; file is intentionally truncated after the opening apostrophe of the unclosed string */ 3HEADER; 4FILE_DESCRIPTION(('Le015'),'2;1'); 5FILE_NAME('Le015.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=DIRECTION('',(0.0,0.0,1.0)); 11#3=DIRECTION('',(1.0,0.0,0.0)); 12#4=AXIS2_PLACEMENT_3D('',#1,#2,#3); 13#20=PERSON('p1','unclosed_string_then_eof