/** * XML context patterns. * * Detects injection vectors that are specifically dangerous when a string * is inserted into an XML document (not HTML rendering context). * * Key distinction from HTML: these patterns target parser-level attacks — * things that can confuse or subvert an XML parser, trigger external entity * resolution, or inject DTD content. HTML rendering concerns (XSS) belong * in the HTML context. */ const XML_PATTERNS = [ { id: 'xml-cdata-injection', description: 'CDATA section injection: can terminate an enclosing CDATA section', pattern: /\]\]>/, }, { id: 'xml-processing-instruction', description: 'XML processing instruction: closes an enclosing XML comment', pattern: /-->/, }, { id: 'xml-pi-close', description: '?> closes an enclosing processing instruction', pattern: /\?>/, }, ]; export default XML_PATTERNS;