@securecode-ai/mcp 0.5.4 → 0.5.6

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 (188) hide show
  1. package/dist/api/types.d.ts +7 -0
  2. package/dist/approval/auditLog.d.ts +1 -1
  3. package/dist/approval/auditLog.js +11 -3
  4. package/dist/approval/auditLog.js.map +1 -1
  5. package/dist/approval/broker.d.ts +7 -2
  6. package/dist/approval/broker.js +239 -110
  7. package/dist/approval/broker.js.map +1 -1
  8. package/dist/approval/policy.d.ts +10 -0
  9. package/dist/approval/policy.js +104 -0
  10. package/dist/approval/policy.js.map +1 -0
  11. package/dist/approval/types.d.ts +11 -2
  12. package/dist/approval/types.js +10 -1
  13. package/dist/approval/types.js.map +1 -1
  14. package/dist/attack/agentScanExecutor.d.ts +35 -1
  15. package/dist/attack/agentScanExecutor.js +405 -76
  16. package/dist/attack/agentScanExecutor.js.map +1 -1
  17. package/dist/attack/agentScanLoop.d.ts +20 -0
  18. package/dist/attack/agentScanLoop.js +1264 -60
  19. package/dist/attack/agentScanLoop.js.map +1 -1
  20. package/dist/attack/agentScanProtocol.d.ts +382 -6
  21. package/dist/attack/agentScanProtocol.js +110 -4
  22. package/dist/attack/agentScanProtocol.js.map +1 -1
  23. package/dist/attack/agentTrace.d.ts +73 -0
  24. package/dist/attack/agentTrace.js +228 -0
  25. package/dist/attack/agentTrace.js.map +1 -0
  26. package/dist/attack/architectureScoutExecutor.d.ts +18 -0
  27. package/dist/attack/architectureScoutExecutor.js +211 -0
  28. package/dist/attack/architectureScoutExecutor.js.map +1 -0
  29. package/dist/attack/architectureScoutLoop.d.ts +36 -0
  30. package/dist/attack/architectureScoutLoop.js +403 -0
  31. package/dist/attack/architectureScoutLoop.js.map +1 -0
  32. package/dist/attack/architectureScoutProtocol.d.ts +209 -0
  33. package/dist/attack/architectureScoutProtocol.js +47 -0
  34. package/dist/attack/architectureScoutProtocol.js.map +1 -0
  35. package/dist/attack/candidateStore.d.ts +95 -0
  36. package/dist/attack/candidateStore.js +231 -0
  37. package/dist/attack/candidateStore.js.map +1 -0
  38. package/dist/attack/evidenceLedger.d.ts +67 -0
  39. package/dist/attack/evidenceLedger.js +192 -0
  40. package/dist/attack/evidenceLedger.js.map +1 -0
  41. package/dist/attack/finishGate.d.ts +62 -0
  42. package/dist/attack/finishGate.js +209 -0
  43. package/dist/attack/finishGate.js.map +1 -0
  44. package/dist/attack/fixCodeMerge.d.ts +27 -0
  45. package/dist/attack/fixCodeMerge.js +42 -0
  46. package/dist/attack/fixCodeMerge.js.map +1 -0
  47. package/dist/attack/fixVerifyLoop.d.ts +55 -0
  48. package/dist/attack/fixVerifyLoop.js +187 -0
  49. package/dist/attack/fixVerifyLoop.js.map +1 -0
  50. package/dist/attack/investigationProfiles.d.ts +36 -0
  51. package/dist/attack/investigationProfiles.js +144 -0
  52. package/dist/attack/investigationProfiles.js.map +1 -0
  53. package/dist/attack/investigationState.d.ts +227 -0
  54. package/dist/attack/investigationState.js +666 -0
  55. package/dist/attack/investigationState.js.map +1 -0
  56. package/dist/attack/mutationOperators.d.ts +22 -0
  57. package/dist/attack/mutationOperators.js +170 -0
  58. package/dist/attack/mutationOperators.js.map +1 -0
  59. package/dist/attack/mutationTest.d.ts +33 -0
  60. package/dist/attack/mutationTest.js +110 -0
  61. package/dist/attack/mutationTest.js.map +1 -0
  62. package/dist/attack/proofGate.d.ts +20 -0
  63. package/dist/attack/proofGate.js +104 -0
  64. package/dist/attack/proofGate.js.map +1 -0
  65. package/dist/attack/proofTypes.d.ts +57 -0
  66. package/dist/attack/proofTypes.js +32 -0
  67. package/dist/attack/proofTypes.js.map +1 -0
  68. package/dist/attack/protocolValidator.d.ts +50 -0
  69. package/dist/attack/protocolValidator.js +427 -0
  70. package/dist/attack/protocolValidator.js.map +1 -0
  71. package/dist/attack/qualityMetrics.d.ts +133 -0
  72. package/dist/attack/qualityMetrics.js +226 -0
  73. package/dist/attack/qualityMetrics.js.map +1 -0
  74. package/dist/attack/scanScheduler.d.ts +52 -0
  75. package/dist/attack/scanScheduler.js +265 -0
  76. package/dist/attack/scanScheduler.js.map +1 -0
  77. package/dist/attack/scanState.d.ts +58 -0
  78. package/dist/attack/scanState.js +102 -0
  79. package/dist/attack/scanState.js.map +1 -0
  80. package/dist/attack/searchIntent.d.ts +16 -0
  81. package/dist/attack/searchIntent.js +57 -0
  82. package/dist/attack/searchIntent.js.map +1 -0
  83. package/dist/attack/verifyLoop.d.ts +43 -0
  84. package/dist/attack/verifyLoop.js +329 -15
  85. package/dist/attack/verifyLoop.js.map +1 -1
  86. package/dist/attack/workItem.d.ts +57 -0
  87. package/dist/attack/workItem.js +225 -0
  88. package/dist/attack/workItem.js.map +1 -0
  89. package/dist/audit/findingReviewQueue.d.ts +109 -0
  90. package/dist/audit/findingReviewQueue.js +335 -0
  91. package/dist/audit/findingReviewQueue.js.map +1 -0
  92. package/dist/audit/scanAuditLog.d.ts +160 -0
  93. package/dist/audit/scanAuditLog.js +404 -0
  94. package/dist/audit/scanAuditLog.js.map +1 -0
  95. package/dist/dependency/dependencyChecker.js +35 -9
  96. package/dist/dependency/dependencyChecker.js.map +1 -1
  97. package/dist/dependency/exploitPriority.d.ts +33 -0
  98. package/dist/dependency/exploitPriority.js +78 -0
  99. package/dist/dependency/exploitPriority.js.map +1 -0
  100. package/dist/dependency/finding.d.ts +16 -0
  101. package/dist/dependency/osvClient.js +2 -0
  102. package/dist/dependency/osvClient.js.map +1 -1
  103. package/dist/dependency/types.d.ts +12 -1
  104. package/dist/mcp/server.js +13 -2
  105. package/dist/mcp/server.js.map +1 -1
  106. package/dist/mcp/tools.d.ts +1 -0
  107. package/dist/mcp/tools.js +127 -6
  108. package/dist/mcp/tools.js.map +1 -1
  109. package/dist/project-map/agentMemory.d.ts +83 -1
  110. package/dist/project-map/agentMemory.js +197 -7
  111. package/dist/project-map/agentMemory.js.map +1 -1
  112. package/dist/project-map/architectureContext.d.ts +202 -0
  113. package/dist/project-map/architectureContext.js +421 -0
  114. package/dist/project-map/architectureContext.js.map +1 -0
  115. package/dist/project-map/blastRadius.d.ts +54 -0
  116. package/dist/project-map/blastRadius.js +196 -0
  117. package/dist/project-map/blastRadius.js.map +1 -0
  118. package/dist/project-map/callGraphExtractor.d.ts +13 -0
  119. package/dist/project-map/callGraphExtractor.js +222 -0
  120. package/dist/project-map/callGraphExtractor.js.map +1 -0
  121. package/dist/project-map/capabilityRegistry.d.ts +46 -0
  122. package/dist/project-map/capabilityRegistry.js +91 -0
  123. package/dist/project-map/capabilityRegistry.js.map +1 -0
  124. package/dist/project-map/findTests.d.ts +29 -0
  125. package/dist/project-map/findTests.js +236 -0
  126. package/dist/project-map/findTests.js.map +1 -0
  127. package/dist/project-map/handlerInventory.d.ts +112 -0
  128. package/dist/project-map/handlerInventory.js +184 -0
  129. package/dist/project-map/handlerInventory.js.map +1 -0
  130. package/dist/project-map/implementationResolver.d.ts +43 -0
  131. package/dist/project-map/implementationResolver.js +217 -0
  132. package/dist/project-map/implementationResolver.js.map +1 -0
  133. package/dist/project-map/mapContext.d.ts +6 -1
  134. package/dist/project-map/mapContext.js +1 -0
  135. package/dist/project-map/mapContext.js.map +1 -1
  136. package/dist/project-map/scanCache.d.ts +57 -3
  137. package/dist/project-map/scanCache.js +61 -2
  138. package/dist/project-map/scanCache.js.map +1 -1
  139. package/dist/project-map/symbolIndex.d.ts +39 -0
  140. package/dist/project-map/symbolIndex.js +385 -0
  141. package/dist/project-map/symbolIndex.js.map +1 -0
  142. package/dist/tooling/agentEvalScoring.d.ts +77 -0
  143. package/dist/tooling/agentEvalScoring.js +140 -0
  144. package/dist/tooling/agentEvalScoring.js.map +1 -0
  145. package/dist/tooling/agentRegression.d.ts +53 -0
  146. package/dist/tooling/agentRegression.js +99 -0
  147. package/dist/tooling/agentRegression.js.map +1 -0
  148. package/dist/tools/agentScan.d.ts +69 -0
  149. package/dist/tools/agentScan.js +702 -43
  150. package/dist/tools/agentScan.js.map +1 -1
  151. package/dist/tools/findingReviewTools.d.ts +22 -0
  152. package/dist/tools/findingReviewTools.js +121 -0
  153. package/dist/tools/findingReviewTools.js.map +1 -0
  154. package/dist/tools/fix.js +1 -1
  155. package/dist/tools/fix.js.map +1 -1
  156. package/dist/tools/map.js +191 -1
  157. package/dist/tools/map.js.map +1 -1
  158. package/dist/tools/runTests.d.ts +2 -0
  159. package/dist/tools/runTests.js +29 -0
  160. package/dist/tools/runTests.js.map +1 -0
  161. package/dist/utils/effectMock.d.ts +1 -0
  162. package/dist/utils/effectMock.js +162 -0
  163. package/dist/utils/effectMock.js.map +1 -0
  164. package/dist/utils/gitContext.d.ts +26 -0
  165. package/dist/utils/gitContext.js +317 -0
  166. package/dist/utils/gitContext.js.map +1 -0
  167. package/dist/utils/localTestRunner.d.ts +57 -2
  168. package/dist/utils/localTestRunner.js +122 -101
  169. package/dist/utils/localTestRunner.js.map +1 -1
  170. package/dist/utils/runtimeDetect.d.ts +12 -2
  171. package/dist/utils/runtimeDetect.js +247 -10
  172. package/dist/utils/runtimeDetect.js.map +1 -1
  173. package/dist/utils/securityConfig.d.ts +17 -0
  174. package/dist/utils/securityConfig.js +192 -0
  175. package/dist/utils/securityConfig.js.map +1 -0
  176. package/dist/utils/testCommandPolicy.d.ts +36 -0
  177. package/dist/utils/testCommandPolicy.js +252 -0
  178. package/dist/utils/testCommandPolicy.js.map +1 -0
  179. package/dist/utils/testRunner.d.ts +56 -0
  180. package/dist/utils/testRunner.js +246 -0
  181. package/dist/utils/testRunner.js.map +1 -0
  182. package/dist/utils/testSafety.d.ts +40 -2
  183. package/dist/utils/testSafety.js +205 -26
  184. package/dist/utils/testSafety.js.map +1 -1
  185. package/dist/utils/verificationSandbox.d.ts +113 -0
  186. package/dist/utils/verificationSandbox.js +656 -0
  187. package/dist/utils/verificationSandbox.js.map +1 -0
  188. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Fix verification loop — re-runs the exploit verification against the
3
+ * proposed fixed code to prove the fix actually closed the vulnerability.
4
+ *
5
+ * After the fixer generates `fixed_code` + `replace_range`, we:
6
+ * 1. Merge the fixed code into the original file (in memory).
7
+ * 2. Run local syntax validation (if available).
8
+ * 3. Call /verify/generate with the FIXED code and the same vulnerability context.
9
+ * 4. Execute the generated test in the existing sandbox.
10
+ * 5. Call /verify/analyze.
11
+ * 6. Compare the original and fixed verdicts to determine if the fix closed the issue.
12
+ *
13
+ * Closure semantics (conservative by default):
14
+ * - Original PROVEN + Fixed UNPROVEN → closed
15
+ * - Original PROVEN + Fixed PROVEN → still-vulnerable
16
+ * - Original PROVEN + Fixed INCONCLUSIVE → inconclusive
17
+ * - Anything else → inconclusive (don't claim closure without proof)
18
+ *
19
+ * The loop uses a SEPARATE, smaller budget (FIX_VERIFY_DEFAULTS) so a single
20
+ * fix verification cannot consume the entire original scan verification budget.
21
+ */
22
+ import type { ApiClient } from '../api/client';
23
+ import { VerifyBudgetTracker, defaultFixVerifyBudget, type VerifyBudget, type FixVerificationStatus } from './agentScanProtocol';
24
+ import { mergeFixedCode, type ReplaceRange } from './fixCodeMerge';
25
+ import { type VerifyFinding } from './verifyLoop';
26
+ export interface FixVerifyLoopOptions {
27
+ finding: VerifyFinding;
28
+ originalCode: string;
29
+ fixedCode: string;
30
+ replaceRange: ReplaceRange;
31
+ filePath: string;
32
+ relatedFiles: Array<{
33
+ filePath: string;
34
+ content: string;
35
+ relationship: string;
36
+ }>;
37
+ workspaceRoot: string;
38
+ language: string;
39
+ client: ApiClient;
40
+ originalVerdict: 'PROVEN' | 'UNPROVEN' | 'INCONCLUSIVE' | 'SKIPPED';
41
+ signal?: AbortSignal;
42
+ budgetTracker?: VerifyBudgetTracker;
43
+ onProgress?: (round: number, maxRounds: number, message: string) => void;
44
+ }
45
+ export interface FixVerifyLoopResult {
46
+ status: FixVerificationStatus;
47
+ reason: string;
48
+ originalVerdict: 'PROVEN' | 'UNPROVEN' | 'INCONCLUSIVE' | 'SKIPPED';
49
+ fixedVerdict?: 'PROVEN' | 'UNPROVEN' | 'INCONCLUSIVE';
50
+ roundsUsed: number;
51
+ fixedCodeHash: string;
52
+ testOutput?: string;
53
+ }
54
+ export declare function runFixVerifyLoop(opts: FixVerifyLoopOptions): Promise<FixVerifyLoopResult>;
55
+ export { mergeFixedCode, defaultFixVerifyBudget, type VerifyBudget };
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ /**
3
+ * Fix verification loop — re-runs the exploit verification against the
4
+ * proposed fixed code to prove the fix actually closed the vulnerability.
5
+ *
6
+ * After the fixer generates `fixed_code` + `replace_range`, we:
7
+ * 1. Merge the fixed code into the original file (in memory).
8
+ * 2. Run local syntax validation (if available).
9
+ * 3. Call /verify/generate with the FIXED code and the same vulnerability context.
10
+ * 4. Execute the generated test in the existing sandbox.
11
+ * 5. Call /verify/analyze.
12
+ * 6. Compare the original and fixed verdicts to determine if the fix closed the issue.
13
+ *
14
+ * Closure semantics (conservative by default):
15
+ * - Original PROVEN + Fixed UNPROVEN → closed
16
+ * - Original PROVEN + Fixed PROVEN → still-vulnerable
17
+ * - Original PROVEN + Fixed INCONCLUSIVE → inconclusive
18
+ * - Anything else → inconclusive (don't claim closure without proof)
19
+ *
20
+ * The loop uses a SEPARATE, smaller budget (FIX_VERIFY_DEFAULTS) so a single
21
+ * fix verification cannot consume the entire original scan verification budget.
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.defaultFixVerifyBudget = exports.mergeFixedCode = void 0;
58
+ exports.runFixVerifyLoop = runFixVerifyLoop;
59
+ const crypto = __importStar(require("crypto"));
60
+ const agentScanProtocol_1 = require("./agentScanProtocol");
61
+ Object.defineProperty(exports, "defaultFixVerifyBudget", { enumerable: true, get: function () { return agentScanProtocol_1.defaultFixVerifyBudget; } });
62
+ const fixCodeMerge_1 = require("./fixCodeMerge");
63
+ Object.defineProperty(exports, "mergeFixedCode", { enumerable: true, get: function () { return fixCodeMerge_1.mergeFixedCode; } });
64
+ const verifyLoop_1 = require("./verifyLoop");
65
+ const PER_FIX_MAX_ROUNDS = 3;
66
+ async function runFixVerifyLoop(opts) {
67
+ const fixedCodeHash = crypto.createHash('sha256').update(opts.fixedCode).digest('hex').slice(0, 16);
68
+ // 1. Merge the fixed code into the original file.
69
+ const mergeResult = (0, fixCodeMerge_1.mergeFixedCode)(opts.originalCode, opts.fixedCode, opts.replaceRange);
70
+ if (!mergeResult.ok) {
71
+ return {
72
+ status: 'syntax-invalid',
73
+ reason: `Fixed code merge failed: ${mergeResult.error}`,
74
+ originalVerdict: opts.originalVerdict,
75
+ roundsUsed: 0,
76
+ fixedCodeHash,
77
+ };
78
+ }
79
+ const mergedCode = mergeResult.mergedCode;
80
+ // 2. Use a dedicated fix verification budget if none provided.
81
+ const tracker = opts.budgetTracker ?? new agentScanProtocol_1.VerifyBudgetTracker((0, agentScanProtocol_1.defaultFixVerifyBudget)());
82
+ // 3. Abort check.
83
+ if (opts.signal?.aborted) {
84
+ return {
85
+ status: 'cancelled',
86
+ reason: 'Fix verification cancelled by user before starting.',
87
+ originalVerdict: opts.originalVerdict,
88
+ roundsUsed: 0,
89
+ fixedCodeHash,
90
+ };
91
+ }
92
+ // 4. Run the verify loop against the MERGED (fixed) code.
93
+ // Pass verificationPhase: 'fix' so the API knows this is a fix-verification
94
+ // call, not an initial finding verification.
95
+ const maxRounds = Math.min(PER_FIX_MAX_ROUNDS, tracker.budget.maxRoundsPerFinding);
96
+ const result = await (0, verifyLoop_1.runVerifyLoop)({
97
+ finding: opts.finding,
98
+ filePath: opts.filePath,
99
+ code: mergedCode,
100
+ relatedFiles: opts.relatedFiles,
101
+ workspaceRoot: opts.workspaceRoot,
102
+ language: opts.language,
103
+ client: opts.client,
104
+ budgetTracker: tracker,
105
+ signal: opts.signal,
106
+ verificationPhase: 'fix',
107
+ onProgress: opts.onProgress,
108
+ });
109
+ // 5. Map the verify loop result to a fix verification status.
110
+ const fixedVerdict = result.verdict;
111
+ // Handle special sub-verdicts that short-circuit the closure decision.
112
+ if (result.subVerdict === 'sandbox-unavailable') {
113
+ return {
114
+ status: 'sandbox-unavailable',
115
+ reason: `Fix verification could not run: no local sandbox (Docker or Deno) available. ${result.reason}`,
116
+ originalVerdict: opts.originalVerdict,
117
+ fixedVerdict,
118
+ roundsUsed: result.roundsUsed,
119
+ fixedCodeHash,
120
+ testOutput: result.testOutput,
121
+ };
122
+ }
123
+ if (result.subVerdict === 'cancelled' || result.subVerdict === 'aborted') {
124
+ return {
125
+ status: 'cancelled',
126
+ reason: 'Fix verification cancelled by user.',
127
+ originalVerdict: opts.originalVerdict,
128
+ fixedVerdict,
129
+ roundsUsed: result.roundsUsed,
130
+ fixedCodeHash,
131
+ testOutput: result.testOutput,
132
+ };
133
+ }
134
+ // 6. Determine closure based on original vs fixed verdicts.
135
+ // Conservative: only claim "closed" when the original was PROVEN and the
136
+ // fixed code is UNPROVEN. Everything else is inconclusive or still-vulnerable.
137
+ return determineClosureStatus(opts.originalVerdict, fixedVerdict, result.reason, result.roundsUsed, fixedCodeHash, result.testOutput);
138
+ }
139
+ function determineClosureStatus(originalVerdict, fixedVerdict, reason, roundsUsed, fixedCodeHash, testOutput) {
140
+ // Original was PROVEN — the exploit reproduced against the original code.
141
+ if (originalVerdict === 'PROVEN') {
142
+ if (fixedVerdict === 'UNPROVEN') {
143
+ return {
144
+ status: 'closed',
145
+ reason: `Original exploit reproduced; the same exploit did NOT reproduce against the proposed fixed code. ${reason}`,
146
+ originalVerdict,
147
+ fixedVerdict,
148
+ roundsUsed,
149
+ fixedCodeHash,
150
+ testOutput,
151
+ };
152
+ }
153
+ if (fixedVerdict === 'PROVEN') {
154
+ return {
155
+ status: 'still-vulnerable',
156
+ reason: `The exploit still reproduced against the proposed fixed code. ${reason}`,
157
+ originalVerdict,
158
+ fixedVerdict,
159
+ roundsUsed,
160
+ fixedCodeHash,
161
+ testOutput,
162
+ };
163
+ }
164
+ // fixedVerdict === 'INCONCLUSIVE'
165
+ return {
166
+ status: 'inconclusive',
167
+ reason: `Fix verification was inconclusive — could not determine if the fix closed the vulnerability. ${reason}`,
168
+ originalVerdict,
169
+ fixedVerdict,
170
+ roundsUsed,
171
+ fixedCodeHash,
172
+ testOutput,
173
+ };
174
+ }
175
+ // Original was UNPROVEN or INCONCLUSIVE or SKIPPED — we can't claim the fix
176
+ // closed anything because we never proved the original was exploitable.
177
+ return {
178
+ status: 'inconclusive',
179
+ reason: `Cannot determine fix closure: the original finding was ${originalVerdict} (not PROVEN). Fix verification ran ${roundsUsed} round(s) and returned ${fixedVerdict}. ${reason}`,
180
+ originalVerdict,
181
+ fixedVerdict,
182
+ roundsUsed,
183
+ fixedCodeHash,
184
+ testOutput,
185
+ };
186
+ }
187
+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eAAe,uCAAuC,UAAU,0BAA0B,YAAY,KAAK,MAAM,EAAE;QACrL,eAAe;QACf,YAAY;QACZ,UAAU;QACV,aAAa;QACb,UAAU;KACb,CAAC;AACN,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Target-specific investigation profiles.
3
+ *
4
+ * Different file types require different investigation steps. An HTTP route
5
+ * handler needs route discovery and policy checks; a utility function needs
6
+ * caller inventory and security-sensitive branch review. Using the wrong
7
+ * checklist wastes steps on irrelevant tools (e.g., get_endpoints on a
8
+ * file with no routes) and misses required steps for the actual target type.
9
+ */
10
+ import type { InvestigationStep } from './investigationState';
11
+ import type { EvidenceRequirement } from './evidenceLedger';
12
+ export interface InvestigationProfile {
13
+ name: string;
14
+ requiredSteps: InvestigationStep[];
15
+ description: string;
16
+ requirements: EvidenceRequirement[];
17
+ }
18
+ export declare const HTTP_ROUTE_PROFILE: InvestigationProfile;
19
+ export declare const WEBSOCKET_RPC_PROFILE: InvestigationProfile;
20
+ export declare const AUTH_SERVICE_PROFILE: InvestigationProfile;
21
+ export declare const GENERIC_UTILITY_PROFILE: InvestigationProfile;
22
+ export interface ProfileSelectionInput {
23
+ filePath: string;
24
+ architectureContext?: string;
25
+ endpointContext?: string;
26
+ }
27
+ /**
28
+ * Select an investigation profile based on the target file path and context.
29
+ *
30
+ * Heuristics:
31
+ * - File path contains "ws", "websocket", "rpc", "socket" → WebSocket RPC
32
+ * - File path contains "auth", "login", "token", "session", "credential" → Auth Service
33
+ * - Architecture context mentions "endpoint", "route", "handler", "express", "fastify" → HTTP Route
34
+ * - Otherwise → Generic Utility
35
+ */
36
+ export declare function selectInvestigationProfile(input: ProfileSelectionInput): InvestigationProfile;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ /**
3
+ * Target-specific investigation profiles.
4
+ *
5
+ * Different file types require different investigation steps. An HTTP route
6
+ * handler needs route discovery and policy checks; a utility function needs
7
+ * caller inventory and security-sensitive branch review. Using the wrong
8
+ * checklist wastes steps on irrelevant tools (e.g., get_endpoints on a
9
+ * file with no routes) and misses required steps for the actual target type.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GENERIC_UTILITY_PROFILE = exports.AUTH_SERVICE_PROFILE = exports.WEBSOCKET_RPC_PROFILE = exports.HTTP_ROUTE_PROFILE = void 0;
13
+ exports.selectInvestigationProfile = selectInvestigationProfile;
14
+ exports.HTTP_ROUTE_PROFILE = {
15
+ name: 'http-route',
16
+ requiredSteps: [
17
+ 'initial-read',
18
+ 'route-discovery',
19
+ 'policy-check',
20
+ 'auth-symbol-search',
21
+ 'cross-file-flow',
22
+ 'config-inspection',
23
+ 'all-handlers-reviewed',
24
+ 'candidates-verified',
25
+ ],
26
+ description: 'HTTP route handler — requires route discovery, policy check, auth search, cross-file flow, config inspection, authorization analysis, and all-handlers-reviewed.',
27
+ requirements: [
28
+ { id: 'http-initial-read', description: 'Read the target file source', acceptedKinds: ['source-range'], requiredTools: ['read_file'], minimumCount: 1 },
29
+ { id: 'http-route-discovery', description: 'Discover routes/endpoints', acceptedKinds: ['handler-inventory'], requiredTools: ['get_endpoints'], minimumCount: 1 },
30
+ { id: 'http-policy-check', description: 'Check policy on route handlers', acceptedKinds: ['policy-result'], requiredTools: ['check_policy'], minimumCount: 1 },
31
+ { id: 'http-auth-search', description: 'Find authentication symbols', acceptedKinds: ['symbol-definition', 'symbol-reference'], requiredTools: ['search_code'], minimumCount: 1 },
32
+ { id: 'http-cross-file-flow', description: 'Trace cross-file data flow', acceptedKinds: ['cross-file-flow'], requiredTools: ['trace_flow_cross_file', 'trace_flow'], minimumCount: 1 },
33
+ { id: 'http-config-inspection', description: 'Inspect security configuration', acceptedKinds: ['config-result'], requiredTools: ['read_config'], minimumCount: 1, acceptsNegative: true },
34
+ { id: 'http-all-handlers', description: 'Review all discovered handlers', acceptedKinds: ['handler-inventory'], minimumCount: 2 },
35
+ { id: 'http-authz-check', description: 'Verify authorization on authenticated vs unauthenticated paths', acceptedKinds: ['policy-result', 'guard-result'], requiredTools: ['check_policy', 'check_guard'], minimumCount: 1, acceptsNegative: true },
36
+ { id: 'http-csrf-check', description: 'Verify CSRF/origin checks on mutation endpoints', acceptedKinds: ['guard-result', 'policy-result'], requiredTools: ['check_guard', 'check_policy'], minimumCount: 1, acceptsNegative: true },
37
+ { id: 'http-threat-model', description: 'Establish threat model: is the attacker in scope for this endpoint?', acceptedKinds: ['threat-model-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
38
+ { id: 'http-config-reachability', description: 'Verify configuration-dependent claims: is the unsafe config reachable in production?', acceptedKinds: ['reachability-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
39
+ ],
40
+ };
41
+ exports.WEBSOCKET_RPC_PROFILE = {
42
+ name: 'websocket-rpc',
43
+ requiredSteps: [
44
+ 'initial-read',
45
+ 'route-discovery',
46
+ 'auth-symbol-search',
47
+ 'ownership-analysis',
48
+ 'cross-file-flow',
49
+ 'config-inspection',
50
+ 'all-handlers-reviewed',
51
+ 'candidates-verified',
52
+ ],
53
+ description: 'WebSocket RPC handler — requires method inventory, connection auth, per-method authorization, ownership analysis, command execution tracing, and rate-limit check.',
54
+ requirements: [
55
+ { id: 'ws-initial-read', description: 'Read the target file source', acceptedKinds: ['source-range'], requiredTools: ['read_file'], minimumCount: 1 },
56
+ { id: 'ws-method-inventory', description: 'Inventory RPC methods', acceptedKinds: ['handler-inventory'], requiredTools: ['get_endpoints', 'search_code'], minimumCount: 1 },
57
+ { id: 'ws-auth-search', description: 'Find authentication symbols', acceptedKinds: ['symbol-definition', 'symbol-reference'], requiredTools: ['search_code'], minimumCount: 1 },
58
+ { id: 'ws-ownership-analysis', description: 'Trace ownership for resource methods', acceptedKinds: ['cross-file-flow', 'symbol-reference'], requiredTools: ['trace_flow_cross_file', 'search_code'], minimumCount: 1 },
59
+ { id: 'ws-cross-file-flow', description: 'Trace cross-file data flow', acceptedKinds: ['cross-file-flow'], requiredTools: ['trace_flow_cross_file'], minimumCount: 1 },
60
+ { id: 'ws-config-inspection', description: 'Inspect security configuration', acceptedKinds: ['config-result'], requiredTools: ['read_config'], minimumCount: 1, acceptsNegative: true },
61
+ { id: 'ws-all-handlers', description: 'Review all RPC methods', acceptedKinds: ['handler-inventory'], minimumCount: 2 },
62
+ { id: 'ws-per-method-authz', description: 'Verify per-method authorization (owner vs client roles)', acceptedKinds: ['guard-result', 'policy-result'], requiredTools: ['check_guard', 'check_policy'], minimumCount: 1, acceptsNegative: true },
63
+ { id: 'ws-cmd-execution', description: 'Trace command execution paths (execFile, spawn, child_process)', acceptedKinds: ['cross-file-flow', 'source-range'], requiredTools: ['trace_flow_cross_file', 'trace_flow'], minimumCount: 1, acceptsNegative: true },
64
+ { id: 'ws-threat-model', description: 'Establish threat model: are untrusted local processes in scope? Is the binding address exposed?', acceptedKinds: ['threat-model-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
65
+ { id: 'ws-cmd-capability', description: 'Verify command capability: trace untrusted input to a real execution sink, verify per-method authorization and argument validation', acceptedKinds: ['capability-result', 'cross-file-flow'], requiredTools: ['trace_flow_cross_file', 'trace_flow'], minimumCount: 1, acceptsNegative: true },
66
+ ],
67
+ };
68
+ exports.AUTH_SERVICE_PROFILE = {
69
+ name: 'auth-service',
70
+ requiredSteps: [
71
+ 'initial-read',
72
+ 'auth-symbol-search',
73
+ 'cross-file-flow',
74
+ 'config-inspection',
75
+ 'tests-found',
76
+ 'all-handlers-reviewed',
77
+ 'candidates-verified',
78
+ ],
79
+ description: 'Authentication service — requires caller inventory, token issue/verify, role analysis, credential lifecycle, session revocation, bootstrap token handling, config inspection, and tests.',
80
+ requirements: [
81
+ { id: 'auth-initial-read', description: 'Read the target file source', acceptedKinds: ['source-range'], requiredTools: ['read_file'], minimumCount: 1 },
82
+ { id: 'auth-symbol-search', description: 'Find auth function definitions', acceptedKinds: ['symbol-definition', 'symbol-reference'], requiredTools: ['search_code'], minimumCount: 1 },
83
+ { id: 'auth-cross-file-flow', description: 'Trace credential flow across files', acceptedKinds: ['cross-file-flow'], requiredTools: ['trace_flow_cross_file'], minimumCount: 1 },
84
+ { id: 'auth-config-inspection', description: 'Inspect auth configuration', acceptedKinds: ['config-result'], requiredTools: ['read_config'], minimumCount: 1, acceptsNegative: true },
85
+ { id: 'auth-tests-found', description: 'Find tests for auth code', acceptedKinds: ['test-location'], requiredTools: ['find_tests'], minimumCount: 1, acceptsNegative: true },
86
+ { id: 'auth-all-handlers', description: 'Review all auth operations', acceptedKinds: ['handler-inventory'], minimumCount: 1 },
87
+ { id: 'auth-credential-lifecycle', description: 'Verify credential lifecycle (issue, verify, revoke, expire)', acceptedKinds: ['guard-result', 'cross-file-flow'], requiredTools: ['check_guard', 'trace_flow_cross_file'], minimumCount: 1, acceptsNegative: true },
88
+ { id: 'auth-bootstrap-token', description: 'Verify bootstrap/pairing token handling', acceptedKinds: ['guard-result', 'policy-result'], requiredTools: ['check_guard', 'check_policy'], minimumCount: 1, acceptsNegative: true },
89
+ { id: 'auth-threat-model', description: 'Establish threat model: is the attacker in scope for the auth flow?', acceptedKinds: ['threat-model-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
90
+ { id: 'auth-config-reachability', description: 'Verify configuration-dependent claims: is the auth config reachable in production?', acceptedKinds: ['reachability-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
91
+ ],
92
+ };
93
+ exports.GENERIC_UTILITY_PROFILE = {
94
+ name: 'generic-utility',
95
+ requiredSteps: [
96
+ 'initial-read',
97
+ 'cross-file-flow',
98
+ 'tests-found',
99
+ 'candidates-verified',
100
+ ],
101
+ description: 'Generic utility — requires initial read, caller inventory, security-sensitive branch review, tests, and verification.',
102
+ requirements: [
103
+ { id: 'util-initial-read', description: 'Read the target file source', acceptedKinds: ['source-range'], requiredTools: ['read_file'], minimumCount: 1 },
104
+ { id: 'util-cross-file-flow', description: 'Trace data flow to sensitive sinks', acceptedKinds: ['cross-file-flow'], requiredTools: ['trace_flow_cross_file', 'trace_flow'], minimumCount: 1, acceptsNegative: true },
105
+ { id: 'util-tests-found', description: 'Find tests for the utility', acceptedKinds: ['test-location'], requiredTools: ['find_tests'], minimumCount: 1, acceptsNegative: true },
106
+ { id: 'util-threat-model', description: 'Establish threat model: is the attacker in scope for this code path?', acceptedKinds: ['threat-model-result', 'config-result'], requiredTools: ['read_config', 'search_code'], minimumCount: 1, acceptsNegative: true },
107
+ ],
108
+ };
109
+ /**
110
+ * Select an investigation profile based on the target file path and context.
111
+ *
112
+ * Heuristics:
113
+ * - File path contains "ws", "websocket", "rpc", "socket" → WebSocket RPC
114
+ * - File path contains "auth", "login", "token", "session", "credential" → Auth Service
115
+ * - Architecture context mentions "endpoint", "route", "handler", "express", "fastify" → HTTP Route
116
+ * - Otherwise → Generic Utility
117
+ */
118
+ function selectInvestigationProfile(input) {
119
+ const filePathLower = (input.filePath || '').toLowerCase();
120
+ const archContextRaw = input.architectureContext;
121
+ const archContext = (typeof archContextRaw === 'string' ? archContextRaw : '').toLowerCase();
122
+ const endpointContextRaw = input.endpointContext;
123
+ const endpointContext = (typeof endpointContextRaw === 'string' ? endpointContextRaw : '').toLowerCase();
124
+ // WebSocket RPC detection
125
+ if (/(ws|websocket|rpc|socket|wss)/i.test(filePathLower) ||
126
+ /websocket|rpc\s+method|socket\.io/i.test(archContext)) {
127
+ return exports.WEBSOCKET_RPC_PROFILE;
128
+ }
129
+ // Authentication service detection
130
+ if (/(auth|login|token|session|credential|password|jwt|oauth)/i.test(filePathLower) ||
131
+ /auth.*service|token.*issue|credential.*lifecycle/i.test(archContext)) {
132
+ return exports.AUTH_SERVICE_PROFILE;
133
+ }
134
+ // HTTP route detection — check if the file is referenced in endpoint context
135
+ // or the architecture context mentions routes/endpoints
136
+ if (endpointContext.includes(input.filePath.toLowerCase()) ||
137
+ /\b(endpoint|route|handler|express|fastify|router|app\.(get|post|put|delete|patch))\b/i.test(archContext) ||
138
+ /\b(route|controller|handler|middleware)s?\b/i.test(filePathLower)) {
139
+ return exports.HTTP_ROUTE_PROFILE;
140
+ }
141
+ // Default: generic utility
142
+ return exports.GENERIC_UTILITY_PROFILE;
143
+ }
144
+ //# sourceMappingURL=investigationProfiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investigationProfiles.js","sourceRoot":"","sources":["../../src/attack/investigationProfiles.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA8HH,gEA6BC;AA/IY,QAAA,kBAAkB,GAAyB;IACpD,IAAI,EAAE,YAAY;IAClB,aAAa,EAAE;QACX,cAAc;QACd,iBAAiB;QACjB,cAAc;QACd,oBAAoB;QACpB,iBAAiB;QACjB,mBAAmB;QACnB,uBAAuB;QACvB,qBAAqB;KACxB;IACD,WAAW,EAAE,kKAAkK;IAC/K,YAAY,EAAE;QACV,EAAE,EAAE,EAAE,mBAAmB,EAAE,WAAW,EAAE,6BAA6B,EAAE,aAAa,EAAE,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QACvJ,EAAE,EAAE,EAAE,sBAAsB,EAAE,WAAW,EAAE,2BAA2B,EAAE,aAAa,EAAE,CAAC,mBAAmB,CAAC,EAAE,aAAa,EAAE,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QACjK,EAAE,EAAE,EAAE,mBAAmB,EAAE,WAAW,EAAE,gCAAgC,EAAE,aAAa,EAAE,CAAC,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QAC9J,EAAE,EAAE,EAAE,kBAAkB,EAAE,WAAW,EAAE,6BAA6B,EAAE,aAAa,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,EAAE,aAAa,EAAE,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE;QAC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