@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,721 @@
1
+ # Business Logic Flaw Analysis Methodology
2
+
3
+ > Distilled from 8,292 cases | Data source: WooYun Vulnerability Database (2010-2016)
4
+
5
+ ---
6
+
7
+ ## 1. Core Insight: The Nature of Business Logic Flaws
8
+
9
+ ### 1.1 Root Cause Analysis Matrix
10
+
11
+ | Level | Defect Type | Typical Manifestation | Detection Difficulty |
12
+ |-------|------------|----------------------|---------------------|
13
+ | **Business layer** | Process design flaws | Steps can be skipped, states can be forged | High |
14
+ | **Interface layer** | Excessive parameter trust | Client-side validation, no server-side verification | Medium |
15
+ | **Authentication layer** | Credential management flaws | Token leakage, session fixation | Medium |
16
+ | **Authorization layer** | Blurred permission boundaries | Horizontal/Vertical Privilege Escalation | High |
17
+
18
+ ### 1.2 Attack Surface Mapping
19
+
20
+ ```
21
+ User Input -> Frontend Validation (bypassable) -> Network Transport (interceptable) -> Backend Processing (core)
22
+ | | |
23
+ Client-side parameter tampering Man-in-the-middle/replay Server-side logic flaws
24
+ ```
25
+
26
+ ---
27
+
28
+ ## 2. Password Reset Vulnerabilities [22 Cases]
29
+
30
+ ### 2.1 Vulnerability Pattern Classification
31
+
32
+ #### Pattern A: Verification Code Leaked in Response
33
+ **Cases: Parking platform APP, community platform, telecom webmail service**
34
+
35
+ ```
36
+ Attack Flow:
37
+ 1. Request verification code -> Intercept response
38
+ 2. Response contains verification code in plaintext
39
+ 3. Complete verification without receiving the SMS
40
+ ```
41
+
42
+ **Detection Method:**
43
+ ```http
44
+ POST /sendSmsCode HTTP/1.1
45
+ phone=13888888888
46
+
47
+ # Check response:
48
+ {"code":0,"data":{"verifyCode":"123456"}} <- Leak point
49
+ ```
50
+
51
+ #### Pattern B: Verification Code Not Bound to User
52
+ **Case: Accounting APP (affecting 80 million users)**
53
+
54
+ ```
55
+ Vulnerability Logic:
56
+ 1. Register with your own phone number, receive verification code A
57
+ 2. Initiate password reset for target account
58
+ 3. Use verification code A to complete verification <- Not bound to user identity
59
+ ```
60
+
61
+ **Root Cause:** Verification code only checks validity, not user ownership
62
+
63
+ #### Pattern C: Reset Steps Can Be Skipped
64
+ **Cases: Outdoor goods store, medical Q&A site**
65
+
66
+ ```
67
+ Normal Flow: Enter account -> Identity verification -> Reset password -> Complete
68
+ Attack Flow: Enter account -> [Skip verification] -> Directly access reset page
69
+
70
+ Technical Implementation:
71
+ 1. Analyze frontend JS logic, find URLs for each step
72
+ 2. Directly access Step 3 URL
73
+ 3. Frontend hidden DOM element replacement method:
74
+ - F12 to find the "Reset Password" step HTML
75
+ - Overlay it on the current "Identity Verification" step DOM
76
+ ```
77
+
78
+ #### Pattern D: Controllable Credential Parameters
79
+ **Cases: Digital magazine platform, electric scooter manufacturer**
80
+
81
+ ```http
82
+ POST /resetPassword HTTP/1.1
83
+ username=victim&newPassword=hacked123
84
+
85
+ # Vulnerability: username parameter comes from client, can be tampered
86
+ ```
87
+
88
+ **Testing Checklist:**
89
+ - [ ] Does the reset request contain a user identifier
90
+ - [ ] Can the identifier be modified
91
+ - [ ] Does modification affect other users
92
+
93
+ ### 2.2 General Testing Framework
94
+
95
+ ```mermaid
96
+ graph TD
97
+ A[Initiate password reset] --> B{Capture and analyze response}
98
+ B -->|Contains verification code| C[Verification code leak vulnerability]
99
+ B -->|Does not contain| D{Analyze verification flow}
100
+ D -->|Multi-step| E[Attempt to skip intermediate steps]
101
+ D -->|Single-step| F{Check parameter binding}
102
+ F -->|User ID controllable| G[Parameter tampering test]
103
+ F -->|Bound to session| H[Session fixation test]
104
+ ```
105
+
106
+ ---
107
+
108
+ ## 3. Authorization Bypass Vulnerabilities [22 Cases]
109
+
110
+ ### 3.1 Horizontal Privilege Escalation (IDOR)
111
+
112
+ #### Typical Scenario: ID Enumeration
113
+ **Cases: Car rental service, adult products store (200K+ users)**
114
+
115
+ ```http
116
+ # Normal request
117
+ GET /address/edit/?addid=100001 -> Own address
118
+
119
+ # Privilege escalation request
120
+ GET /address/edit/?addid=100002 -> Another user's address
121
+ GET /address/edit/?addid=1 -> Enumerate all users
122
+ ```
123
+
124
+ **Automated Detection Script Approach:**
125
+ ```python
126
+ def idor_test(base_url, param_name, id_range):
127
+ for id in range(id_range[0], id_range[1]):
128
+ resp = requests.get(f"{base_url}?{param_name}={id}")
129
+ if "sensitive_data_indicator" in resp.text:
130
+ print(f"[!] IDOR Found: {param_name}={id}")
131
+ ```
132
+
133
+ #### Typical Scenario: Resource Replacement Attack
134
+ **Case: Car rental service invoice unauthorized deletion**
135
+
136
+ ```
137
+ Vulnerability Logic:
138
+ 1. Account A creates invoice, ID=1001
139
+ 2. Account B modifies own invoice, replaces ID with 1001
140
+ 3. System executes UPDATE operation, Account A's invoice is overwritten/deleted
141
+
142
+ Attack Vector: Modification operation lacks ownership verification
143
+ ```
144
+
145
+ ### 3.2 Vertical Privilege Escalation
146
+
147
+ #### Typical Scenario: Role Escalation
148
+ **Case: Provincial news platform system**
149
+
150
+ ```http
151
+ # Regular user modifying profile
152
+ POST /updateUser HTTP/1.1
153
+ user.aid=3&user.name=test # aid=3 is regular user
154
+
155
+ # Privilege escalation
156
+ POST /updateUser HTTP/1.1
157
+ user.aid=1&user.name=test # aid=1 is super admin
158
+ ```
159
+
160
+ **Detection Key Points:**
161
+ 1. Enumerate role IDs: Typically 1=super admin, 2=admin, 3+=regular user
162
+ 2. Test role switching: Modify role identifier in request
163
+ 3. Verify permission changes: Refresh and check menu/functionality changes
164
+
165
+ ### 3.3 Authorization Bypass Testing Matrix
166
+
167
+ | Operation Type | Testing Method | Risk Level |
168
+ |---------------|---------------|-----------|
169
+ | View | Replace resource ID | Medium |
170
+ | Modify | Replace resource ID + data | High |
171
+ | Delete | Replace resource ID | Critical |
172
+ | Create | Replace owner user ID | High |
173
+
174
+ ---
175
+
176
+ ## 4. CAPTCHA/Verification Code Bypass Vulnerabilities [20 Cases]
177
+
178
+ ### 4.1 Verification Code Not Refreshed
179
+
180
+ **Cases: Municipal housing fund system, IoT platform**
181
+
182
+ ```
183
+ Vulnerability Manifestation:
184
+ - CAPTCHA does not auto-refresh after login failure
185
+ - Same CAPTCHA can be reused
186
+ - Only frontend triggers refresh, backend does not force update
187
+ ```
188
+
189
+ **Exploitation Method:**
190
+ ```python
191
+ # Fixed CAPTCHA brute force
192
+ captcha = "ABCD" # Manually recognize once
193
+ for password in wordlist:
194
+ resp = login(username, password, captcha)
195
+ if "success" in resp:
196
+ print(f"Password: {password}")
197
+ ```
198
+
199
+ ### 4.2 Verification Code Brute Force
200
+
201
+ **Case: Brand store APP (5-digit numeric verification code)**
202
+
203
+ ```
204
+ Parameter Analysis:
205
+ - Verification code length: 4-6 digits
206
+ - Brute force space: 10,000-1,000,000
207
+ - Rate limiting: None
208
+
209
+ Brute Force Configuration:
210
+ - Threads: 30-50
211
+ - Dictionary: 00000-99999
212
+ - Duration: ~30 seconds to complete
213
+ ```
214
+
215
+ ### 4.3 Credential Stuffing Attacks
216
+
217
+ **Cases: Online service provider, smartphone manufacturer**
218
+
219
+ ```
220
+ Prerequisites:
221
+ 1. Login endpoint has no CAPTCHA / CAPTCHA is bypassable
222
+ 2. No login rate limiting
223
+ 3. Leaked credential databases exist
224
+
225
+ Attack Flow:
226
+ 1. Obtain leaked database (e.g., manufacturer forum 80K weak passwords)
227
+ 2. Batch test against target website
228
+ 3. Success rate typically 0.1%-5%
229
+ ```
230
+
231
+ ### 4.4 Verification Code Security Checklist
232
+
233
+ - [ ] Is the verification code leaked in the response
234
+ - [ ] Is the verification code bound to session/user
235
+ - [ ] Does the verification code have a time limit (recommended: 60 seconds)
236
+ - [ ] Is a new code forced after verification failure
237
+ - [ ] Is there rate limiting (recommended: 5 attempts/minute)
238
+ - [ ] Is the code complexity sufficient (recommended: 6+ alphanumeric characters)
239
+
240
+ ---
241
+
242
+ ## 5. Payment Logic Vulnerabilities [9 Cases]
243
+
244
+ ### 5.1 Amount Tampering
245
+
246
+ **Cases: Talent assessment platform, novelty goods store**
247
+
248
+ ```http
249
+ # Original request
250
+ POST /pay HTTP/1.1
251
+ item=test_service&price=500&count=1
252
+
253
+ # Tampered request
254
+ POST /pay HTTP/1.1
255
+ item=test_service&price=0.01&count=1
256
+ ```
257
+
258
+ **Detection Points:**
259
+ 1. Amount parameter during order creation
260
+ 2. Amount parameter during payment redirect
261
+ 3. Amount verification during payment callback
262
+
263
+ ### 5.2 Coupon/Discount Abuse
264
+
265
+ **Case: E-commerce platform discount logic flaw**
266
+
267
+ ```
268
+ Vulnerability Flow:
269
+ 1. Purchase item A (59 CNY), qualifying for "spend 59, add 5.9 to get item B"
270
+ 2. Place order containing A and B, pay 59+5.9=64.9 CNY
271
+ 3. Cancel item A, keep only B
272
+ 4. Effectively purchase item B (original price 21 CNY) for 5.9 CNY
273
+ ```
274
+
275
+ **Testing Approach:**
276
+ - Partial cancellation after combined ordering
277
+ - Return after coupon usage
278
+ - Refund after points redemption
279
+
280
+ ### 5.3 Virtual Currency Farming
281
+
282
+ **Case: Smartphone manufacturer rewards store**
283
+
284
+ ```
285
+ Vulnerability: Registration referral earns points
286
+ Attack:
287
+ 1. Discover phone verification code is 4 digits
288
+ 2. Brute force verification code to complete registration
289
+ 3. Automated script for mass registration
290
+ 4. Redeem points for physical goods
291
+ ```
292
+
293
+ ### 5.4 Order Price Parameter Tampering
294
+
295
+ **Case: E-commerce platform price logic flaw (wooyun-2015-0108817)**
296
+
297
+ ```
298
+ Root Cause: Trusting client-submitted price parameters
299
+ Severity: High
300
+ Attack Method: Directly modify the price parameter in the order creation API
301
+ ```
302
+
303
+ **Vulnerability Analysis:**
304
+
305
+ Normal order flow should follow:
306
+ ```
307
+ [Select Product] -> [Generate Order] -> [Server Calculates Price] -> [User Pays]
308
+ ```
309
+
310
+ Vulnerable flow:
311
+ ```
312
+ [Select Product] -> [Generate Order] -> [Client Submits Price] -> [Server Does Not Verify] -> [Pay Any Price]
313
+ ```
314
+
315
+ **Attack Vectors:**
316
+ ```http
317
+ # Normal request
318
+ POST /order/create HTTP/1.1
319
+ {
320
+ "productId": "12345",
321
+ "quantity": 1,
322
+ "price": 299.00 <- Original price
323
+ }
324
+
325
+ # Malicious request
326
+ POST /order/create HTTP/1.1
327
+ {
328
+ "productId": "12345",
329
+ "quantity": 1,
330
+ "price": 0.01 <- Tampered to 0.01
331
+ }
332
+ ```
333
+
334
+ **Root Cause Analysis - Deep Dive:**
335
+
336
+ 1. **Design-Level Flaw**
337
+ - Violates the "server-side authority" principle
338
+ - Price calculation logic pushed down to the client
339
+ - No secondary price verification mechanism implemented
340
+
341
+ 2. **Trust Boundary Error**
342
+ ```
343
+ Security Model: Untrusted zone (client) -> Trust boundary -> Trusted zone (server)
344
+ Incorrect Implementation: Directly accepts sensitive data from untrusted zone as fact
345
+ Correct Implementation: Untrusted zone only provides product ID; server independently calculates price
346
+ ```
347
+
348
+ 3. **Business Logic Layering Failure**
349
+ ```
350
+ Presentation Layer: Display product price (tamperable)
351
+ Business Layer: Calculate order amount (should be independent)
352
+ Data Layer: Store transaction records (should verify)
353
+ ```
354
+
355
+ **Systematic Testing Methodology:**
356
+
357
+ ```
358
+ Phase 1: Parameter Fingerprinting
359
+ +-- Capture order creation API
360
+ +-- Identify price-related parameters (price/amount/total/cost)
361
+ +-- Determine parameter types (integer/float/string)
362
+
363
+ Phase 2: Boundary Value Testing
364
+ +-- Minimum value test (0, 0.01, -1)
365
+ +-- Negative number test (-100, -0.01)
366
+ +-- Format test (scientific notation, nested JSON)
367
+ +-- Precision test (float overflow, rounding errors)
368
+
369
+ Phase 3: Logic Bypass Testing
370
+ +-- Parameter redundancy: Submit multiple price parameters
371
+ +-- Parameter override: Raise price then lower it
372
+ +-- Batch orders: Unit price tampering
373
+ +-- Coupon stacking: Price + discount double manipulation
374
+
375
+ Phase 4: Impact Verification
376
+ +-- Order generation: Check order amount
377
+ +-- Payment gateway: Verify payment amount
378
+ +-- Shipping: Test if shipping proceeds normally
379
+ +-- Refund flow: Check refund amount
380
+ ```
381
+
382
+ **Advanced Exploitation Techniques:**
383
+
384
+ 1. **Price Parameter Tampering + Race Condition**
385
+ ```python
386
+ import threading
387
+
388
+ def create_order():
389
+ # Concurrently create multiple low-price orders
390
+ requests.post("/order/create", json={
391
+ "price": 0.01,
392
+ "productId": "premium_item"
393
+ })
394
+
395
+ threads = [threading.Thread(target=create_order) for _ in range(50)]
396
+ for t in threads:
397
+ t.start()
398
+ ```
399
+
400
+ 2. **Parameter Pollution Technique**
401
+ ```http
402
+ # Some frameworks process duplicate parameters
403
+ POST /order/create?price=299.00&price=0.01
404
+
405
+ # Or array parameters
406
+ POST /order/create
407
+ price[]=299.00&price[]=0.01
408
+ ```
409
+
410
+ 3. **Type Conversion Bypass**
411
+ ```json
412
+ {
413
+ "price": "0.01", // String
414
+ "price": 1e-10, // Scientific notation
415
+ "price": {"$gt": 0}, // MongoDB injection
416
+ "price": null // NULL injection
417
+ }
418
+ ```
419
+
420
+ **Detection Checklist:**
421
+
422
+ | Test Item | Expected Behavior | Actual Check |
423
+ |-----------|-------------------|-------------|
424
+ | Server-side price calculation | Query database by product ID | Order amount = inventory price x quantity |
425
+ | Client-side price validation | Ignore submitted price | Used for display reference only |
426
+ | Price signature verification | Order parameter signing | Anti-tampering mechanism |
427
+ | Payment amount comparison | Callback amount = order amount | Third-party payment verification |
428
+ | Abnormal price interception | Reject on price anomaly | Below cost / above list price |
429
+
430
+ **Remediation Recommendations:**
431
+
432
+ ```python
433
+ # Secure implementation example
434
+ def create_order(user_id, product_id, quantity):
435
+ # 1. Get product price from database (server-side authority)
436
+ product = db.query("SELECT price FROM products WHERE id = ?", product_id)
437
+ if not product:
438
+ raise Exception("Product does not exist")
439
+
440
+ # 2. Server-side order amount calculation
441
+ order_amount = product.price * quantity
442
+
443
+ # 3. Record original and calculated prices for auditing
444
+ order = {
445
+ "user_id": user_id,
446
+ "product_id": product_id,
447
+ "quantity": quantity,
448
+ "unit_price": product.price,
449
+ "total_amount": order_amount,
450
+ "price_source": "server_calculation" # Tag price source
451
+ }
452
+
453
+ # 4. Generate order signature (anti-tampering)
454
+ order["signature"] = hmac_sha256(
455
+ f"{order_amount}{product_id}{quantity}",
456
+ SECRET_KEY
457
+ )
458
+
459
+ return db.insert("orders", order)
460
+
461
+ # Payment callback verification
462
+ def payment_callback(order_id, paid_amount, signature):
463
+ order = db.get_order(order_id)
464
+
465
+ # Strictly verify payment amount matches order amount
466
+ if order["total_amount"] != paid_amount:
467
+ raise Exception("Payment amount mismatch")
468
+
469
+ # Verify signature
470
+ if not verify_signature(signature, order):
471
+ raise Exception("Signature verification failed")
472
+
473
+ # Update order status
474
+ order["status"] = "paid"
475
+ order["paid_amount"] = paid_amount
476
+ db.update(order)
477
+ ```
478
+
479
+ **Defense-in-Depth Strategy:**
480
+
481
+ ```
482
+ Layer 1: Input Validation
483
+ +-- Allowlist validation: Only accept product ID, do not accept price parameters
484
+ +-- Type validation: Amount must be positive, max 2 decimal places
485
+
486
+ Layer 2: Business Logic
487
+ +-- Server-side calculation: All prices recalculated on server
488
+ +-- Price traceability: Record price calculation process
489
+ +-- Anomaly detection: Manual review when price deviation exceeds threshold
490
+
491
+ Layer 3: Data Integrity
492
+ +-- Order signing: Prevent parameter tampering
493
+ +-- Timestamps: Prevent replay attacks
494
+ +-- Idempotency: Prevent duplicate submissions
495
+
496
+ Layer 4: Payment Verification
497
+ +-- Callback verification: Verify payment amount matches order amount
498
+ +-- State machine: Strictly control order state transitions
499
+ +-- Audit logs: Record all price changes
500
+ ```
501
+
502
+ ### 5.5 Payment Flow Integrity Testing
503
+
504
+ ```mermaid
505
+ graph LR
506
+ A[Select Product] --> B[Generate Order]
507
+ B --> C[Select Payment]
508
+ C --> D[Third-Party Payment]
509
+ D --> E[Payment Callback]
510
+ E --> F[Order Complete]
511
+
512
+ B -.->|Tamper amount| X1[Vuln Point 1: Price parameter]
513
+ C -.->|Tamper amount| X2[Vuln Point 2: Payment parameter]
514
+ E -.->|Forge callback| X3[Vuln Point 3: Callback signature]
515
+ F -.->|Tamper state| X4[Vuln Point 4: State machine]
516
+ ```
517
+
518
+ ---
519
+
520
+ ## 6. Authentication Bypass [15 Cases]
521
+
522
+ ### 6.1 Cookie/Session Forgery
523
+
524
+ **Case: Gaming company platform**
525
+
526
+ ```
527
+ Vulnerable Endpoint:
528
+ GET /registeruser/CookInsert?userAccount=admin&inner=1
529
+
530
+ Function: Writes user identity to cookie
531
+ Exploitation: Specify any username to obtain that user's session
532
+ ```
533
+
534
+ ### 6.2 IP Spoofing
535
+
536
+ **Case: Web hosting control panel**
537
+
538
+ ```http
539
+ # Add spoofed headers
540
+ X-Forwarded-For: [IP redacted]
541
+ X-Real-IP: [IP redacted]
542
+ Client-IP: [IP redacted]
543
+
544
+ Risk: Bypass IP allowlists, forge login logs
545
+ ```
546
+
547
+ ### 6.3 Response Tampering Bypass
548
+
549
+ **Cases: Pharmacy APP, P2P finance platform**
550
+
551
+ ```
552
+ Normal Flow:
553
+ Request verification -> Response {"status":"0","msg":"Verification code error"} -> Stay on verification page
554
+
555
+ Attack Flow:
556
+ Request verification -> Intercept response -> Modify to {"status":"1","msg":"Success"} -> Proceed to next step
557
+ ```
558
+
559
+ **Applicable Conditions:**
560
+ - Client controls flow based on response status
561
+ - Server does not re-verify state in subsequent steps
562
+
563
+ ### 6.4 Authentication Bypass Testing Checklist
564
+
565
+ | Test Item | Method | Tool |
566
+ |-----------|--------|------|
567
+ | Cookie forgery | Modify user identifier field | BurpSuite |
568
+ | Session fixation | Reuse another user's session | Wireshark |
569
+ | Response tampering | Modify return status code | BurpSuite |
570
+ | IP spoofing | Add X-Forwarded-For | Curl |
571
+ | Frontend bypass | Modify JS logic | Browser DevTools |
572
+
573
+ ---
574
+
575
+ ## 7. Advanced Testing Methodology
576
+
577
+ ### 7.1 Business Flow Reverse Analysis
578
+
579
+ ```
580
+ Step 1: Map the complete business flow
581
+ Step 2: Identify validation checkpoints at each stage
582
+ Step 3: Assess whether validations can be bypassed
583
+ Step 4: Design bypass test cases
584
+ ```
585
+
586
+ **Example: Password Reset Flow Analysis**
587
+
588
+ ```
589
+ [Enter Account] -> [Send Verification Code] -> [Verify Identity] -> [Set New Password]
590
+ | | | |
591
+ Account enumeration Code leakage Step skipping Parameter tampering
592
+ ```
593
+
594
+ ### 7.2 Systematic Parameter Tampering Method
595
+
596
+ | Parameter Type | Tampering Direction | Example |
597
+ |---------------|-------------------|---------|
598
+ | User ID | Replace with another user | uid=1001 -> uid=1002 |
599
+ | Amount | Reduce/zero/negative | price=100 -> price=0.01 |
600
+ | Quantity | Increase/negative | count=1 -> count=-1 |
601
+ | Status | Flip boolean value | isPaid=false -> isPaid=true |
602
+ | Role | Escalate privilege | role=user -> role=admin |
603
+ | Time | Extend/rewind | expireTime=... -> expireTime=2099-... |
604
+
605
+ ### 7.3 Race Condition Exploitation
606
+
607
+ **Scenario: Points Redemption**
608
+
609
+ ```python
610
+ import threading
611
+ import requests
612
+
613
+ def redeem():
614
+ requests.post("/redeem", data={"points": 1000, "item": "iPhone"})
615
+
616
+ # Concurrent requests attempting multiple redemptions
617
+ threads = [threading.Thread(target=redeem) for _ in range(100)]
618
+ for t in threads:
619
+ t.start()
620
+ ```
621
+
622
+ **Applicable Scenarios:**
623
+ - Coupon usage
624
+ - Points redemption
625
+ - Inventory deduction
626
+ - Balance payments
627
+
628
+ ### 7.4 Systematic Testing Framework
629
+
630
+ ```
631
+ Phase 1: Intelligence Gathering
632
+ +-- Enumerate all functionality points
633
+ +-- Map business flow diagrams
634
+ +-- Identify sensitive operations
635
+
636
+ Phase 2: Threat Modeling
637
+ +-- Analyze input parameters for each endpoint
638
+ +-- Assess parameter controllability
639
+ +-- Build attack trees
640
+
641
+ Phase 3: Vulnerability Verification
642
+ +-- Test by priority
643
+ +-- Record PoCs
644
+ +-- Assess impact scope
645
+
646
+ Phase 4: Report Output
647
+ +-- Vulnerability description
648
+ +-- Reproduction steps
649
+ +-- Remediation recommendations
650
+ +-- Risk rating
651
+ ```
652
+
653
+ ---
654
+
655
+ ## 8. Defense Recommendations Quick Reference
656
+
657
+ ### 8.1 Password Reset
658
+
659
+ - Bind verification code to user session
660
+ - One-time use + time limit for verification codes
661
+ - Reset tokens are single-use
662
+ - Server-side state verification throughout the entire flow
663
+
664
+ ### 8.2 Authorization Bypass
665
+
666
+ - Verify ownership before resource access
667
+ - Use UUIDs instead of auto-incrementing IDs
668
+ - Log audit trails for sensitive operations
669
+ - Implement principle of least privilege
670
+
671
+ ### 8.3 Payment Security
672
+
673
+ - Amounts calculated server-side
674
+ - Order signing to prevent tampering
675
+ - Secondary verification on payment callbacks
676
+ - Idempotent transaction design
677
+
678
+ ### 8.4 Verification Codes
679
+
680
+ - 6-character alphanumeric mix
681
+ - 60-second expiration
682
+ - Lock after 5 failed attempts
683
+ - Force refresh after verification failure
684
+
685
+ ---
686
+
687
+ ## 9. Recommended Tools
688
+
689
+ | Tool | Purpose | Scenario |
690
+ |------|---------|----------|
691
+ | BurpSuite | Traffic interception and tampering | All scenarios |
692
+ | Postman | API testing | Endpoint testing |
693
+ | SQLMap | Injection detection | Database |
694
+ | Hydra | Brute forcing | Weak credentials |
695
+ | OWASP ZAP | Automated scanning | Initial screening |
696
+
697
+ ---
698
+
699
+ ## 10. Reference Case Index
700
+
701
+ | Vulnerability Type | Representative Case | WooYun ID |
702
+ |-------------------|-------------------|-----------|
703
+ | Verification code leak in response | Parking platform APP | wooyun-2015-0134914 |
704
+ | Password reset step skipping | Outdoor goods store | wooyun-2014-054890 |
705
+ | Horizontal Privilege Escalation (IDOR) | Adult products store | wooyun-2015-0119942 |
706
+ | Vertical Privilege Escalation | Provincial news platform | wooyun-2015-099378 |
707
+ | Amount tampering | Talent assessment platform | wooyun-2012-07745 |
708
+ | Price parameter tampering | E-commerce platform | wooyun-2015-0108817 |
709
+ | Coupon abuse | E-commerce discount logic | wooyun-2015-0XXXXXX |
710
+ | Virtual currency farming | Smartphone manufacturer rewards store | wooyun-2015-0XXXXXX |
711
+ | Credential stuffing | Smartphone manufacturer | wooyun-2014-061871 |
712
+ | Cookie forgery | Gaming company platform | wooyun-2015-0157092 |
713
+ | Response tampering | Pharmacy APP | wooyun-2015-0139590 |
714
+
715
+ ---
716
+
717
+ *Document version: v1.1*
718
+ *Data source: WooYun vulnerability database (88,636 entries)*
719
+ *Analysis sample: Design defect/logic error category (8,292 entries)*
720
+ *Generated: 2026-01-23*
721
+ *Latest update: Added price parameter tampering vulnerability deep analysis (wooyun-2015-0108817)*