step-examples/12-11-adversarial/Ad104.stp
Sources
- bug-reporter language: "STEP-XML triggers XXE", "DTD entity reference reads /etc/passwd"
- CWE-611 (XML External Entity)
- ISO 10303-28 STEP-XML transfer
Sender
deduced — adversarial input or buggy producer that ships an internal DTD plus the parser is XML-1.0-compliant with external entities enabled
Description
ISO 10303-28 specifies an XML transfer of STEP data. A STEP-XML file may include an internal DTD; XML 1.0 permits an internal DTD to declare a named entity that resolves to an external resource (`<!ENTITY xxe SYSTEM "file:///etc/passwd">`). A receiver that uses an XML parser with external-entity resolution enabled fetches the resource, expands it into the document, and either leaks the content (if the entity is referenced inside an attribute that is later echoed back) or hangs (if the URI points at a slow resource). This is the textbook XXE attack applied to the STEP-XML wrapper.
Reproducer recipe
a `.stpx` (STEP-XML) file beginning with `<?xml version="1.0"?> <!DOCTYPE step [<!ENTITY xxe SYSTEM "file:///etc/passwd">]> <step ..>&xxe;</step>`. The entity reference `&xxe;` resolves to the file's contents on parsers with XXE enabled.
Expected kernel behavior
disable external-entity resolution by default in the XML parser used to load STEP-XML; reject documents that declare external-entity references with a precise diagnostic; treat as adversarial.
Notes
First entry exercising the STEP-XML wrapper as an attack surface. Synonyms: "XXE in STEP", "STEP-XML external entity", "billion-laughs sibling for XML", "DTD reads sensitive file", "external entity in STEP-XML". Provenance tier: cross-file-state. The defect is in the .stpx wrapper, not in the .stp body; bytes-level demonstration is in the XML-prologue layer. **OCC behavior**: silently accepts (no diagnostic, empty result); outside catalog's allowed set ({reject}). Kernel-bug witnessed: receivers must reject this fixture per the catalog's stated invariant.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
cross-file-state — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'<!DOCTYPE') and contains(b'<!ENTITY')contains(b'SYSTEM') or contains(b'file://')
Tier-3 assertions
load == "ok"
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* XXE attack payload (STEP-XML / ISO 10303-28 wrapper layer): 3 <?xml version="1.0" encoding="UTF-8"?> 4 <!DOCTYPE step [ 5 <!ENTITY xxe SYSTEM "file:///etc/passwd"> 6 ]> 7 <step:iso_10303_28 xmlns:step="urn:oid:1.0.10303.28.3.1"> 8 <step:header/> 9 <step:data>&xxe;</step:data> 10 </step:iso_10303_28> 11 Receiver must disable external-entity resolution (XXE / CWE-611). 12 SYSTEM URI: file:///etc/passwd 13*/ 14/* Ad104: STEP-XML wrapper carries internal DTD with external-entity reference; <!ENTITY xxe SYSTEM 'file:///etc/passwd'> triggers XXE on parsers with external-entity resolution enabled; receiver must disable external-entity resolution by default; must reject documents declaring external-entity references with a precise diagnostic; CWE-611; ISO 10303-28 STEP-XML transfer; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 15HEADER; 16FILE_DESCRIPTION(('Ad104'),'2;1'); 17FILE_NAME('Ad104.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 18FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 19ENDSEC; 20DATA; 21#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 22#2=GEOMETRIC_CURVE_SET('',(#1)); 23ENDSEC; 24END-ISO-10303-21;