@vigolium/piolium 0.0.1

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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/access-auditor.md +300 -0
  4. package/agents/assumption-breaker.md +154 -0
  5. package/agents/attack-designer.md +116 -0
  6. package/agents/code-scanner.md +139 -0
  7. package/agents/concurrency-auditor.md +238 -0
  8. package/agents/confirm-writer.md +257 -0
  9. package/agents/context-reviewer.md +274 -0
  10. package/agents/cross-verifier.md +165 -0
  11. package/agents/cve-scout.md +381 -0
  12. package/agents/env-builder.md +282 -0
  13. package/agents/env-profiler.md +205 -0
  14. package/agents/evidence-collector.md +140 -0
  15. package/agents/finding-grader.md +142 -0
  16. package/agents/finding-writer.md +148 -0
  17. package/agents/flow-tracer.md +106 -0
  18. package/agents/goal-backtracer.md +146 -0
  19. package/agents/history-miner.md +467 -0
  20. package/agents/independent-verifier.md +118 -0
  21. package/agents/intent-mapper.md +183 -0
  22. package/agents/longshot-collector.md +128 -0
  23. package/agents/longshot-prober.md +126 -0
  24. package/agents/patch-auditor.md +73 -0
  25. package/agents/poc-author.md +124 -0
  26. package/agents/poc-runner.md +194 -0
  27. package/agents/probe-lead.md +269 -0
  28. package/agents/red-challenger.md +101 -0
  29. package/agents/report-composer.md +208 -0
  30. package/agents/review-adjudicator.md +216 -0
  31. package/agents/spec-auditor.md +155 -0
  32. package/agents/taint-tracer.md +265 -0
  33. package/agents/test-locator.md +209 -0
  34. package/agents/threat-modeler.md +132 -0
  35. package/agents/variant-scanner.md +108 -0
  36. package/agents/variant-spotter.md +110 -0
  37. package/bin/piolium.mjs +376 -0
  38. package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
  39. package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
  40. package/extensions/piolium/agent-runner.ts +322 -0
  41. package/extensions/piolium/agents.ts +266 -0
  42. package/extensions/piolium/audit-state.ts +522 -0
  43. package/extensions/piolium/bundled-resources.ts +97 -0
  44. package/extensions/piolium/candidate-scan.ts +966 -0
  45. package/extensions/piolium/command-target.ts +177 -0
  46. package/extensions/piolium/console-stream.ts +57 -0
  47. package/extensions/piolium/export-results.ts +380 -0
  48. package/extensions/piolium/findings.ts +448 -0
  49. package/extensions/piolium/heartbeat.ts +182 -0
  50. package/extensions/piolium/help.ts +234 -0
  51. package/extensions/piolium/index.ts +1865 -0
  52. package/extensions/piolium/longshot.ts +530 -0
  53. package/extensions/piolium/matcher-suggestions.ts +196 -0
  54. package/extensions/piolium/matcher-utils.ts +83 -0
  55. package/extensions/piolium/modes/balanced.ts +750 -0
  56. package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
  57. package/extensions/piolium/modes/confirm.ts +697 -0
  58. package/extensions/piolium/modes/deep.ts +917 -0
  59. package/extensions/piolium/modes/diff.ts +177 -0
  60. package/extensions/piolium/modes/lite.ts +540 -0
  61. package/extensions/piolium/modes/longshot.ts +595 -0
  62. package/extensions/piolium/modes/merge.ts +204 -0
  63. package/extensions/piolium/modes/phase-runner.ts +267 -0
  64. package/extensions/piolium/modes/reinvest.ts +546 -0
  65. package/extensions/piolium/modes/revisit.ts +279 -0
  66. package/extensions/piolium/modes.ts +48 -0
  67. package/extensions/piolium/phase-labels.ts +123 -0
  68. package/extensions/piolium/phase-status-strip.ts +92 -0
  69. package/extensions/piolium/prompt-prefix-editor.ts +39 -0
  70. package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
  71. package/extensions/piolium/recon.ts +409 -0
  72. package/extensions/piolium/result-stats.ts +105 -0
  73. package/extensions/piolium/retry.ts +120 -0
  74. package/extensions/piolium/scheduler.ts +212 -0
  75. package/extensions/piolium/secrets.ts +368 -0
  76. package/extensions/piolium/tools/web-tools.ts +148 -0
  77. package/package.json +77 -0
  78. package/skills/agentic-actions-auditor/SKILL.md +327 -0
  79. package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
  80. package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
  81. package/skills/agentic-actions-auditor/references/foundations.md +94 -0
  82. package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
  83. package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
  84. package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
  85. package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
  86. package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
  87. package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
  88. package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
  89. package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
  90. package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
  91. package/skills/audit/SKILL.md +562 -0
  92. package/skills/audit/assets/icon.svg +7 -0
  93. package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
  94. package/skills/audit/references/adversarial-review.md +148 -0
  95. package/skills/audit/references/architecture-aware-sast.md +306 -0
  96. package/skills/audit/references/audit-workflow.md +737 -0
  97. package/skills/audit/references/chamber-protocol.md +384 -0
  98. package/skills/audit/references/creative-attack-modes.md +221 -0
  99. package/skills/audit/references/deep-analysis.md +273 -0
  100. package/skills/audit/references/domain-attack-playbooks.md +1129 -0
  101. package/skills/audit/references/knowledge-base-template.md +513 -0
  102. package/skills/audit/references/real-env-validation.md +191 -0
  103. package/skills/audit/references/report-templates.md +417 -0
  104. package/skills/audit/references/triage-and-prereqs.md +134 -0
  105. package/skills/audit/scripts/consolidate_drafts.py +554 -0
  106. package/skills/audit/scripts/partition_findings.py +152 -0
  107. package/skills/audit/scripts/rg-hotspots.sh +121 -0
  108. package/skills/audit/scripts/stamp_file_state.py +349 -0
  109. package/skills/code-reviewer/SKILL.md +65 -0
  110. package/skills/codeql/SKILL.md +281 -0
  111. package/skills/codeql/references/build-fixes.md +90 -0
  112. package/skills/codeql/references/diagnostic-query-templates.md +339 -0
  113. package/skills/codeql/references/extension-yaml-format.md +209 -0
  114. package/skills/codeql/references/important-only-suite.md +153 -0
  115. package/skills/codeql/references/language-details.md +207 -0
  116. package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
  117. package/skills/codeql/references/performance-tuning.md +111 -0
  118. package/skills/codeql/references/quality-assessment.md +172 -0
  119. package/skills/codeql/references/ruleset-catalog.md +63 -0
  120. package/skills/codeql/references/run-all-suite.md +92 -0
  121. package/skills/codeql/references/sarif-processing.md +79 -0
  122. package/skills/codeql/references/threat-models.md +51 -0
  123. package/skills/codeql/workflows/build-database.md +280 -0
  124. package/skills/codeql/workflows/create-data-extensions.md +261 -0
  125. package/skills/codeql/workflows/run-analysis.md +301 -0
  126. package/skills/differential-review/SKILL.md +220 -0
  127. package/skills/differential-review/adversarial.md +203 -0
  128. package/skills/differential-review/methodology.md +234 -0
  129. package/skills/differential-review/patterns.md +300 -0
  130. package/skills/differential-review/reporting.md +369 -0
  131. package/skills/fp-check/SKILL.md +125 -0
  132. package/skills/fp-check/references/bug-class-verification.md +114 -0
  133. package/skills/fp-check/references/deep-verification.md +143 -0
  134. package/skills/fp-check/references/evidence-templates.md +91 -0
  135. package/skills/fp-check/references/false-positive-patterns.md +115 -0
  136. package/skills/fp-check/references/gate-reviews.md +27 -0
  137. package/skills/fp-check/references/standard-verification.md +78 -0
  138. package/skills/insecure-defaults/SKILL.md +117 -0
  139. package/skills/insecure-defaults/references/examples.md +409 -0
  140. package/skills/last30days/SKILL.md +444 -0
  141. package/skills/sarif-parsing/SKILL.md +483 -0
  142. package/skills/sarif-parsing/resources/jq-queries.md +162 -0
  143. package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  144. package/skills/security-threat-model/LICENSE.txt +201 -0
  145. package/skills/security-threat-model/SKILL.md +81 -0
  146. package/skills/security-threat-model/agents/openai.yaml +4 -0
  147. package/skills/security-threat-model/references/prompt-template.md +255 -0
  148. package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
  149. package/skills/semgrep/SKILL.md +212 -0
  150. package/skills/semgrep/references/rulesets.md +162 -0
  151. package/skills/semgrep/references/scan-modes.md +110 -0
  152. package/skills/semgrep/references/scanner-task-prompt.md +140 -0
  153. package/skills/semgrep/scripts/merge_sarif.py +203 -0
  154. package/skills/semgrep/workflows/scan-workflow.md +311 -0
  155. package/skills/semgrep-rule-creator/SKILL.md +168 -0
  156. package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
  157. package/skills/semgrep-rule-creator/references/workflow.md +240 -0
  158. package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  159. package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  160. package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  161. package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  162. package/skills/sharp-edges/SKILL.md +292 -0
  163. package/skills/sharp-edges/references/auth-patterns.md +252 -0
  164. package/skills/sharp-edges/references/case-studies.md +274 -0
  165. package/skills/sharp-edges/references/config-patterns.md +333 -0
  166. package/skills/sharp-edges/references/crypto-apis.md +190 -0
  167. package/skills/sharp-edges/references/lang-c.md +205 -0
  168. package/skills/sharp-edges/references/lang-csharp.md +285 -0
  169. package/skills/sharp-edges/references/lang-go.md +270 -0
  170. package/skills/sharp-edges/references/lang-java.md +263 -0
  171. package/skills/sharp-edges/references/lang-javascript.md +269 -0
  172. package/skills/sharp-edges/references/lang-kotlin.md +265 -0
  173. package/skills/sharp-edges/references/lang-php.md +245 -0
  174. package/skills/sharp-edges/references/lang-python.md +274 -0
  175. package/skills/sharp-edges/references/lang-ruby.md +273 -0
  176. package/skills/sharp-edges/references/lang-rust.md +272 -0
  177. package/skills/sharp-edges/references/lang-swift.md +287 -0
  178. package/skills/sharp-edges/references/language-specific.md +588 -0
  179. package/skills/spec-to-code-compliance/SKILL.md +357 -0
  180. package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  181. package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  182. package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  183. package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
  184. package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
  185. package/skills/variant-analysis/METHODOLOGY.md +327 -0
  186. package/skills/variant-analysis/SKILL.md +142 -0
  187. package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  188. package/skills/variant-analysis/resources/codeql/go.ql +69 -0
  189. package/skills/variant-analysis/resources/codeql/java.ql +71 -0
  190. package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  191. package/skills/variant-analysis/resources/codeql/python.ql +80 -0
  192. package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  193. package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  194. package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  195. package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  196. package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  197. package/skills/variant-analysis/resources/variant-report-template.md +75 -0
  198. package/skills/vuln-report/SKILL.md +137 -0
  199. package/skills/vuln-report/agents/openai.yaml +4 -0
  200. package/skills/vuln-report/references/report-template.md +135 -0
  201. package/skills/wooyun-legacy/SKILL.md +367 -0
  202. package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
  203. package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
  204. package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
  205. package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
  206. package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
  207. package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
  208. package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
  209. package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
  210. package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
  211. package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
  212. package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
  213. package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
  214. package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
  215. package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
  216. package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
  217. package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
  218. package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
  219. package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
  220. package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
  221. package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
  222. package/skills/wooyun-legacy/references/xss.md +746 -0
  223. package/skills/zeroize-audit/SKILL.md +371 -0
  224. package/skills/zeroize-audit/configs/c.yaml +21 -0
  225. package/skills/zeroize-audit/configs/default.yaml +128 -0
  226. package/skills/zeroize-audit/configs/rust.yaml +83 -0
  227. package/skills/zeroize-audit/prompts/report_template.md +238 -0
  228. package/skills/zeroize-audit/prompts/system.md +163 -0
  229. package/skills/zeroize-audit/prompts/task.md +97 -0
  230. package/skills/zeroize-audit/references/compile-commands.md +231 -0
  231. package/skills/zeroize-audit/references/detection-strategy.md +191 -0
  232. package/skills/zeroize-audit/references/ir-analysis.md +252 -0
  233. package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
  234. package/skills/zeroize-audit/references/poc-generation.md +470 -0
  235. package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
  236. package/skills/zeroize-audit/schemas/input.json +83 -0
  237. package/skills/zeroize-audit/schemas/output.json +140 -0
  238. package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
  239. package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
  240. package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
  241. package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
  242. package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
  243. package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
  244. package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
  245. package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
  246. package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
  247. package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
  248. package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
  249. package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
  250. package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
  251. package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
  252. package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
  253. package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
  254. package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
  255. package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
  256. package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
  257. package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
  258. package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
  259. package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
  260. package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
  261. package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
  262. package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
  263. package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
  264. package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
  265. package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
  266. package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
  267. package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
  268. package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
  269. package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
  270. package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
  271. package/themes/piolium-srcery.json +94 -0
@@ -0,0 +1,513 @@
1
+ # Knowledge Base Report Template
2
+
3
+ Unified template for `archon/attack-surface/knowledge-base-report.md`. This is the single knowledge repository
4
+ for the entire audit — populated incrementally across phases 1-7. Each section is labelled with
5
+ the phase that produces it. Sections left blank by earlier phases are filled in by later ones.
6
+
7
+ For re-audit: load the existing `archon/attack-surface/knowledge-base-report.md` as the starting point. Update
8
+ only the sections whose source inputs have changed since `last_audited_commit`. Sections that
9
+ do not need updating are preserved as-is and their phase status is marked `reused`.
10
+
11
+ ---
12
+
13
+ ```markdown
14
+ # Knowledge Base: <Project Name>
15
+
16
+ **Audit date:** YYYY-MM-DD
17
+ **Repository:** <owner/repo>
18
+ **Branch/commit:** <branch> @ <short-sha>
19
+ **Last audited commit:** <short-sha or "first audit">
20
+
21
+ ---
22
+
23
+ ## Project Classification
24
+
25
+ *Phase 3 — threat-modeler*
26
+
27
+ **Primary type:** <Web Application | Library | CLI Tool | Plugin/Extension | Protocol Implementation | Infrastructure/Agent>
28
+ **Secondary types:** <if applicable>
29
+ **Language(s):** <primary languages>
30
+ **Deployment model:** <cloud-hosted SaaS | on-premises | embedded | desktop | CI/CD pipeline>
31
+ **Typical users:** <developers | end users | administrators | other services>
32
+ **Internet-facing:** <yes | no | partial — describe>
33
+
34
+ ---
35
+
36
+ ## Architecture Summary
37
+
38
+ *Phase 3 — threat-modeler*
39
+
40
+ <2-4 sentences describing the system's main components, how they interact, and where security-critical operations happen.>
41
+
42
+ **Key components:**
43
+
44
+ | Component | Purpose | Security relevance |
45
+ |-----------|---------|-------------------|
46
+ | <name> | <what it does> | <why it matters for security> |
47
+
48
+ ---
49
+
50
+ ## Architecture Inventory
51
+
52
+ *Phase 3 — threat-modeler*
53
+
54
+ | Area | Inventory |
55
+ |------|-----------|
56
+ | Components | <services, processes, plugins, workers, control planes> |
57
+ | Transports | <HTTP, RPC, queues, files, IPC, CLI, custom protocols> |
58
+ | Execution environments | <internet-facing, internal, desktop, CI/CD, admin-only> |
59
+ | Security-critical wrappers | <custom middleware, adapters, SDKs, generated interfaces> |
60
+
61
+ ---
62
+
63
+ ## Trust Boundaries
64
+
65
+ *Phase 3 — threat-modeler*
66
+
67
+ | Boundary | From | To | Trust level |
68
+ |----------|------|----|-------------|
69
+ | <name> | <external attacker / user / service> | <component> | <untrusted / semi-trusted / trusted> |
70
+
71
+ ---
72
+
73
+ ## High-Risk DFD Slices
74
+
75
+ *Phase 3 — threat-modeler*
76
+
77
+ List only the attacker-controlled flows most likely to matter in Phases 4-9.
78
+
79
+ | Slice | Source | Key transformations | Sink | Trust boundaries crossed |
80
+ |------|--------|---------------------|------|--------------------------|
81
+ | <name> | <entry point> | <parse, normalize, forward> | <db, exec, authz, file, network> | <boundary list> |
82
+
83
+ ---
84
+
85
+ ## High-Risk CFD Slices
86
+
87
+ *Phase 3 — threat-modeler*
88
+
89
+ List only the security-critical decision flows most likely to matter in Phases 4-9.
90
+
91
+ | Slice | Entry condition | Security gate | Alternate path | Privileged action |
92
+ |------|-----------------|---------------|----------------|-------------------|
93
+ | <name> | <trigger> | <authz, policy, validation> | <fallback or bypass path> | <effect> |
94
+
95
+ ---
96
+
97
+ ## Threat Model
98
+
99
+ *Phase 3 — security-threat-model skill*
100
+
101
+ **Assets:**
102
+ - <asset 1> — <why it is valuable to an attacker>
103
+ - <asset 2> — ...
104
+
105
+ **Threat actors:**
106
+
107
+ | Actor | Access level | Motivation |
108
+ |-------|-------------|-----------|
109
+ | <e.g., anonymous internet user> | <unauthenticated network> | <data theft, disruption> |
110
+
111
+ **STRIDE analysis:**
112
+
113
+ | Component | Spoofing | Tampering | Repudiation | Info Disclosure | DoS | Elevation |
114
+ |-----------|---------|-----------|-------------|-----------------|-----|-----------|
115
+ | <component> | <risk> | <risk> | <risk> | <risk> | <risk> | <risk> |
116
+
117
+ **Top threat scenarios:**
118
+
119
+ | # | Scenario | Likelihood | Impact | Residual risk |
120
+ |---|----------|-----------|--------|--------------|
121
+ | 1 | As <attacker>, I can <action> via <entry point> to <impact> | High/Med/Low | High/Med/Low | High/Med/Low |
122
+
123
+ **Security assumptions:**
124
+ - <assumption 1>
125
+ - <assumption 2>
126
+
127
+ ---
128
+
129
+ ## Attack Surface
130
+
131
+ *Phase 3 — threat-modeler*
132
+
133
+ **Entry point count:** <N>
134
+ **Unauthenticated entry points:** <N>
135
+ **High-risk functionality:** <list key features>
136
+
137
+ **Full entry point inventory:**
138
+
139
+ | Entry point | Auth required | Input types | Attacker-controlled fields | Risk |
140
+ |-------------|--------------|-------------|---------------------------|------|
141
+ | <endpoint/interface> | <none / API key / session / OAuth> | <JSON / XML / multipart / binary> | <fields> | High/Med |
142
+
143
+ **External dependencies that extend the attack surface:**
144
+ - <dependency — how it extends the surface>
145
+
146
+ ---
147
+
148
+ ## Specs and RFCs Implemented
149
+
150
+ *Phase 3 — threat-modeler (used by Phase 9)*
151
+
152
+ | Spec / RFC | Version | Implementation location | Official URL |
153
+ |-----------|---------|------------------------|-------------|
154
+ | <e.g., OAuth 2.0 — RFC 6749> | <full / partial> | `src/auth/oauth.py` | https://www.rfc-editor.org/rfc/rfc6749 |
155
+
156
+ **None identified** — <if no specs found, state this explicitly>
157
+
158
+ ---
159
+
160
+ ## Key Dependencies
161
+
162
+ *Phase 3 — threat-modeler*
163
+
164
+ | Dependency | Version | Purpose | Notes |
165
+ |-----------|---------|---------|-------|
166
+ | <name> | <version> | <what it does> | <known CVEs, end-of-life, etc.> |
167
+
168
+ **Dependency intelligence notes:**
169
+ - <which dependencies are outdated or security-relevant>
170
+ - <which are reachable from the high-risk DFD/CFD slices>
171
+ - <which remain hypotheses until exploitability is established>
172
+
173
+ ---
174
+
175
+ ## Domain Attack Research
176
+
177
+ *Phase 3 — threat-modeler*
178
+
179
+ **Domains identified:** <e.g., SAML, OAuth 2.0, JWT, HTTP client/server — or "None identified">
180
+
181
+ *If no relevant technology domains were detected, state "None identified" and skip subsections.*
182
+
183
+ ### Mode A — Library-as-target
184
+
185
+ *Populated when project type is `library`, `plugin`, or `protocol`.*
186
+
187
+ | Skill invoked | Scope | Key findings |
188
+ |--------------|-------|-------------|
189
+ | `sharp-edges` | Library API surface | <footgun designs, dangerous defaults> |
190
+ | `wooyun-legacy` | <checklist used> | <relevant patterns> |
191
+ | `last30days` | `<library name> CVE security` | <recent advisories, bypass discussions> |
192
+
193
+ ### Mode B — Library-as-consumer
194
+
195
+ *Populated when security-sensitive dependencies are identified.*
196
+
197
+ | Dependency | Skill invoked | Key findings |
198
+ |-----------|--------------|-------------|
199
+ | <name> | `sharp-edges` / `insecure-defaults` / `last30days` | <misuse patterns, recent disclosures> |
200
+
201
+ ### Mode C — Domain-Specific Attack Research
202
+
203
+ *Populated when technology domains are identified. See `references/domain-attack-playbooks.md`.*
204
+
205
+ #### Domain: <name>
206
+
207
+ **Identified via:** <signal>
208
+
209
+ **Known attack classes:**
210
+
211
+ | Attack | Description | Detection strategy | Relevance |
212
+ |--------|-------------|-------------------|-----------|
213
+ | <name> | <brief> | <how to detect in code> | High/Med/Low |
214
+
215
+ **Custom SAST targets:**
216
+
217
+ | Attack pattern | Rule type | Source/sink or pattern | Priority |
218
+ |---------------|-----------|----------------------|----------|
219
+ | <name> | CodeQL / Semgrep | <what to model> | High/Med/Low |
220
+
221
+ **Manual review checklist:**
222
+ - [ ] <concrete check tied to this project's implementation>
223
+
224
+ **Research sources used:** <last30days, wooyun-legacy (checklist name), web search, MCP>
225
+
226
+ ---
227
+
228
+ ## Phase 4 Custom Modeling Targets
229
+
230
+ *Phase 3 — threat-modeler*
231
+
232
+ | Area | Built-in coverage status | Custom modeling needed | Why |
233
+ |------|-------------------------|------------------------|-----|
234
+ | <component or flow> | <good / partial / weak> | <none / CodeQL / Semgrep / both> | <wrapper, custom transport, policy flow, generated code> |
235
+
236
+ ---
237
+
238
+ ## Phase 4 CodeQL Extraction Targets
239
+
240
+ *Phase 3 — threat-modeler*
241
+
242
+ For each high-risk DFD slice, specify the expected CodeQL source type and sink kind so structural
243
+ extraction is scoped correctly. Leave blank if no DFD slices were identified.
244
+
245
+ | DFD Slice | Expected source type | Expected sink kind(s) | Threat model needed |
246
+ |----------|--------------------|-----------------------|--------------------|
247
+ | <slice name> | RemoteFlowSource / LocalUserInput / EnvironmentVariable | sql-execution, command-execution, file-access, etc. | remote / local / env / all |
248
+
249
+ ---
250
+
251
+ ## Advisory Intelligence
252
+
253
+ *Phase 1 — cve-scout*
254
+
255
+ **Advisory sources checked:** <list: GitHub Security Advisories, NVD, OSV, release notes, etc.>
256
+ **Total advisories found:** <N>
257
+ **Date range:** <earliest> to <latest>
258
+
259
+ ### Published Advisories
260
+
261
+ | ID | Severity | Description | Patch commit | Status |
262
+ |----|----------|-------------|-------------|--------|
263
+ | <CVE/GHSA> | <Critical/High/Med/Low> | <brief description> | <commit SHA or PR> | <patched / unpatched / unclear> |
264
+
265
+ ### Vulnerability Class Patterns
266
+
267
+ | Class | Count | Last seen | Notes |
268
+ |-------|-------|-----------|-------|
269
+ | <e.g., SSRF> | <N> | <year> | <brief note — recurring pattern, fixed root cause, etc.> |
270
+
271
+ ### Supply Chain Risk Summary
272
+
273
+ *From `supply-chain-risk-auditor` skill.*
274
+
275
+ | Dependency | Risk level | Reason | Reachable? |
276
+ |-----------|-----------|--------|-----------|
277
+ | <name> | <High/Med/Low> | <outdated / known CVE / unmaintained> | <yes / no / unknown> |
278
+
279
+ ### Architecture Intelligence
280
+
281
+ <Coarse architecture inventory gathered during advisory research — components, transports, execution
282
+ contexts, trust boundaries. Refined by Phase 3.>
283
+
284
+ ---
285
+
286
+ ## Bypass Analysis
287
+
288
+ *Phase 2 — patch-auditor (one instance per patch)*
289
+
290
+ **Patches analyzed:** <N>
291
+ **Bypasses found:** <N>
292
+ **Patches confirmed sound:** <N>
293
+
294
+ ### Per-Patch Analysis
295
+
296
+ #### <CVE/GHSA ID> — <brief title>
297
+
298
+ **Patch commit:** <SHA>
299
+ **Original vulnerability:** <brief description>
300
+ **Bypass hypothesis tested:** <what was tested>
301
+ **Result:** <sound / bypassable / relocated>
302
+ **Evidence:** <code path, alternate entry point, config gap, etc.>
303
+
304
+ <Repeat for each patch.>
305
+
306
+ ---
307
+
308
+ ## CodeQL Structural Analysis
309
+
310
+ *Phase 4 — code-scanner (structural extraction sub-step)*
311
+
312
+ ### Entry Point Coverage
313
+
314
+ **Total CodeQL-recognized sources:** <N>
315
+ **Threat models scanned:** <remote | remote+local | remote+local+env | all>
316
+
317
+ | Source type | Count | Example location | In Phase 3 KB? |
318
+ |------------|-------|-----------------|----------------|
319
+ | RemoteFlowSource | N | `src/api/handler.py:42` | yes / no |
320
+ | LocalUserInput | N | `src/cli/args.py:17` | yes / no |
321
+ | EnvironmentVariable | N | `src/config/loader.py:8` | yes / no |
322
+
323
+ **Entry points found by CodeQL but missing from Phase 3 KB:**
324
+ - <file:line — source type — note>
325
+
326
+ ### Sink Coverage
327
+
328
+ **Total CodeQL-recognized sinks:** <N>
329
+
330
+ | Sink kind | Count | Example location |
331
+ |----------|-------|-----------------|
332
+ | sql-execution | N | ... |
333
+ | command-execution | N | ... |
334
+ | file-access | N | ... |
335
+ | http-request | N | ... |
336
+ | code-execution | N | ... |
337
+ | deserialization | N | ... |
338
+
339
+ **Sinks not covered by any DFD slice:**
340
+ - <file:line — sink kind — note>
341
+
342
+ ### Call Graph Slice Reachability
343
+
344
+ | DFD Slice | Reachable? | Path count | Notes |
345
+ |----------|-----------|-----------|-------|
346
+ | <slice name> | yes / no | N | <path summary or no-path reason> |
347
+
348
+ **Slices with no reachable path — investigation status:**
349
+ - <slice name>: <isolated by design / incomplete model / dead code / other>
350
+
351
+ ### Informational Flow Node Summary
352
+
353
+ *Derived from `archon/codeql-artifacts/flow-paths-all-severities.md`.*
354
+
355
+ | Rule | Count | Affected file areas | Significance |
356
+ |------|-------|-------------------|-------------|
357
+ | <rule ID> | N | `src/auth/` | <sanitizer call / validation node / transformation> |
358
+
359
+ **Key sanitizer/validation nodes identified by CodeQL:**
360
+ - <file:line — what it does — manual review status>
361
+
362
+ ### Machine-Generated DFD Diagram
363
+
364
+ *Auto-generated from `entry-points.json`, `call-graph-slices.json`, and `sinks.json`. Refine
365
+ manually if paths are incomplete or misleading.*
366
+
367
+ ```mermaid
368
+ flowchart LR
369
+ SRC1["<entry point 1>\n<file:line>"]
370
+ INT1["<transformation/wrapper>\n<file:line>"]
371
+ SNK1["<sink kind>: <function>\n<file:line>"]
372
+ SRC1 --> INT1 --> SNK1
373
+ ```
374
+
375
+ ### Machine-Generated CFD Diagram
376
+
377
+ *Auto-generated from CodeQL control-flow data. Supplement with manual additions.*
378
+
379
+ ```mermaid
380
+ flowchart TD
381
+ EP["Entry: <entry point>"]
382
+ GATE["Security gate: <check>\n<file:line>"]
383
+ PASS["Allowed path"]
384
+ FAIL["Blocked path"]
385
+ EP --> GATE
386
+ GATE -- "passes" --> PASS
387
+ GATE -- "fails" --> FAIL
388
+ ```
389
+
390
+ ---
391
+
392
+ ## Static Analysis Summary
393
+
394
+ *Phase 4 — code-scanner*
395
+
396
+ **CodeQL version:** <version>
397
+ **Semgrep version:** <version>
398
+ **Semgrep engine:** Pro / standard (fallback)
399
+
400
+ ### Tools and Rulesets Run
401
+
402
+ | Tool | Suite / ruleset | Finding count | Notes |
403
+ |------|----------------|--------------|-------|
404
+ | CodeQL | <language>/<suite> | N | <e.g., built-in security-and-quality> |
405
+ | Semgrep | <ruleset> | N | <pro / standard> |
406
+ | SpotBugs + FindSecBugs | — | N | <Java only, omit otherwise> |
407
+
408
+ **Custom rules created:**
409
+
410
+ | Rule file | Tool | Motivated by | Finding count |
411
+ |----------|------|-------------|--------------|
412
+ | `archon/codeql-queries/<name>.ql` | CodeQL | <DFD/CFD slice> | N |
413
+ | `archon/semgrep-rules/<name>.yaml` | Semgrep | <DFD/CFD slice> | N |
414
+
415
+ **Fallback documentation:** <if Semgrep Pro unavailable, state reason here; otherwise "N/A">
416
+
417
+ ### Key Findings from SAST
418
+
419
+ *Medium and above only. Full results in finding drafts.*
420
+
421
+ | Finding | Tool | Severity | File:line | Disposition |
422
+ |---------|------|----------|-----------|-------------|
423
+ | <title> | CodeQL / Semgrep | Med/High/Crit | `src/...:N` | <advanced to Phase 10 / false positive — reason> |
424
+
425
+ ### Coverage Gaps
426
+
427
+ - <area not covered by built-in rules — why — whether custom rules were added>
428
+
429
+ ---
430
+
431
+ ## GitHub Actions Audit
432
+
433
+ *Phase 4 — agentic-actions-auditor (only if `.github/workflows/` exists; omit section otherwise)*
434
+
435
+ **Workflows analyzed:** <N>
436
+ **Issues found:** <N>
437
+
438
+ | Workflow | Issue | Severity | Notes |
439
+ |---------|-------|----------|-------|
440
+ | <file> | <e.g., untrusted input in run step> | High/Med | <brief> |
441
+
442
+ ---
443
+
444
+ ## Spec Gap Analysis
445
+
446
+ *Phase 9 — spec-to-code-compliance (only if specs/RFCs were identified in Phase 3; omit otherwise)*
447
+
448
+ **RFCs reviewed:** <list>
449
+ **Gaps found:** <N critical/high/med>
450
+
451
+ ### Per-Gap Detail
452
+
453
+ #### G1 — <Gap Title>
454
+
455
+ - **RFC Clause:** <RFC XXXX §Y.Z>
456
+ - **Code Path:** `<file/function>`
457
+ - **Gap Type:** <partial / missing / bypassable>
458
+ - **Attack Vector:** <threat-model-relevant vector>
459
+ - **Exploit Conditions:** <prerequisites>
460
+ - **Impact:** <concrete attacker gain>
461
+ - **Evidence:** <code path and reasoning>
462
+
463
+ <Repeat for each medium-to-critical gap with a credible exploit path.>
464
+
465
+ ---
466
+
467
+ ## SAST Enrichment
468
+
469
+ *Written inline by the Phase 4 code-scanner after SAST completes (formerly Phase 5 / enrichment-filter)*
470
+
471
+ **New attack surfaces identified by SAST:**
472
+ - <entry point or code path not found in Phase 3>
473
+
474
+ **SAST findings reclassified by threat model:**
475
+ - <finding ID>: reclassified as <FALSE POSITIVE / OUT OF SCOPE> because <reason tied to threat model>
476
+ - <finding ID>: confirmed because <DFD/CFD slice shows real trust-boundary crossing>
477
+
478
+ **CodeQL cross-reference updates:**
479
+ - <entry points from entry-points.json missing from Phase 3 KB>
480
+ - <sinks from sinks.json mapping to unmodeled high-risk flows>
481
+
482
+ ---
483
+
484
+ ## Phase 10 Addendum
485
+
486
+ *Phase 10 — deep-reviewer (forward-append only; Phase 3 content preserved for auditability)*
487
+
488
+ **Newly discovered attack surfaces:**
489
+ - <surface not in Phase 3 KB>
490
+
491
+ **Revised trust boundary assumptions:**
492
+ - <original assumption> → <revised assumption — evidence>
493
+
494
+ **Additional DFD/CFD paths discovered:**
495
+ - <path description — file:line chain>
496
+ ```
497
+
498
+ ---
499
+
500
+ ## Notes for threat-modeler
501
+
502
+ - This file is the single persistent knowledge store across all phases. Write to it incrementally.
503
+ - Read actual source code, not just the README.
504
+ - Threat scenarios must reference real code paths.
505
+ - Spec detection must cite the file/class that implements the spec.
506
+ - DFD/CFD sections should stay compact and risk-prioritized, not exhaustive.
507
+ - Leave later-phase sections blank initially (mark with *Phase N* label); they are filled in by those phases.
508
+ - Do not perform compliance gap analysis — that is Phase 9's job.
509
+ - The `## CodeQL Structural Analysis` section (including diagrams) is populated by the Phase 4
510
+ static analyzer, not by the threat-modeler. The threat-modeler's contribution
511
+ is the `## Phase 4 CodeQL Extraction Targets` section only.
512
+ - For re-audit: preserve all original section content. Update sections whose source inputs changed.
513
+ Mark unchanged sections as `[reused from <short-sha>]` at the section header.
@@ -0,0 +1,191 @@
1
+ # Real-Environment Validation
2
+
3
+ Procedures for provisioning real test environments and capturing exploitation evidence. Used in Phase 11 Stage 2 (adversarial validation) and Phase 15 Task B (final PoC execution).
4
+
5
+ ## Mandatory Scope
6
+
7
+ Real-environment reproduction is required for:
8
+ - Phase 11 Stage 2: all findings that survive Stage 1 fp-check with verdict `VALID` and severity MEDIUM or higher
9
+ - Phase 15 Task B: all CRITICAL/HIGH findings promoted to `archon/findings/`
10
+
11
+ ---
12
+
13
+ ## Environment Types by Project
14
+
15
+ ### Web Applications
16
+
17
+ Preferred: Docker Compose from repo.
18
+
19
+ ```bash
20
+ # Clone and build
21
+ git clone <repo-url> target-app
22
+ cd target-app
23
+ git checkout <vulnerable-commit>
24
+
25
+ # If docker-compose.yml exists
26
+ docker compose up -d
27
+
28
+ # Verify app serves requests before testing
29
+ curl -f http://localhost:8080/healthz || curl -f http://localhost:3000/
30
+ ```
31
+
32
+ If no Dockerfile exists, create a minimal one:
33
+
34
+ ```dockerfile
35
+ FROM node:20-alpine
36
+ WORKDIR /app
37
+ COPY . .
38
+ RUN npm ci --omit=dev
39
+ EXPOSE 3000
40
+ CMD ["node", "server.js"]
41
+ ```
42
+
43
+ Alternative (cloud VM):
44
+
45
+ ```bash
46
+ # DigitalOcean
47
+ doctl compute droplet create test-env \
48
+ --image ubuntu-22-04-x64 \
49
+ --size s-1vcpu-1gb \
50
+ --region nyc3 \
51
+ --ssh-keys <key-id> \
52
+ --wait
53
+
54
+ # Azure
55
+ az vm create \
56
+ --resource-group audit-rg \
57
+ --name test-env \
58
+ --image Ubuntu2204 \
59
+ --size Standard_B1s \
60
+ --admin-username auditor \
61
+ --generate-ssh-keys \
62
+ --output json
63
+ ```
64
+
65
+ ### Libraries
66
+
67
+ Create a minimal consumer app that uses the library realistically (not designed to trigger the bug). Install at the vulnerable version. Confirm normal usage works before testing.
68
+
69
+ ```bash
70
+ # Node.js
71
+ mkdir consumer-app && cd consumer-app
72
+ npm init -y
73
+ npm install <library-name>@<vulnerable-version>
74
+ cat > index.js << 'EOF'
75
+ const lib = require('<library-name>');
76
+ // Normal usage that exercises the relevant API
77
+ EOF
78
+ node index.js
79
+
80
+ # Python
81
+ python -m venv venv && source venv/bin/activate
82
+ pip install <library-name>==<vulnerable-version>
83
+ python -c "import <library>; <normal-usage>"
84
+ ```
85
+
86
+ The consumer app must reflect real-world usage patterns. Do not construct an artificial harness designed to be exploitable.
87
+
88
+ ### CLI Tools
89
+
90
+ Install at the vulnerable version in a clean container or VM. Use production-like config and realistic test data. Reproduce via normal CLI interface only.
91
+
92
+ ```bash
93
+ # Install in clean container
94
+ docker run --rm -it ubuntu:22.04 bash
95
+ apt-get update -q && apt-get install -y <tool-deps>
96
+ pip install <tool>==<vulnerable-version> # or npm install -g, go install, etc.
97
+
98
+ # Production-like config
99
+ mkdir -p ~/.config/<tool>
100
+ cp /dev/null ~/.config/<tool>/config
101
+
102
+ # Verify normal operation first
103
+ <tool> --version
104
+ <tool> <normal-subcommand> <realistic-args>
105
+ ```
106
+
107
+ ### Protocols and Infrastructure
108
+
109
+ Provision a VM with realistic network topology. Deploy dependent services. Configure TLS and auth as production would.
110
+
111
+ ```bash
112
+ # Azure VM with networking
113
+ az group create --name audit-rg --location eastus
114
+ az vm create \
115
+ --resource-group audit-rg \
116
+ --name proto-test \
117
+ --image Ubuntu2204 \
118
+ --size Standard_B2s \
119
+ --admin-username auditor \
120
+ --generate-ssh-keys
121
+
122
+ # Open test port
123
+ az vm open-port --resource-group audit-rg --name proto-test --port 8443
124
+
125
+ # Deploy target service on VM
126
+ ssh auditor@<vm-ip> 'sudo apt-get install -y <service-deps> && <service-start-cmd>'
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Evidence Capture
132
+
133
+ For every reproduction attempt, capture and store:
134
+
135
+ 1. Setup commands (exact commands run, with output)
136
+ 2. Pre-exploitation health check (confirms the environment is working normally)
137
+ 3. Exploitation attempt output (exact command and full stdout/stderr)
138
+ 4. Impact proof (evidence that the vulnerability had the claimed effect)
139
+
140
+ Store all evidence under `archon/real-env-evidence/<finding-slug>/`:
141
+
142
+ ```
143
+ archon/real-env-evidence/<finding-slug>/
144
+ setup.sh # provisioning commands
145
+ setup.log # output of setup commands
146
+ healthcheck.log # pre-exploit health check output
147
+ exploit.sh # exploitation attempt
148
+ exploit.log # full output of exploitation attempt
149
+ impact.log # impact evidence (file read, token, screenshot, etc.)
150
+ env-info.txt # docker version / OS / tool version used
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Reproduction Attempt Protocol
156
+
157
+ 1. Run the exploitation attempt as written.
158
+ 2. If it fails, try up to 3 variations (different payloads, encodings, or parameter positions).
159
+ 3. Document each variation and its result.
160
+ 4. If all 3 attempts fail, the finding is not reproduced.
161
+
162
+ ---
163
+
164
+ ## When Blocked
165
+
166
+ If real-environment reproduction is not feasible (no Docker, no cloud credentials, proprietary dependencies, hardware required), document the specific blocker and annotate the finding:
167
+
168
+ ```
169
+ PoC-Status: theoretical
170
+ PoC-Block-Reason: <specific reason reproduction was not attempted>
171
+ ```
172
+
173
+ Disclose the theoretical status in the final report. Do not silently report unexecuted PoCs as confirmed.
174
+
175
+ ---
176
+
177
+ ## Cleanup
178
+
179
+ Destroy ephemeral environments after evidence is captured:
180
+
181
+ ```bash
182
+ # Docker
183
+ docker compose down -v
184
+ docker system prune -f
185
+
186
+ # DigitalOcean
187
+ doctl compute droplet delete <droplet-id> --force
188
+
189
+ # Azure
190
+ az group delete --name audit-rg --yes --no-wait
191
+ ```