@tamsensedev/runner 0.13.0 → 0.19.0

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 (82) hide show
  1. package/LICENSE +5 -5
  2. package/README.md +76 -57
  3. package/dist/cli.js +757 -379
  4. package/dist/cli.js.map +1 -1
  5. package/dist/recorder.cjs.map +1 -1
  6. package/library/.claude-plugin/plugin.json +5 -5
  7. package/library/THIRD_PARTY_NOTICES.md +123 -123
  8. package/library/agents/code-architect.md +67 -67
  9. package/library/agents/code-explorer.md +61 -61
  10. package/library/agents/code-reviewer.md +73 -73
  11. package/library/agents/code-simplifier.md +62 -62
  12. package/library/agents/design-critic.md +52 -52
  13. package/library/agents/second-opinion.md +64 -64
  14. package/library/agents/security-auditor.md +86 -86
  15. package/library/agents/silent-failure-hunter.md +70 -70
  16. package/library/agents/test-coverage-analyzer.md +78 -78
  17. package/library/agents/test-runner.md +48 -48
  18. package/library/agents/ui-tester.md +50 -50
  19. package/library/licenses/Apache-2.0.txt +202 -202
  20. package/library/skills/accessibility/SKILL.md +144 -144
  21. package/library/skills/accessibility/references/wcag-checks.md +168 -168
  22. package/library/skills/addressing-review-feedback/SKILL.md +109 -109
  23. package/library/skills/app-screens/SKILL.md +96 -96
  24. package/library/skills/app-screens/references/shell-kpis-charts.md +108 -108
  25. package/library/skills/app-screens/references/states-density-phone.md +54 -54
  26. package/library/skills/app-screens/references/tables-forms-settings.md +104 -104
  27. package/library/skills/avoiding-generic-ai-design/SKILL.md +92 -92
  28. package/library/skills/avoiding-generic-ai-design/references/tells.md +112 -112
  29. package/library/skills/clean-commits/SKILL.md +85 -85
  30. package/library/skills/design-review/SKILL.md +107 -107
  31. package/library/skills/design-review/references/critique-passes.md +101 -101
  32. package/library/skills/design-review/references/screenshot-procedure.md +121 -121
  33. package/library/skills/differential-security-review/LICENSE +427 -427
  34. package/library/skills/differential-security-review/SKILL.md +105 -105
  35. package/library/skills/differential-security-review/references/adversarial.md +115 -115
  36. package/library/skills/differential-security-review/references/methodology.md +145 -145
  37. package/library/skills/differential-security-review/references/patterns.md +108 -108
  38. package/library/skills/false-positive-check/LICENSE +427 -427
  39. package/library/skills/false-positive-check/SKILL.md +95 -95
  40. package/library/skills/false-positive-check/references/bug-class-verification.md +128 -128
  41. package/library/skills/false-positive-check/references/deep-verification.md +113 -113
  42. package/library/skills/false-positive-check/references/evidence-templates.md +93 -93
  43. package/library/skills/false-positive-check/references/false-positive-patterns.md +122 -122
  44. package/library/skills/false-positive-check/references/gate-reviews.md +36 -36
  45. package/library/skills/false-positive-check/references/standard-verification.md +80 -80
  46. package/library/skills/focused-implementation/SKILL.md +104 -104
  47. package/library/skills/implementation-plan/SKILL.md +66 -66
  48. package/library/skills/interface-design/SKILL.md +144 -144
  49. package/library/skills/interface-design/references/craft-defaults.md +130 -130
  50. package/library/skills/interface-design/references/new-direction.md +62 -62
  51. package/library/skills/interface-design/references/writing.md +52 -52
  52. package/library/skills/interface-polish/SKILL.md +103 -103
  53. package/library/skills/interface-polish/references/detail-rules.md +154 -154
  54. package/library/skills/interface-polish/references/worst-case-data.md +158 -158
  55. package/library/skills/motion-design/SKILL.md +106 -106
  56. package/library/skills/motion-design/references/recipes.md +243 -243
  57. package/library/skills/postgres-performance/SKILL.md +97 -97
  58. package/library/skills/postgres-performance/references/rules.md +265 -265
  59. package/library/skills/project-orientation/SKILL.md +77 -77
  60. package/library/skills/reviewing-changes/SKILL.md +183 -183
  61. package/library/skills/safe-database-changes/SKILL.md +111 -111
  62. package/library/skills/safe-database-changes/references/backfills.md +75 -75
  63. package/library/skills/safe-database-changes/references/migration-tools.md +69 -69
  64. package/library/skills/safe-database-changes/references/postgres-ddl.md +199 -199
  65. package/library/skills/security-review/SKILL.md +132 -132
  66. package/library/skills/security-review/references/checks-by-area.md +107 -107
  67. package/library/skills/security-review/references/do-not-report.md +86 -86
  68. package/library/skills/spec-writing/SKILL.md +144 -144
  69. package/library/skills/systematic-debugging/SKILL.md +130 -130
  70. package/library/skills/systematic-debugging/references/flaky-tests.md +51 -51
  71. package/library/skills/systematic-debugging/references/root-cause-tracing.md +55 -55
  72. package/library/skills/task-interview/SKILL.md +84 -84
  73. package/library/skills/test-driven-development/SKILL.md +116 -116
  74. package/library/skills/test-driven-development/references/writing-good-tests.md +85 -85
  75. package/library/skills/ui-testing/SKILL.md +102 -102
  76. package/library/skills/ui-testing/references/headless-check.md +295 -295
  77. package/library/skills/ui-testing/references/local-stand.md +51 -51
  78. package/library/skills/ui-testing/references/playwright-patterns.md +134 -134
  79. package/library/skills/ui-testing/references/recording.md +61 -61
  80. package/library/skills/verification-before-completion/SKILL.md +113 -113
  81. package/library/skills/web-interface-guidelines/SKILL.md +202 -202
  82. package/package.json +46 -46
@@ -1,113 +1,113 @@
1
- # Deep Verification
2
-
3
- Full verification for complex bugs. Use when routing in SKILL.md selects the deep path, or when standard verification escalates.
4
-
5
- ## If Escalated from Standard
6
-
7
- 1. Review all evidence gathered during the standard pass; do not repeat completed work.
8
- 2. Identify which phases below are already satisfied by existing evidence.
9
- 3. Continue from where standard verification left off.
10
- 4. Keep and reference all prior findings.
11
-
12
- ## Phases
13
-
14
- Work through the phases in order for each bug (Bug #N). Keep a checklist in your notes and mark a phase done only when you have concrete evidence for it. Sub-steps within a phase are independent; do them in any order, but never start a phase before the one it depends on is complete. If the bug path is large, you may hand a phase's data-flow tracing to the `code-explorer` agent, with the bug description and prior evidence in the prompt; you still judge the result.
15
-
16
- ```
17
- Phase 1: Data flow analysis
18
- 1.1 Map trust boundaries and trace data flow
19
- 1.2 Research API contracts and safety guarantees
20
- 1.3 Environment protection analysis
21
- 1.4 Cross-reference analysis
22
- Phase 2: Exploitability verification (after phase 1)
23
- 2.1 Confirm attacker controls input data
24
- 2.2 Mathematical bounds verification (or N/A)
25
- 2.3 Race condition feasibility proof (or N/A)
26
- 2.4 Adversarial analysis (after 2.1 to 2.3)
27
- Phase 3: Impact assessment (after phase 2)
28
- 3.1 Demonstrate real security impact
29
- 3.2 Primary control vs defense in depth
30
- Phase 4: PoC creation (after phase 3)
31
- 4.1 Pseudocode PoC with data flow diagram
32
- 4.2 Executable PoC if feasible
33
- 4.3 Unit test PoC if feasible
34
- 4.4 Negative PoC: exploit preconditions
35
- 4.5 Verify the PoC demonstrates the vulnerability
36
- Phase 5: Devil's advocate review (after phase 4)
37
- Gate review (after phase 5)
38
- ```
39
-
40
- Apply all 13 checklist items from [false-positive-patterns.md](false-positive-patterns.md) to each bug.
41
-
42
- ## Phase Requirements
43
-
44
- The list above names every phase. Below are the key pitfalls and decision criteria for each: focus on what you might get wrong.
45
-
46
- ### Phase 1: Data Flow Analysis
47
-
48
- **1.1**: Map trust boundaries (internal/trusted vs external/untrusted) and trace data from source to the alleged vulnerability. Apply class-specific verification from [bug-class-verification.md](bug-class-verification.md). **Key pitfall**: analyzing code in isolation without tracing the full validation chain. Conditional logic upstream may make the vulnerable code mathematically unreachable (see [false-positive-patterns.md](false-positive-patterns.md) items 1 and 1a).
49
-
50
- **1.2**: Check API contracts before claiming overflows or injections: many APIs have built-in protection (bounds checks, parameter binding, escaping) that prevents the alleged issue regardless of inputs.
51
-
52
- **1.3**: Before concluding vulnerability, verify that no compiler, runtime, OS, or framework protection prevents exploitation. Mitigations like ASLR and stack canaries raise the bar but do not eliminate the vulnerability itself. Distinguish "prevents exploitation entirely" (Rust's safe type system, parameterized queries, framework auto-escaping) from "makes exploitation harder" (ASLR, a WAF).
53
-
54
- **1.4**: Check whether similar code patterns exist elsewhere and are handled safely. Review test coverage, code review history (`git log -p`), and design documentation for this area.
55
-
56
- ### Phase 2: Exploitability Verification
57
-
58
- **2.1**: Prove the attacker controls the data reaching the vulnerability. **Key pitfall**: assuming external data reaches the operation without tracing the actual path. Internal storage set by trusted components is not attacker-controlled.
59
-
60
- **2.2**: Create explicit algebraic proofs for bounds-related issues. Use the template in [evidence-templates.md](evidence-templates.md). Verify: IF validation_check_passes THEN bounds_guarantee_holds. Mark N/A when the bug is not about bounds or arithmetic.
61
-
62
- **2.3**: For race conditions, prove concurrent access is actually possible (two requests, two workers, two processes). **Key pitfall**: assuming races in single-threaded initialization or in code already serialized by a lock, transaction or unique constraint. Mark N/A when no concurrency is involved.
63
-
64
- **2.4**: Assess the full attack surface: input control, validation bypass paths, timing dependencies, and state manipulation.
65
-
66
- ### Phase 3: Impact Assessment
67
-
68
- **3.1**: Distinguish real security impact (code execution, privilege escalation, information disclosure, unauthorized data changes, money loss) from operational robustness issues.
69
-
70
- **3.2**: Distinguish primary security controls from defense in depth. Failure of a defense-in-depth measure is not a vulnerability if primary protections remain intact.
71
-
72
- ### Phase 4: PoC Creation
73
-
74
- **Always create a pseudocode PoC.** Create executable and/or unit test PoCs when feasible and allowed:
75
-
76
- 1. **Pseudocode with data flow diagram** showing the attack path (always).
77
- 2. **Executable PoC** in the target language (if feasible). In review and test steps it runs only from a temp directory outside the repository, never against live services or production data, and is deleted afterwards.
78
- 3. **Unit test PoC** exercising the vulnerable path with crafted inputs (if feasible). Same rule: never add it to the repository under review. In a code or bugfix step it may become the regression test.
79
-
80
- See [evidence-templates.md](evidence-templates.md) for templates.
81
-
82
- **Negative PoC (4.4)**: show the gap between normal operation and the exploit path: which preconditions must hold for the vulnerability to trigger, and why they do not hold under normal conditions.
83
-
84
- ### Phase 5: Devil's Advocate Review
85
-
86
- Before the verdict, challenge the claim systematically. Assume you are biased toward finding bugs and rating them as critical, and work against that bias.
87
-
88
- **Challenges arguing AGAINST the vulnerability:**
89
-
90
- 1. What non-vulnerability explanations exist for this code pattern?
91
- 2. How would the original developers justify this implementation?
92
- 3. What crucial system architecture context might be missing?
93
- 4. Am I seeing a vulnerability because the pattern "looks dangerous" rather than because it actually is?
94
- 5. Even if validation looks insufficient, does it actually prevent the claimed condition?
95
- 6. Am I incorrectly assuming attacker control over trusted data?
96
- 7. Have I rigorously proven the mathematical condition for vulnerability can occur?
97
- 8. Beyond theoretical possibility, is this practically exploitable?
98
- 9. Am I confusing defense-in-depth failure with a primary security vulnerability?
99
- 10. What compiler, runtime, OS or framework protections might prevent exploitation?
100
- 11. Am I hallucinating this vulnerability? LLMs are biased toward seeing bugs everywhere and rating every finding as critical. Is this a real, exploitable issue, or am I pattern-matching on scary-looking code?
101
-
102
- **Challenges arguing FOR the vulnerability (false-negative protection):**
103
-
104
- 12. Am I dismissing a real vulnerability because the exploit seems complex or unlikely?
105
- 13. Am I inventing mitigations or validation logic that I have not verified in the actual source code? Re-read the code after reaching a conclusion.
106
-
107
- See [evidence-templates.md](evidence-templates.md) for the documentation template.
108
-
109
- ## Gate Review
110
-
111
- Apply the six gates from [gate-reviews.md](gate-reviews.md) to reach a verdict.
112
-
113
- Part of the `false-positive-check` skill, adapted from https://github.com/trailofbits/skills/tree/main/plugins/fp-check (commit 5c99c03fb8a9ea568432ecbcba5d86e9f4ac2bf0), CC BY-SA 4.0. Changed: task tracking and plugin agents replaced by an in-order checklist (optionally the `code-explorer` agent), read-only rules for proofs of concept, N/A rules for 2.2 and 2.3, web examples of environment protections and impact.
1
+ # Deep Verification
2
+
3
+ Full verification for complex bugs. Use when routing in SKILL.md selects the deep path, or when standard verification escalates.
4
+
5
+ ## If Escalated from Standard
6
+
7
+ 1. Review all evidence gathered during the standard pass; do not repeat completed work.
8
+ 2. Identify which phases below are already satisfied by existing evidence.
9
+ 3. Continue from where standard verification left off.
10
+ 4. Keep and reference all prior findings.
11
+
12
+ ## Phases
13
+
14
+ Work through the phases in order for each bug (Bug #N). Keep a checklist in your notes and mark a phase done only when you have concrete evidence for it. Sub-steps within a phase are independent; do them in any order, but never start a phase before the one it depends on is complete. If the bug path is large, you may hand a phase's data-flow tracing to the `code-explorer` agent, with the bug description and prior evidence in the prompt; you still judge the result.
15
+
16
+ ```
17
+ Phase 1: Data flow analysis
18
+ 1.1 Map trust boundaries and trace data flow
19
+ 1.2 Research API contracts and safety guarantees
20
+ 1.3 Environment protection analysis
21
+ 1.4 Cross-reference analysis
22
+ Phase 2: Exploitability verification (after phase 1)
23
+ 2.1 Confirm attacker controls input data
24
+ 2.2 Mathematical bounds verification (or N/A)
25
+ 2.3 Race condition feasibility proof (or N/A)
26
+ 2.4 Adversarial analysis (after 2.1 to 2.3)
27
+ Phase 3: Impact assessment (after phase 2)
28
+ 3.1 Demonstrate real security impact
29
+ 3.2 Primary control vs defense in depth
30
+ Phase 4: PoC creation (after phase 3)
31
+ 4.1 Pseudocode PoC with data flow diagram
32
+ 4.2 Executable PoC if feasible
33
+ 4.3 Unit test PoC if feasible
34
+ 4.4 Negative PoC: exploit preconditions
35
+ 4.5 Verify the PoC demonstrates the vulnerability
36
+ Phase 5: Devil's advocate review (after phase 4)
37
+ Gate review (after phase 5)
38
+ ```
39
+
40
+ Apply all 13 checklist items from [false-positive-patterns.md](false-positive-patterns.md) to each bug.
41
+
42
+ ## Phase Requirements
43
+
44
+ The list above names every phase. Below are the key pitfalls and decision criteria for each: focus on what you might get wrong.
45
+
46
+ ### Phase 1: Data Flow Analysis
47
+
48
+ **1.1**: Map trust boundaries (internal/trusted vs external/untrusted) and trace data from source to the alleged vulnerability. Apply class-specific verification from [bug-class-verification.md](bug-class-verification.md). **Key pitfall**: analyzing code in isolation without tracing the full validation chain. Conditional logic upstream may make the vulnerable code mathematically unreachable (see [false-positive-patterns.md](false-positive-patterns.md) items 1 and 1a).
49
+
50
+ **1.2**: Check API contracts before claiming overflows or injections: many APIs have built-in protection (bounds checks, parameter binding, escaping) that prevents the alleged issue regardless of inputs.
51
+
52
+ **1.3**: Before concluding vulnerability, verify that no compiler, runtime, OS, or framework protection prevents exploitation. Mitigations like ASLR and stack canaries raise the bar but do not eliminate the vulnerability itself. Distinguish "prevents exploitation entirely" (Rust's safe type system, parameterized queries, framework auto-escaping) from "makes exploitation harder" (ASLR, a WAF).
53
+
54
+ **1.4**: Check whether similar code patterns exist elsewhere and are handled safely. Review test coverage, code review history (`git log -p`), and design documentation for this area.
55
+
56
+ ### Phase 2: Exploitability Verification
57
+
58
+ **2.1**: Prove the attacker controls the data reaching the vulnerability. **Key pitfall**: assuming external data reaches the operation without tracing the actual path. Internal storage set by trusted components is not attacker-controlled.
59
+
60
+ **2.2**: Create explicit algebraic proofs for bounds-related issues. Use the template in [evidence-templates.md](evidence-templates.md). Verify: IF validation_check_passes THEN bounds_guarantee_holds. Mark N/A when the bug is not about bounds or arithmetic.
61
+
62
+ **2.3**: For race conditions, prove concurrent access is actually possible (two requests, two workers, two processes). **Key pitfall**: assuming races in single-threaded initialization or in code already serialized by a lock, transaction or unique constraint. Mark N/A when no concurrency is involved.
63
+
64
+ **2.4**: Assess the full attack surface: input control, validation bypass paths, timing dependencies, and state manipulation.
65
+
66
+ ### Phase 3: Impact Assessment
67
+
68
+ **3.1**: Distinguish real security impact (code execution, privilege escalation, information disclosure, unauthorized data changes, money loss) from operational robustness issues.
69
+
70
+ **3.2**: Distinguish primary security controls from defense in depth. Failure of a defense-in-depth measure is not a vulnerability if primary protections remain intact.
71
+
72
+ ### Phase 4: PoC Creation
73
+
74
+ **Always create a pseudocode PoC.** Create executable and/or unit test PoCs when feasible and allowed:
75
+
76
+ 1. **Pseudocode with data flow diagram** showing the attack path (always).
77
+ 2. **Executable PoC** in the target language (if feasible). In review and test steps it runs only from a temp directory outside the repository, never against live services or production data, and is deleted afterwards.
78
+ 3. **Unit test PoC** exercising the vulnerable path with crafted inputs (if feasible). Same rule: never add it to the repository under review. In a code or bugfix step it may become the regression test.
79
+
80
+ See [evidence-templates.md](evidence-templates.md) for templates.
81
+
82
+ **Negative PoC (4.4)**: show the gap between normal operation and the exploit path: which preconditions must hold for the vulnerability to trigger, and why they do not hold under normal conditions.
83
+
84
+ ### Phase 5: Devil's Advocate Review
85
+
86
+ Before the verdict, challenge the claim systematically. Assume you are biased toward finding bugs and rating them as critical, and work against that bias.
87
+
88
+ **Challenges arguing AGAINST the vulnerability:**
89
+
90
+ 1. What non-vulnerability explanations exist for this code pattern?
91
+ 2. How would the original developers justify this implementation?
92
+ 3. What crucial system architecture context might be missing?
93
+ 4. Am I seeing a vulnerability because the pattern "looks dangerous" rather than because it actually is?
94
+ 5. Even if validation looks insufficient, does it actually prevent the claimed condition?
95
+ 6. Am I incorrectly assuming attacker control over trusted data?
96
+ 7. Have I rigorously proven the mathematical condition for vulnerability can occur?
97
+ 8. Beyond theoretical possibility, is this practically exploitable?
98
+ 9. Am I confusing defense-in-depth failure with a primary security vulnerability?
99
+ 10. What compiler, runtime, OS or framework protections might prevent exploitation?
100
+ 11. Am I hallucinating this vulnerability? LLMs are biased toward seeing bugs everywhere and rating every finding as critical. Is this a real, exploitable issue, or am I pattern-matching on scary-looking code?
101
+
102
+ **Challenges arguing FOR the vulnerability (false-negative protection):**
103
+
104
+ 12. Am I dismissing a real vulnerability because the exploit seems complex or unlikely?
105
+ 13. Am I inventing mitigations or validation logic that I have not verified in the actual source code? Re-read the code after reaching a conclusion.
106
+
107
+ See [evidence-templates.md](evidence-templates.md) for the documentation template.
108
+
109
+ ## Gate Review
110
+
111
+ Apply the six gates from [gate-reviews.md](gate-reviews.md) to reach a verdict.
112
+
113
+ Part of the `false-positive-check` skill, adapted from https://github.com/trailofbits/skills/tree/main/plugins/fp-check (commit 5c99c03fb8a9ea568432ecbcba5d86e9f4ac2bf0), CC BY-SA 4.0. Changed: task tracking and plugin agents replaced by an in-order checklist (optionally the `code-explorer` agent), read-only rules for proofs of concept, N/A rules for 2.2 and 2.3, web examples of environment protections and impact.
@@ -1,93 +1,93 @@
1
- # Evidence Templates
2
-
3
- Use these templates when documenting verification evidence for each bug.
4
-
5
- ## Data Flow Documentation
6
-
7
- ```
8
- Bug #N Data Flow Analysis
9
- Source: [exact location] - Trust Level: [trusted/untrusted]
10
- Path: Source → Validation1[file:line] → Transform[file:line] → Vulnerability[file:line]
11
- Validation Points:
12
- - Check1: [condition] at [file:line] - [passes/fails/bypassed]
13
- - Check2: [condition] at [file:line] - [passes/fails/bypassed]
14
- ```
15
-
16
- ## Mathematical Bounds Proof
17
-
18
- ```
19
- Bug #N Mathematical Analysis
20
- Claim: Operation X is vulnerable to [overflow/underflow/bounds violation]
21
- Given Constraints: [list all validation conditions]
22
-
23
- Algebraic Proof:
24
- 1. [first constraint from validation]
25
- 2. [constant or known value]
26
- 3. [derived inequality]
27
- ...
28
- N. Therefore: [vulnerability confirmed/debunked] (Q.E.D.)
29
-
30
- Conclusion: [vulnerability is/is not mathematically possible]
31
- ```
32
-
33
- **Example:**
34
-
35
- ```
36
- Given: validation ensures (input_size >= MIN_SIZE)
37
- Given: MIN_SIZE = 16, header_size = 8
38
- Prove: (input_size - header_size) cannot underflow
39
-
40
- 1. input_size >= MIN_SIZE (from validation)
41
- 2. MIN_SIZE = 16 (constant)
42
- 3. header_size = 8 (constant)
43
- 4. input_size >= 16 (substitution of 1,2)
44
- 5. input_size - 8 >= 16 - 8 (subtract header_size from both sides)
45
- 6. input_size - header_size >= 8 (simplification)
46
- 7. Therefore: underflow impossible (Q.E.D.)
47
- ```
48
-
49
- ## Attacker Control Analysis
50
-
51
- ```
52
- Bug #N Attacker Control Analysis
53
- Input Vector: [how attacker provides input]
54
- Control Level: [full/partial/none]
55
- Constraints: [what limits exist on attacker input]
56
- Reachability: [can attacker-controlled data reach vulnerable operation?]
57
- ```
58
-
59
- ## PoC - Pseudocode with Data Flow Diagram
60
-
61
- ```
62
- PoC for Bug #N: [Brief Description]
63
-
64
- Data Flow Diagram:
65
-
66
- [External Input] → [Validation Point] → [Processing] → [Vulnerable Operation]
67
- | | | |
68
- Attacker (May be bypassed) (Transforms data) (Unsafe operation)
69
- Controlled | | |
70
- | v v v
71
- [Malicious Data] → [Insufficient Check] → [Processed Data] → [Impact]
72
-
73
- PSEUDOCODE:
74
- function vulnerable_operation(user_data):
75
- validation_result = weak_validation(user_data) // Explain why this fails
76
- processed_data = transform_data(user_data) // Show transformation
77
- unsafe_operation(processed_data) // Show vulnerability trigger
78
- ```
79
-
80
- ## Devil's Advocate Review
81
-
82
- ```
83
- Bug #N Devil's Advocate Review
84
- Vulnerability Claim: [brief description]
85
-
86
- For each devil's advocate question (7 in standard verification, 13 in deep verification), document your answer:
87
- Questions against the vulnerability: [answers]
88
- Questions for the vulnerability (false-negative protection): [answers]
89
-
90
- Final Assessment: [Vulnerability confirmed/debunked with reasoning]
91
- ```
92
-
93
- Part of the `false-positive-check` skill, adapted from https://github.com/trailofbits/skills/tree/main/plugins/fp-check (commit 5c99c03fb8a9ea568432ecbcba5d86e9f4ac2bf0), CC BY-SA 4.0. Changed: punctuation and small wording changes for read-only runs.
1
+ # Evidence Templates
2
+
3
+ Use these templates when documenting verification evidence for each bug.
4
+
5
+ ## Data Flow Documentation
6
+
7
+ ```
8
+ Bug #N Data Flow Analysis
9
+ Source: [exact location] - Trust Level: [trusted/untrusted]
10
+ Path: Source → Validation1[file:line] → Transform[file:line] → Vulnerability[file:line]
11
+ Validation Points:
12
+ - Check1: [condition] at [file:line] - [passes/fails/bypassed]
13
+ - Check2: [condition] at [file:line] - [passes/fails/bypassed]
14
+ ```
15
+
16
+ ## Mathematical Bounds Proof
17
+
18
+ ```
19
+ Bug #N Mathematical Analysis
20
+ Claim: Operation X is vulnerable to [overflow/underflow/bounds violation]
21
+ Given Constraints: [list all validation conditions]
22
+
23
+ Algebraic Proof:
24
+ 1. [first constraint from validation]
25
+ 2. [constant or known value]
26
+ 3. [derived inequality]
27
+ ...
28
+ N. Therefore: [vulnerability confirmed/debunked] (Q.E.D.)
29
+
30
+ Conclusion: [vulnerability is/is not mathematically possible]
31
+ ```
32
+
33
+ **Example:**
34
+
35
+ ```
36
+ Given: validation ensures (input_size >= MIN_SIZE)
37
+ Given: MIN_SIZE = 16, header_size = 8
38
+ Prove: (input_size - header_size) cannot underflow
39
+
40
+ 1. input_size >= MIN_SIZE (from validation)
41
+ 2. MIN_SIZE = 16 (constant)
42
+ 3. header_size = 8 (constant)
43
+ 4. input_size >= 16 (substitution of 1,2)
44
+ 5. input_size - 8 >= 16 - 8 (subtract header_size from both sides)
45
+ 6. input_size - header_size >= 8 (simplification)
46
+ 7. Therefore: underflow impossible (Q.E.D.)
47
+ ```
48
+
49
+ ## Attacker Control Analysis
50
+
51
+ ```
52
+ Bug #N Attacker Control Analysis
53
+ Input Vector: [how attacker provides input]
54
+ Control Level: [full/partial/none]
55
+ Constraints: [what limits exist on attacker input]
56
+ Reachability: [can attacker-controlled data reach vulnerable operation?]
57
+ ```
58
+
59
+ ## PoC - Pseudocode with Data Flow Diagram
60
+
61
+ ```
62
+ PoC for Bug #N: [Brief Description]
63
+
64
+ Data Flow Diagram:
65
+
66
+ [External Input] → [Validation Point] → [Processing] → [Vulnerable Operation]
67
+ | | | |
68
+ Attacker (May be bypassed) (Transforms data) (Unsafe operation)
69
+ Controlled | | |
70
+ | v v v
71
+ [Malicious Data] → [Insufficient Check] → [Processed Data] → [Impact]
72
+
73
+ PSEUDOCODE:
74
+ function vulnerable_operation(user_data):
75
+ validation_result = weak_validation(user_data) // Explain why this fails
76
+ processed_data = transform_data(user_data) // Show transformation
77
+ unsafe_operation(processed_data) // Show vulnerability trigger
78
+ ```
79
+
80
+ ## Devil's Advocate Review
81
+
82
+ ```
83
+ Bug #N Devil's Advocate Review
84
+ Vulnerability Claim: [brief description]
85
+
86
+ For each devil's advocate question (7 in standard verification, 13 in deep verification), document your answer:
87
+ Questions against the vulnerability: [answers]
88
+ Questions for the vulnerability (false-negative protection): [answers]
89
+
90
+ Final Assessment: [Vulnerability confirmed/debunked with reasoning]
91
+ ```
92
+
93
+ Part of the `false-positive-check` skill, adapted from https://github.com/trailofbits/skills/tree/main/plugins/fp-check (commit 5c99c03fb8a9ea568432ecbcba5d86e9f4ac2bf0), CC BY-SA 4.0. Changed: punctuation and small wording changes for read-only runs.