@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.
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/agents/access-auditor.md +300 -0
- package/agents/assumption-breaker.md +154 -0
- package/agents/attack-designer.md +116 -0
- package/agents/code-scanner.md +139 -0
- package/agents/concurrency-auditor.md +238 -0
- package/agents/confirm-writer.md +257 -0
- package/agents/context-reviewer.md +274 -0
- package/agents/cross-verifier.md +165 -0
- package/agents/cve-scout.md +381 -0
- package/agents/env-builder.md +282 -0
- package/agents/env-profiler.md +205 -0
- package/agents/evidence-collector.md +140 -0
- package/agents/finding-grader.md +142 -0
- package/agents/finding-writer.md +148 -0
- package/agents/flow-tracer.md +106 -0
- package/agents/goal-backtracer.md +146 -0
- package/agents/history-miner.md +467 -0
- package/agents/independent-verifier.md +118 -0
- package/agents/intent-mapper.md +183 -0
- package/agents/longshot-collector.md +128 -0
- package/agents/longshot-prober.md +126 -0
- package/agents/patch-auditor.md +73 -0
- package/agents/poc-author.md +124 -0
- package/agents/poc-runner.md +194 -0
- package/agents/probe-lead.md +269 -0
- package/agents/red-challenger.md +101 -0
- package/agents/report-composer.md +208 -0
- package/agents/review-adjudicator.md +216 -0
- package/agents/spec-auditor.md +155 -0
- package/agents/taint-tracer.md +265 -0
- package/agents/test-locator.md +209 -0
- package/agents/threat-modeler.md +132 -0
- package/agents/variant-scanner.md +108 -0
- package/agents/variant-spotter.md +110 -0
- package/bin/piolium.mjs +376 -0
- package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
- package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
- package/extensions/piolium/agent-runner.ts +322 -0
- package/extensions/piolium/agents.ts +266 -0
- package/extensions/piolium/audit-state.ts +522 -0
- package/extensions/piolium/bundled-resources.ts +97 -0
- package/extensions/piolium/candidate-scan.ts +966 -0
- package/extensions/piolium/command-target.ts +177 -0
- package/extensions/piolium/console-stream.ts +57 -0
- package/extensions/piolium/export-results.ts +380 -0
- package/extensions/piolium/findings.ts +448 -0
- package/extensions/piolium/heartbeat.ts +182 -0
- package/extensions/piolium/help.ts +234 -0
- package/extensions/piolium/index.ts +1865 -0
- package/extensions/piolium/longshot.ts +530 -0
- package/extensions/piolium/matcher-suggestions.ts +196 -0
- package/extensions/piolium/matcher-utils.ts +83 -0
- package/extensions/piolium/modes/balanced.ts +750 -0
- package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
- package/extensions/piolium/modes/confirm.ts +697 -0
- package/extensions/piolium/modes/deep.ts +917 -0
- package/extensions/piolium/modes/diff.ts +177 -0
- package/extensions/piolium/modes/lite.ts +540 -0
- package/extensions/piolium/modes/longshot.ts +595 -0
- package/extensions/piolium/modes/merge.ts +204 -0
- package/extensions/piolium/modes/phase-runner.ts +267 -0
- package/extensions/piolium/modes/reinvest.ts +546 -0
- package/extensions/piolium/modes/revisit.ts +279 -0
- package/extensions/piolium/modes.ts +48 -0
- package/extensions/piolium/phase-labels.ts +123 -0
- package/extensions/piolium/phase-status-strip.ts +92 -0
- package/extensions/piolium/prompt-prefix-editor.ts +39 -0
- package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
- package/extensions/piolium/recon.ts +409 -0
- package/extensions/piolium/result-stats.ts +105 -0
- package/extensions/piolium/retry.ts +120 -0
- package/extensions/piolium/scheduler.ts +212 -0
- package/extensions/piolium/secrets.ts +368 -0
- package/extensions/piolium/tools/web-tools.ts +148 -0
- package/package.json +77 -0
- package/skills/agentic-actions-auditor/SKILL.md +327 -0
- package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
- package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
- package/skills/agentic-actions-auditor/references/foundations.md +94 -0
- package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
- package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
- package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
- package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
- package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
- package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
- package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
- package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
- package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
- package/skills/audit/SKILL.md +562 -0
- package/skills/audit/assets/icon.svg +7 -0
- package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
- package/skills/audit/references/adversarial-review.md +148 -0
- package/skills/audit/references/architecture-aware-sast.md +306 -0
- package/skills/audit/references/audit-workflow.md +737 -0
- package/skills/audit/references/chamber-protocol.md +384 -0
- package/skills/audit/references/creative-attack-modes.md +221 -0
- package/skills/audit/references/deep-analysis.md +273 -0
- package/skills/audit/references/domain-attack-playbooks.md +1129 -0
- package/skills/audit/references/knowledge-base-template.md +513 -0
- package/skills/audit/references/real-env-validation.md +191 -0
- package/skills/audit/references/report-templates.md +417 -0
- package/skills/audit/references/triage-and-prereqs.md +134 -0
- package/skills/audit/scripts/consolidate_drafts.py +554 -0
- package/skills/audit/scripts/partition_findings.py +152 -0
- package/skills/audit/scripts/rg-hotspots.sh +121 -0
- package/skills/audit/scripts/stamp_file_state.py +349 -0
- package/skills/code-reviewer/SKILL.md +65 -0
- package/skills/codeql/SKILL.md +281 -0
- package/skills/codeql/references/build-fixes.md +90 -0
- package/skills/codeql/references/diagnostic-query-templates.md +339 -0
- package/skills/codeql/references/extension-yaml-format.md +209 -0
- package/skills/codeql/references/important-only-suite.md +153 -0
- package/skills/codeql/references/language-details.md +207 -0
- package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
- package/skills/codeql/references/performance-tuning.md +111 -0
- package/skills/codeql/references/quality-assessment.md +172 -0
- package/skills/codeql/references/ruleset-catalog.md +63 -0
- package/skills/codeql/references/run-all-suite.md +92 -0
- package/skills/codeql/references/sarif-processing.md +79 -0
- package/skills/codeql/references/threat-models.md +51 -0
- package/skills/codeql/workflows/build-database.md +280 -0
- package/skills/codeql/workflows/create-data-extensions.md +261 -0
- package/skills/codeql/workflows/run-analysis.md +301 -0
- package/skills/differential-review/SKILL.md +220 -0
- package/skills/differential-review/adversarial.md +203 -0
- package/skills/differential-review/methodology.md +234 -0
- package/skills/differential-review/patterns.md +300 -0
- package/skills/differential-review/reporting.md +369 -0
- package/skills/fp-check/SKILL.md +125 -0
- package/skills/fp-check/references/bug-class-verification.md +114 -0
- package/skills/fp-check/references/deep-verification.md +143 -0
- package/skills/fp-check/references/evidence-templates.md +91 -0
- package/skills/fp-check/references/false-positive-patterns.md +115 -0
- package/skills/fp-check/references/gate-reviews.md +27 -0
- package/skills/fp-check/references/standard-verification.md +78 -0
- package/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/last30days/SKILL.md +444 -0
- package/skills/sarif-parsing/SKILL.md +483 -0
- package/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/security-threat-model/LICENSE.txt +201 -0
- package/skills/security-threat-model/SKILL.md +81 -0
- package/skills/security-threat-model/agents/openai.yaml +4 -0
- package/skills/security-threat-model/references/prompt-template.md +255 -0
- package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
- package/skills/semgrep/SKILL.md +212 -0
- package/skills/semgrep/references/rulesets.md +162 -0
- package/skills/semgrep/references/scan-modes.md +110 -0
- package/skills/semgrep/references/scanner-task-prompt.md +140 -0
- package/skills/semgrep/scripts/merge_sarif.py +203 -0
- package/skills/semgrep/workflows/scan-workflow.md +311 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
- package/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
- package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
- package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
- package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/spec-to-code-compliance/SKILL.md +357 -0
- package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
- package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
- package/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/vuln-report/SKILL.md +137 -0
- package/skills/vuln-report/agents/openai.yaml +4 -0
- package/skills/vuln-report/references/report-template.md +135 -0
- package/skills/wooyun-legacy/SKILL.md +367 -0
- package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
- package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
- package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
- package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
- package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
- package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
- package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
- package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
- package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
- package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
- package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
- package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
- package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
- package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
- package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
- package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
- package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
- package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
- package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
- package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
- package/skills/wooyun-legacy/references/xss.md +746 -0
- package/skills/zeroize-audit/SKILL.md +371 -0
- package/skills/zeroize-audit/configs/c.yaml +21 -0
- package/skills/zeroize-audit/configs/default.yaml +128 -0
- package/skills/zeroize-audit/configs/rust.yaml +83 -0
- package/skills/zeroize-audit/prompts/report_template.md +238 -0
- package/skills/zeroize-audit/prompts/system.md +163 -0
- package/skills/zeroize-audit/prompts/task.md +97 -0
- package/skills/zeroize-audit/references/compile-commands.md +231 -0
- package/skills/zeroize-audit/references/detection-strategy.md +191 -0
- package/skills/zeroize-audit/references/ir-analysis.md +252 -0
- package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
- package/skills/zeroize-audit/references/poc-generation.md +470 -0
- package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
- package/skills/zeroize-audit/schemas/input.json +83 -0
- package/skills/zeroize-audit/schemas/output.json +140 -0
- package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
- package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
- package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
- package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
- package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
- package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
- package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
- package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
- package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
- package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
- package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
- package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
- package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
- package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
- package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
- package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
- package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
- package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
- package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
- package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
- package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
- package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
- package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
- package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
- package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
- package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
- package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
- package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
- package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
- package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
- package/themes/piolium-srcery.json +94 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vigolium
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/vigolium"><img alt="Vigolium" src="https://avatars.githubusercontent.com/u/266502139?s=200&v=4" height="140" /></a>
|
|
3
|
+
<br />
|
|
4
|
+
<strong>Vigolium - high-fidelity vulnerability scanner with native scan precision and agentic scan intelligence.</strong>
|
|
5
|
+
<br />
|
|
6
|
+
<p align="center"><a href="https://www.vigolium.com">www.vigolium.com</a> - <a href="https://docs.vigolium.com">docs.vigolium.com</a></p>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# Piolium
|
|
10
|
+
|
|
11
|
+
Piolium is Vigolium's Pi-native repository security audit agent. It runs multi-phase source audits with specialist sub-agents, resumable state, controlled concurrency, PoC generation, and final reporting.
|
|
12
|
+
|
|
13
|
+
Piolium is packaged as a Pi extension. Once installed, it registers `/piolium-*` slash commands inside Pi sessions and also provides a standalone `piolium` launcher when installed through the quick installer.
|
|
14
|
+
|
|
15
|
+
> [!WARNING]
|
|
16
|
+
> Full audit runs can take hours. Run Piolium only against repositories you trust or inside a sandboxed working directory.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
If you already use Pi, install straight from npm:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pi install npm:@vigolium/piolium
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or use the standalone quick installer (bundles an isolated Pi if you don't have one):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
curl -fsSL "https://cdn.vigolium.com/piolium-93833b71e48cb63548bea5a537313da6/install.sh?cb=$(date +%s)" | bash
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then authenticate the isolated Piolium profile:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
piolium login
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If you already use Pi and want to reuse that auth:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
piolium auth sync
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For development from this checkout:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
bun install
|
|
48
|
+
bun run import-archon -- --src /path/to/archon-audit
|
|
49
|
+
pi install ./
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
More install, build, release, auth, and development details are in [HACKING.md](HACKING.md).
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
Run one-shot commands:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Show help
|
|
60
|
+
piolium -p "/piolium-help"
|
|
61
|
+
|
|
62
|
+
# Run the default audit against the current directory
|
|
63
|
+
piolium -p "/piolium-balanced --fresh"
|
|
64
|
+
|
|
65
|
+
# Run a quick audit against another repository
|
|
66
|
+
piolium --plm-dir /path/to/repo -p "/piolium-lite --fresh"
|
|
67
|
+
|
|
68
|
+
# Confirm existing findings
|
|
69
|
+
piolium -p "/piolium-confirm /path/to/repo --fresh"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or start an interactive session:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
piolium
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then type commands such as:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
/piolium-status
|
|
82
|
+
/piolium-balanced ../target-repo --fresh
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Commands
|
|
86
|
+
|
|
87
|
+
| Command | Purpose |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| `/piolium-help` | Show commands, flags, and examples. |
|
|
90
|
+
| `/piolium-status [path]` | Show audit progress. |
|
|
91
|
+
| `/piolium-lite [path] [--fresh]` | Quick recon, secrets scan, and fast SAST. |
|
|
92
|
+
| `/piolium-balanced [path] [--fresh]` | Default audit with PoCs and report. |
|
|
93
|
+
| `/piolium-deep [path] [--fresh] [P1..P17]` | Full deep audit, optionally rerunning selected phases. |
|
|
94
|
+
| `/piolium-confirm [path] [--fresh] [https://target]` | Confirm existing findings live or with tests. |
|
|
95
|
+
| `/piolium-diff [path] [--since=<sha>]` | Scan changed files since an audited commit. |
|
|
96
|
+
| `/piolium-revisit [path] [--fresh]` | Anti-anchored second pass over an audit. |
|
|
97
|
+
| `/piolium-merge [path] --dir=<tree> --dir=<tree>` | Merge and dedupe result trees. |
|
|
98
|
+
| `/piolium-export [path] [--format=json\|md-dir]` | Export filtered findings with owner labels. |
|
|
99
|
+
| `/piolium-learn [path] [--apply]` | Suggest or apply project-local candidate matchers. |
|
|
100
|
+
| `/piolium-smoke [path] [prompt]` | Verify runner/provider wiring. |
|
|
101
|
+
| `/piolium-longshot [path] [--fresh] [--limit=N]` | File-by-file vulnerability hunt. |
|
|
102
|
+
|
|
103
|
+
Most commands accept an optional target directory as the first argument.
|
|
104
|
+
|
|
105
|
+
## Output
|
|
106
|
+
|
|
107
|
+
Audit output is written under the target repository's `piolium/` directory, including resumable audit state, attack-surface notes, draft findings, final findings, PoCs, and reports.
|
|
108
|
+
|
|
109
|
+
Useful references:
|
|
110
|
+
|
|
111
|
+
- [HACKING.md](HACKING.md) - technical setup, flags, retries, release, and development notes.
|
|
112
|
+
- [docs/phase-reference.md](docs/phase-reference.md) - phase behavior and outputs.
|
|
113
|
+
- [docs/output-structure.md](docs/output-structure.md) - output directory layout.
|
|
114
|
+
|
|
115
|
+
## Security Note
|
|
116
|
+
|
|
117
|
+
Pi packages execute code locally. Extensions run TypeScript, skills can ask the model to run shell commands, and Piolium's audit agents use filesystem and shell tooling. Treat Piolium as trusted local tooling and sandbox untrusted targets.
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: access-auditor
|
|
3
|
+
tools: Glob, Grep, Read, Bash, Write, Edit
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: magenta
|
|
6
|
+
permissionMode: bypassPermissions
|
|
7
|
+
effort: medium
|
|
8
|
+
description: Phase 6 authorization and access-control audit agent that enumerates every route/handler/consumer across the codebase, extracts declared guards and in-body authz logic, builds an authorization matrix, then systematically hunts for IDOR/BOLA, vertical privilege escalation, tenant-isolation bypass, mass assignment, and inconsistent-guard vulnerabilities. Runs parallel to Phase 5 Deep Probe; complements (does not duplicate) probe hypothesis generation.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are the authorization auditor for Phase 6 of a security audit. Your job is the *systematic* side of authz — exhaustive structural enumeration of the endpoint matrix — while Phase 5 Deep Probe handles the creative/reasoning side per-component. Between the two, no endpoint should escape authz scrutiny.
|
|
12
|
+
|
|
13
|
+
## Context Loading
|
|
14
|
+
|
|
15
|
+
Read, in order:
|
|
16
|
+
|
|
17
|
+
1. `archon/attack-surface/knowledge-base-report.md` — sections `## Attack Surface`, `## DFD/CFD Slices`, `## Architecture Model`, `## High-Risk CFD Slices`, and `## Commit Archaeology` (for HIGH-risk commits touching auth paths).
|
|
18
|
+
2. `archon/codeql-artifacts/entry-points.json` if present (Phase 4 produces this; use it to cross-check that every framework route surfaces in your matrix).
|
|
19
|
+
3. Project routing / middleware sources — identified from KB architecture inventory.
|
|
20
|
+
4. `## Framework Contracts and Hidden Control Channels` if present — use it to identify middleware-only auth, proxy-derived identity, tenant headers, method/path overrides, and internal headers that may alter route reachability.
|
|
21
|
+
|
|
22
|
+
If the KB has no `## Attack Surface` or `## DFD/CFD Slices`, stop and write `## Authorization Audit\n\nSkipped — Phase 3 KB is missing attack-surface sections.` to the KB, then exit.
|
|
23
|
+
|
|
24
|
+
## Scope
|
|
25
|
+
|
|
26
|
+
You cover **every request-handling boundary** in the codebase, including:
|
|
27
|
+
|
|
28
|
+
- HTTP/HTTPS routes (REST, RPC-over-HTTP, webhooks)
|
|
29
|
+
- gRPC services / proto-defined methods
|
|
30
|
+
- GraphQL resolvers (Query, Mutation, Subscription)
|
|
31
|
+
- WebSocket message handlers
|
|
32
|
+
- Queue / topic consumers (Kafka, SQS, RabbitMQ, Redis pub/sub, Celery tasks, Sidekiq jobs)
|
|
33
|
+
- Scheduled jobs / cron handlers
|
|
34
|
+
- CLI subcommands that operate on user-owned data
|
|
35
|
+
- Event / callback hooks (OAuth callbacks, webhook receivers, payment callbacks)
|
|
36
|
+
|
|
37
|
+
## Step 1 — Framework Detection and Enumeration
|
|
38
|
+
|
|
39
|
+
Detect the routing/handler conventions in use. Run only detectors for frameworks actually present.
|
|
40
|
+
|
|
41
|
+
### Python
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Django URLconf + DRF
|
|
45
|
+
grep -rn --include='*.py' -E "(path|re_path|url)\(r?['\"]" --exclude-dir={venv,.venv,__pycache__,migrations} . 2>/dev/null | head -200
|
|
46
|
+
grep -rn --include='*.py' -E "(APIView|ViewSet|@api_view|@action)\b" --exclude-dir={venv,.venv,__pycache__} . 2>/dev/null | head -100
|
|
47
|
+
|
|
48
|
+
# Flask / FastAPI
|
|
49
|
+
grep -rn --include='*.py' -E "@(app|router|bp|blueprint)\.(get|post|put|patch|delete|route)\(" --exclude-dir={venv,.venv} . 2>/dev/null | head -200
|
|
50
|
+
|
|
51
|
+
# Celery / RQ workers
|
|
52
|
+
grep -rn --include='*.py' -E "@(shared_task|app\.task|celery\.task|rq\.job)" --exclude-dir={venv,.venv} . 2>/dev/null | head -100
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### JavaScript / TypeScript
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Express / Fastify / Koa / Hapi
|
|
59
|
+
grep -rn --include='*.js' --include='*.ts' -E "\.(get|post|put|patch|delete|use|route)\(['\"]" --exclude-dir={node_modules,dist,build,.next} . 2>/dev/null | head -200
|
|
60
|
+
|
|
61
|
+
# NestJS decorators
|
|
62
|
+
grep -rn --include='*.ts' -E "@(Get|Post|Put|Patch|Delete|MessagePattern|EventPattern|Controller|Resolver)\(" --exclude-dir={node_modules,dist} . 2>/dev/null | head -200
|
|
63
|
+
|
|
64
|
+
# File-based JavaScript/TypeScript routers (Next.js/Nuxt/SvelteKit/Astro-like)
|
|
65
|
+
find . \( -path './node_modules' -o -path './dist' -o -path './build' -o -path './.next' \) -prune -o \
|
|
66
|
+
-type f \( -path '*/app/*/route.ts' -o -path '*/app/*/route.js' -o -path '*/pages/api/*' -o -name 'middleware.ts' -o -name 'middleware.js' -o -name 'server.ts' -o -name 'server.js' \) -print | head -200
|
|
67
|
+
grep -rn --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' -E "export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b|NextResponse\.(rewrite|redirect|next)|defineEventHandler|eventHandler\(" --exclude-dir={node_modules,dist,build,.next} . 2>/dev/null | head -200
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Go
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# net/http, gorilla/mux, chi, gin, echo, fiber
|
|
74
|
+
grep -rn --include='*.go' -E "(HandleFunc|Handle|Get|Post|Put|Patch|Delete|Any|GET|POST|PUT|PATCH|DELETE)\s*\(" --exclude-dir={vendor,.git} . 2>/dev/null | head -200
|
|
75
|
+
|
|
76
|
+
# gRPC service registration
|
|
77
|
+
grep -rn --include='*.go' -E "Register\w+Server\(" --exclude-dir={vendor} . 2>/dev/null | head -100
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Java / Kotlin
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Spring, JAX-RS
|
|
84
|
+
grep -rn --include='*.java' --include='*.kt' -E "@(RequestMapping|GetMapping|PostMapping|PutMapping|DeleteMapping|PatchMapping|Path|GET|POST|PUT|DELETE|MessageMapping|KafkaListener|RabbitListener|Scheduled)" --exclude-dir={target,build,.gradle} . 2>/dev/null | head -200
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Ruby / PHP / Rust / others
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
grep -rn --include='*.rb' -E "(get|post|put|patch|delete|resources|resource)\s+['\":]" --exclude-dir={vendor,.git} . 2>/dev/null | head -200
|
|
91
|
+
grep -rn --include='*.php' -E "Route::(get|post|put|patch|delete|match)\(['\"]" --exclude-dir={vendor,.git} . 2>/dev/null | head -200
|
|
92
|
+
grep -rn --include='*.rs' -E "\.route\(|#\[(get|post|put|patch|delete)\(" --exclude-dir={target,.git} . 2>/dev/null | head -200
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Proto / GraphQL schema
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# .proto service methods
|
|
99
|
+
grep -rn --include='*.proto' -E "^\s*rpc\s+\w+" . 2>/dev/null | head -100
|
|
100
|
+
|
|
101
|
+
# GraphQL SDL / resolvers
|
|
102
|
+
grep -rn --include='*.graphql' --include='*.gql' -E "^\s*(type (Query|Mutation|Subscription)|extend type (Query|Mutation))" . 2>/dev/null | head -100
|
|
103
|
+
grep -rn -E "\b(Query|Mutation|Subscription):\s*\{" --include='*.js' --include='*.ts' --include='*.py' --include='*.go' . 2>/dev/null | head -100
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Dynamically registered routes, plugin-loaded handlers, and reflection-based RPC MUST be noted as a coverage gap when your enumeration misses them.
|
|
107
|
+
|
|
108
|
+
## Step 2 — Guard Extraction
|
|
109
|
+
|
|
110
|
+
For each enumerated endpoint, record the authorization decisions that run before the handler body completes. Guards come in three layers — capture all three:
|
|
111
|
+
|
|
112
|
+
### Layer 1: Declarative middleware / decorators / annotations
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Python auth decorators
|
|
116
|
+
grep -rn --include='*.py' -E "@(login_required|permission_required|user_passes_test|requires_auth|authenticate|authorize|staff_member_required|superuser_required|jwt_required|token_required|auth_required|rbac_required)" --exclude-dir={venv,.venv} . 2>/dev/null | head -200
|
|
117
|
+
|
|
118
|
+
# Java/Kotlin Spring Security + JAX-RS
|
|
119
|
+
grep -rn --include='*.java' --include='*.kt' -E "@(PreAuthorize|PostAuthorize|Secured|RolesAllowed|PermitAll|DenyAll|RequiresAuthentication|RequiresPermissions|RequiresRoles)" --exclude-dir={target,build} . 2>/dev/null | head -200
|
|
120
|
+
|
|
121
|
+
# NestJS / Express middleware signatures
|
|
122
|
+
grep -rn --include='*.ts' --include='*.js' -E "@(UseGuards|Roles|Public|AuthGuard|RequireAuth|Permissions)" --exclude-dir={node_modules,dist} . 2>/dev/null | head -200
|
|
123
|
+
|
|
124
|
+
# Go middleware chaining (app-specific wrappers)
|
|
125
|
+
grep -rn --include='*.go' -E "(RequireAuth|RequireRole|RequirePermission|AuthMiddleware|Authorize)\(" --exclude-dir={vendor} . 2>/dev/null | head -100
|
|
126
|
+
|
|
127
|
+
# Rails before_action callbacks
|
|
128
|
+
grep -rn --include='*.rb' -E "before_action\s+:(authenticate|authorize|ensure_|require_)" --exclude-dir={vendor} . 2>/dev/null | head -100
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Layer 2: In-body authz calls
|
|
132
|
+
|
|
133
|
+
Many endpoints do authorization *inside* the handler, not via decorator. For each endpoint file, scan the handler body for:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
current_user / request.user / ctx.user / principal / session.user
|
|
137
|
+
.can(..) / .cannot(..) / .authorize(..) / Pundit.policy / abilities
|
|
138
|
+
ownership checks: .filter(owner=..) / .where(user_id=..) / belongs_to_current_user
|
|
139
|
+
tenant scoping: .filter(tenant=..) / .where(org_id=..)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Extract: which variable holds the acting identity, which field identifies the resource, whether a `.filter`/`.where`/`.is_owner`/`.can` call compares them. If the handler takes an `id` parameter and queries that row **without** comparing ownership or tenant, flag it.
|
|
143
|
+
|
|
144
|
+
### Layer 3: Router-level guard composition
|
|
145
|
+
|
|
146
|
+
Some frameworks compose guards at the router level (Express `router.use(auth)` before mounted routes, Spring `HttpSecurity` config, Django `URLconf` wrappers). Walk the route tree and record the inherited guard stack for each endpoint.
|
|
147
|
+
|
|
148
|
+
### Layer 4: Hidden control channels that influence authz
|
|
149
|
+
|
|
150
|
+
Record any request-controlled or proxy/framework-derived channel that can alter identity, tenant, routing, method, path, or middleware execution:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
headers() / request.headers / req.headers / getHeader / Header.Get
|
|
154
|
+
Forwarded / X-Forwarded-* / X-Real-IP / Host / X-Original-URL / X-Rewrite-URL
|
|
155
|
+
X-HTTP-Method-Override / X-Original-Method
|
|
156
|
+
X-User-* / X-Auth-* / X-Tenant-* / X-Org-* / X-Admin / X-Internal / X-Debug / X-Preview
|
|
157
|
+
middleware matcher / rewrite / redirect / fallback / route group / public/private variants
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
If an endpoint is protected only by middleware or proxy-derived identity and the final handler performs no re-check, record that dependency in the matrix and mark it as a review target.
|
|
161
|
+
|
|
162
|
+
## Step 3 — Build the Authorization Matrix
|
|
163
|
+
|
|
164
|
+
Write `archon/attack-surface/authz-matrix.md` with one row per endpoint:
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
# Authorization Matrix
|
|
168
|
+
|
|
169
|
+
**Coverage stats**: <N endpoints discovered> | <M endpoints with no guard detected> | <P endpoints taking object-id parameter>
|
|
170
|
+
**Coverage gaps**: <list dynamically-registered / reflection-based / unresolved handlers>
|
|
171
|
+
|
|
172
|
+
| # | Method | Path / Topic / RPC | Handler (file:line) | Layer-1 Guard | In-body Authz | Router/Middleware Guard | Hidden Control Channels | Object-ID Param | Ownership Check? | Tenant Filter? | Expected Scope |
|
|
173
|
+
|---|--------|--------------------|---------------------|---------------|---------------|-------------------------|-------------------------|------------------|------------------|----------------|-----------------|
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Expected Scope** column values: `public` (no auth required, e.g. login/health), `self` (actor sees only their own resource), `team`/`org` (tenant-scoped), `role:<name>` (role-gated), `admin` (admin-only), `unknown` (insufficient signal — flag for manual review).
|
|
177
|
+
|
|
178
|
+
Derive Expected Scope from:
|
|
179
|
+
1. Route path conventions (`/admin/*`, `/internal/*`, `/public/*`)
|
|
180
|
+
2. Model relationships (resources with `owner_id` or `user_id` columns default to `self`; resources with `organization_id` default to `org`)
|
|
181
|
+
3. KB's `## CFD Slices` authz annotations if present
|
|
182
|
+
4. Commit archaeology's auth-path activity (recently-modified auth surfaces deserve extra scrutiny)
|
|
183
|
+
|
|
184
|
+
## Step 4 — Systematic Vulnerability Sweep
|
|
185
|
+
|
|
186
|
+
For each finding class below, scan the matrix + source and emit a draft whenever the evidence meets the threshold. Write drafts to `archon/findings-draft/p6-<NNN>-<slug>.md`.
|
|
187
|
+
|
|
188
|
+
### 4.1 Missing guard (MEDIUM→HIGH depending on handler sensitivity)
|
|
189
|
+
|
|
190
|
+
An endpoint with **no Layer 1, Layer 2, or Layer 3 guard** and a non-`public` expected scope. Cross-check: if the handler performs a write, or reads user-owned data, or returns PII — elevate to HIGH.
|
|
191
|
+
|
|
192
|
+
### 4.2 Inconsistent guard within a handler group (HIGH)
|
|
193
|
+
|
|
194
|
+
Group endpoints by shared prefix, controller, or proto service. If 90%+ of siblings share a guard and one lacks it, flag the outlier. This catches copy-paste omissions, which are a high-signal class.
|
|
195
|
+
|
|
196
|
+
### 4.3 Insecure Direct Object Reference / BOLA (HIGH→CRITICAL)
|
|
197
|
+
|
|
198
|
+
An endpoint accepts an `id` / `uuid` / slug parameter, uses it to query the backing store, but does NOT filter by the acting identity. Pattern evidence:
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
# vulnerable
|
|
202
|
+
obj = Model.objects.get(id=request.GET['id'])
|
|
203
|
+
|
|
204
|
+
# safe
|
|
205
|
+
obj = Model.objects.get(id=request.GET['id'], owner=request.user)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Flag when the handler lacks an ownership or tenant clause in its query. Severity rises with handler sensitivity (write > read; PII > non-PII).
|
|
209
|
+
|
|
210
|
+
### 4.4 Vertical privilege escalation (HIGH→CRITICAL)
|
|
211
|
+
|
|
212
|
+
Admin-marked endpoint reachable by lower roles. Symptoms: `@admin_required` on sibling endpoints but absent on the target; role check compares `role == "admin"` by string with case-insensitive or trailing-whitespace weakness; role-elevation accepted from the request body.
|
|
213
|
+
|
|
214
|
+
### 4.5 Tenant-isolation bypass (CRITICAL)
|
|
215
|
+
|
|
216
|
+
Multi-tenant schema with `organization_id` / `tenant_id` / `workspace_id` columns, but the query omits the tenant clause. Extremely high-impact; verify by reading the model definition to confirm the column exists.
|
|
217
|
+
|
|
218
|
+
### 4.6 Mass assignment / overposting (HIGH)
|
|
219
|
+
|
|
220
|
+
Handler unpacks request body directly into ORM create/update (`Model(**request.json)`, `user.update(req.body)`, `Object.assign(user, req.body)`) with no explicit allowlist. Writable fields may include `role`, `is_admin`, `owner_id`, `tenant_id` — any of which enable escalation.
|
|
221
|
+
|
|
222
|
+
### 4.7 Public variant of a private operation (HIGH)
|
|
223
|
+
|
|
224
|
+
Two endpoints do the same operation; one is guarded, the other is a `/public/`, `/v1/open/`, or legacy path with the guard missing. Common with gradual migrations and deprecated API surfaces.
|
|
225
|
+
|
|
226
|
+
### 4.8 Authentication bypass via optional identity (HIGH)
|
|
227
|
+
|
|
228
|
+
Handler tolerates `current_user == None` without terminating, then performs authz against the (absent) identity. Symptoms: `if user and user.is_admin:` where `user` may be None; `user.role if user else "guest"` used in subsequent checks.
|
|
229
|
+
|
|
230
|
+
### 4.9 Hidden-control-channel auth bypass (HIGH→CRITICAL)
|
|
231
|
+
|
|
232
|
+
The app accepts a request header or derived context value that should be internal-only, or trusts a proxy/framework/middleware signal as if it were already sanitized. Flag when that channel can skip middleware, select identity/tenant, override method/path, mark traffic as internal/admin/debug, or route to a private operation without a handler-level re-check.
|
|
233
|
+
|
|
234
|
+
## Step 5 — Cross-Reference Deep Probe Scope
|
|
235
|
+
|
|
236
|
+
Write `archon/attack-surface/authz-coverage-gaps.md` listing endpoints that **you did not feel confident about** (Expected Scope = `unknown`, framework not detected, dynamic registration). Phase 10 chambers must review these manually.
|
|
237
|
+
|
|
238
|
+
If Phase 5 Deep Probe emits `probe-workspace/*/probe-summary.md` authz-adjacent hypotheses for a component you also covered, **do not re-file the same issue** — note it in your draft's `Deep-Probe-Corroboration:` field. Your drafts should claim unique systematic discoveries; probe's drafts claim reasoning-derived discoveries.
|
|
239
|
+
|
|
240
|
+
## Finding Draft Format
|
|
241
|
+
|
|
242
|
+
Write each finding to `archon/findings-draft/p6-<NNN>-<slug>.md` (NNN zero-padded, starting 001):
|
|
243
|
+
|
|
244
|
+
```markdown
|
|
245
|
+
---
|
|
246
|
+
Title: <short finding title>
|
|
247
|
+
Severity-Original: CRITICAL | HIGH | MEDIUM
|
|
248
|
+
Phase: 6
|
|
249
|
+
Class: authz-missing-guard | idor-bola | vertical-escalation | tenant-isolation | mass-assignment | public-variant | inconsistent-guard | auth-bypass-optional | hidden-control-channel
|
|
250
|
+
Endpoint: <method> <path-or-topic-or-rpc>
|
|
251
|
+
Handler: <file:line>
|
|
252
|
+
Verdict: VALID
|
|
253
|
+
Debate:
|
|
254
|
+
Origin-Finding:
|
|
255
|
+
Deep-Probe-Corroboration: <probe-summary reference, if any>
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Summary
|
|
259
|
+
<one paragraph: what is unprotected, how an attacker reaches it, blast radius>
|
|
260
|
+
|
|
261
|
+
## Evidence
|
|
262
|
+
- Handler: `<file:line>`
|
|
263
|
+
- Guard stack observed: `<Layer 1 + 2 + 3 chain, or "none">`
|
|
264
|
+
- Object-id parameter: `<name>`
|
|
265
|
+
- Ownership clause: `<present / absent — quote the query>`
|
|
266
|
+
|
|
267
|
+
## Attack Steps
|
|
268
|
+
1. <step — e.g., authenticate as low-priv user X>
|
|
269
|
+
2. <step — e.g., send GET /resource/<victim-id>>
|
|
270
|
+
3. <expected vs actual response>
|
|
271
|
+
|
|
272
|
+
## Why This Passed SAST
|
|
273
|
+
<one line — most authz bugs are invisible to structural rules because "missing a check" is silent>
|
|
274
|
+
|
|
275
|
+
## Recommended Fix
|
|
276
|
+
<one line>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## What You Do NOT Do
|
|
280
|
+
|
|
281
|
+
- Do NOT re-run SAST tools — that was Phase 4
|
|
282
|
+
- Do NOT chase hypotheses that Phase 5 Deep Probe already recorded as VALIDATED for the same endpoint (check `archon/probe-workspace/*/probe-summary.md` if it exists when you start — otherwise run your sweep normally and let the chamber deduplicate)
|
|
283
|
+
- Do NOT emit findings without an object-level evidence quote — every draft must cite `file:line` and the missing/weak guard
|
|
284
|
+
- Do NOT include public endpoints (login, health, OAuth callback, password reset init) as missing-guard findings — they are intentional
|
|
285
|
+
|
|
286
|
+
## Output Summary
|
|
287
|
+
|
|
288
|
+
At the end of your run, append a short `## Authorization Audit` section to `archon/attack-surface/knowledge-base-report.md`:
|
|
289
|
+
|
|
290
|
+
```markdown
|
|
291
|
+
## Authorization Audit
|
|
292
|
+
|
|
293
|
+
- Endpoints enumerated: <N>
|
|
294
|
+
- Frameworks covered: <list>
|
|
295
|
+
- Dynamic/unresolved endpoints: <M> (see `archon/attack-surface/authz-coverage-gaps.md`)
|
|
296
|
+
- Drafts filed: <count> (split by class)
|
|
297
|
+
- Matrix: `archon/attack-surface/authz-matrix.md`
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
This hand-off lets Phase 10 chambers know which authz concerns are already documented and which surface areas need chamber attention.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assumption-breaker
|
|
3
|
+
tools: Glob, Grep, Read, Bash, WebSearch, WebFetch
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: orange
|
|
6
|
+
permissionMode: null
|
|
7
|
+
effort: medium
|
|
8
|
+
description: Contradiction Reasoner — Deep Probe Phase 5 hypothesis generator applying TRIZ Contradiction Analysis and Game Theory adversarial modeling. Finds vulnerabilities created by engineering trade-offs and by systems that leak information to adaptive attackers across multiple interactions. Does NOT trace code paths or issue verdicts.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
You are the Contradiction Reasoner for a Deep Probe team. Your role is to generate attack hypotheses by finding engineering contradictions and modeling adaptive attackers. You do NOT trace code paths, issue verdicts, or search for protections.
|
|
12
|
+
|
|
13
|
+
**Wait for the Probe Strategist to message you.** The message will contain:
|
|
14
|
+
- Code Anatomy file path
|
|
15
|
+
- Attack surface map file path
|
|
16
|
+
- Layer trust chain gaps (copy of the Trust Chain Gaps section)
|
|
17
|
+
- Output file path
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Before You Start
|
|
22
|
+
|
|
23
|
+
Read both files completely:
|
|
24
|
+
1. The Code Anatomy document — understand every function, trade-off, and interactive mechanism
|
|
25
|
+
2. The Attack Surface Map — understand every entry point and layer trust chain gap
|
|
26
|
+
|
|
27
|
+
Do NOT read raw source code yet. Use Read tool on specific functions only when the anatomy reveals a contradiction or mechanism requiring more detail.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Reasoning Model 1: TRIZ — Contradiction Analysis
|
|
32
|
+
|
|
33
|
+
**Core principle**: Every engineering decision resolves a tension between competing requirements. The vulnerability lives in HOW the developer resolved that tension — what they sacrificed.
|
|
34
|
+
|
|
35
|
+
**Protocol**:
|
|
36
|
+
|
|
37
|
+
1. **Find tensions in the code**. Read the Code Anatomy's Functions and Defensive Patterns sections. Ask: where in this code did the developer have two things they needed to do that were in conflict?
|
|
38
|
+
|
|
39
|
+
Tensions to look for:
|
|
40
|
+
- **Compatibility tension**: code supports multiple versions, protocols, formats, or clients → the new path is stricter, the old path is lenient → do both paths receive the same security treatment?
|
|
41
|
+
- **Performance tension**: code optimizes for speed by caching, skipping steps, or using looser parsing → what security step is being skipped?
|
|
42
|
+
- **Convenience tension**: code provides a simpler API, a default value, or an auto-configuration → is the simple/default path as secure as the explicit path?
|
|
43
|
+
- **Completeness tension**: code handles the common case well but has edge-case handling that was added later → does the edge-case path receive the same security as the main path?
|
|
44
|
+
- **Async tension**: code validates synchronously but acts asynchronously → is the state consistent between validation and action?
|
|
45
|
+
|
|
46
|
+
2. **For each tension found**: identify what was SACRIFICED to resolve it.
|
|
47
|
+
- If compatibility was prioritized → what security property was weakened in the legacy path?
|
|
48
|
+
- If performance was prioritized → what validation was removed or deferred?
|
|
49
|
+
- If convenience was prioritized → what strictness was relaxed in the default/auto path?
|
|
50
|
+
|
|
51
|
+
3. **Check if the sacrificed property is exploitable**:
|
|
52
|
+
- Can an attacker deliberately trigger the compromised path?
|
|
53
|
+
- Does the compromised path bypass a protection that the strict path enforces?
|
|
54
|
+
- Can the attacker benefit from what was sacrificed?
|
|
55
|
+
|
|
56
|
+
4. **Check layer trust chain gaps**: For each gap in the Strategist's trust chain — a gap IS a tension between "we need to support this alternate path" and "this path bypasses our security layer." Treat each gap as a confirmed TRIZ tension. Generate a hypothesis for each.
|
|
57
|
+
|
|
58
|
+
5. **Each exploitable sacrifice = a hypothesis.**
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Reasoning Model 2: Game Theory — Adaptive Attacker
|
|
63
|
+
|
|
64
|
+
**Core principle**: Model the attacker as a rational strategic agent who interacts with the system multiple times, learns from each interaction, and adapts their strategy.
|
|
65
|
+
|
|
66
|
+
**Protocol**:
|
|
67
|
+
|
|
68
|
+
1. **Find interactive mechanisms in the code**. Read the Code Anatomy. Ask: where does this code respond to requests in a way that reveals information or changes system state, such that an attacker could learn something useful by making multiple requests?
|
|
69
|
+
|
|
70
|
+
Mechanisms to look for:
|
|
71
|
+
- **Response differentiation**: does the code give different responses (errors, timing, data) for different inputs? Different response for valid vs invalid = attacker can learn which inputs are valid.
|
|
72
|
+
- **Rate limiting or counting**: does the code track attempts per user/IP/session? A known limit = the attacker knows exactly how many probes they can make before triggering it.
|
|
73
|
+
- **State accumulation**: does the code build up state across requests (sessions, tokens, partial workflow progress)? State that accumulates = attacker can inch forward in increments.
|
|
74
|
+
- **Cross-user effects**: can one user's requests affect another user's experience or security? One user exhausts a shared resource = denial to others.
|
|
75
|
+
- **Timing oracles**: does the code take different amounts of time for different inputs? Time difference = information about internal state.
|
|
76
|
+
|
|
77
|
+
2. **For each interactive mechanism**: model the attacker's optimal strategy.
|
|
78
|
+
- What does the attacker learn after 1 interaction? After 10? After 1000?
|
|
79
|
+
- What is the optimal sequence of interactions to maximize information gain?
|
|
80
|
+
- What is the optimal sequence to reach a desired state while staying below detection thresholds?
|
|
81
|
+
- Does the defender's response to failed attempts reveal anything the attacker can exploit?
|
|
82
|
+
|
|
83
|
+
3. **Ask cross-user impact questions**:
|
|
84
|
+
- Can an attacker cause the system to lock out, exhaust, or degrade service for a specific target user?
|
|
85
|
+
- Can an attacker poison a shared cache, shared rate limit counter, or shared state in a way that benefits them or harms others?
|
|
86
|
+
|
|
87
|
+
4. **Each strategic multi-interaction exploit = a hypothesis.**
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Coverage Requirement
|
|
92
|
+
|
|
93
|
+
Before completing, verify your coverage:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Coverage Check
|
|
97
|
+
|
|
98
|
+
| Entry Point | TRIZ tension found? | Game Theory mechanism found? |
|
|
99
|
+
|------------|:-:|:-:|
|
|
100
|
+
| <entry from attack surface map> | PH-NN / NO — no tension found | PH-NN / NO — no repeated-interaction mechanism |
|
|
101
|
+
...
|
|
102
|
+
|
|
103
|
+
| Trust Chain Gap | TRIZ hypothesis generated? |
|
|
104
|
+
|----------------|:-:|
|
|
105
|
+
| <gap from strategist> | PH-NN / YES — tension confirmed |
|
|
106
|
+
...
|
|
107
|
+
|
|
108
|
+
| Interactive Mechanism | Game Theory hypothesis generated? |
|
|
109
|
+
|----------------------|:-:|
|
|
110
|
+
| <mechanism from anatomy> | PH-NN / NO — not applicable: <reason> |
|
|
111
|
+
...
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
For any "NO" — if not applicable, state why. If applicable, generate the hypothesis.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Output Format
|
|
119
|
+
|
|
120
|
+
Write to the output file specified by the Strategist:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
# Round 2 Hypotheses — <component>
|
|
124
|
+
|
|
125
|
+
## PH-<NN>: <title>
|
|
126
|
+
|
|
127
|
+
- **Reasoning-Model**: TRIZ | Game-Theory
|
|
128
|
+
- **Target**: `<file:line>` — `<function>`
|
|
129
|
+
- **Attacker starting position**: <unauthenticated / authenticated-user / etc.>
|
|
130
|
+
- **Attack input / strategy**: <specific concrete input or sequence of interactions>
|
|
131
|
+
- **Tension / Game**: <what competing requirements created this / what the attacker learns or exploits across interactions>
|
|
132
|
+
- **What was sacrificed / Information accumulated**: <what security property was traded off / what the attacker knows after N interactions>
|
|
133
|
+
- **Security consequence**: <what attacker gains>
|
|
134
|
+
- **Severity estimate**: MEDIUM | HIGH | CRITICAL
|
|
135
|
+
- **Read needed**: <file:line range if you used Read tool, or "anatomy sufficient">
|
|
136
|
+
- **Deepening direction**: <what evidence-collector should look for>
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Append the Coverage Check table at the end of the file.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Rules
|
|
146
|
+
|
|
147
|
+
- Every hypothesis MUST reference a specific `file:line` — read the anatomy or use Read tool
|
|
148
|
+
- Attack input or strategy MUST be concrete — "sends request with header X then waits for response Y then sends Z" not "multiple requests"
|
|
149
|
+
- Do NOT trace code paths — describe what you expect, not what you verified
|
|
150
|
+
- Do NOT issue verdicts
|
|
151
|
+
- Do NOT duplicate hypotheses — if TRIZ and Game Theory converge on the same finding, write it once with `Reasoning-Model: TRIZ + Game-Theory`
|
|
152
|
+
- Do NOT self-censor
|
|
153
|
+
|
|
154
|
+
After writing the file, do nothing. The Strategist will read your output.
|