@nahisaho/musubix-security 1.8.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.
- package/README.md +105 -0
- package/bin/musubix-security-mcp.js +12 -0
- package/bin/musubix-security.js +12 -0
- package/dist/analysis/dependency-auditor.d.ts +30 -0
- package/dist/analysis/dependency-auditor.d.ts.map +1 -0
- package/dist/analysis/dependency-auditor.js +325 -0
- package/dist/analysis/dependency-auditor.js.map +1 -0
- package/dist/analysis/index.d.ts +9 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +9 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/secret-detector.d.ts +44 -0
- package/dist/analysis/secret-detector.d.ts.map +1 -0
- package/dist/analysis/secret-detector.js +465 -0
- package/dist/analysis/secret-detector.js.map +1 -0
- package/dist/analysis/taint-analyzer.d.ts +62 -0
- package/dist/analysis/taint-analyzer.d.ts.map +1 -0
- package/dist/analysis/taint-analyzer.js +519 -0
- package/dist/analysis/taint-analyzer.js.map +1 -0
- package/dist/analysis/vulnerability-scanner.d.ts +58 -0
- package/dist/analysis/vulnerability-scanner.d.ts.map +1 -0
- package/dist/analysis/vulnerability-scanner.js +417 -0
- package/dist/analysis/vulnerability-scanner.js.map +1 -0
- package/dist/cli/commands.d.ts +15 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +405 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/ast-parser.d.ts +87 -0
- package/dist/infrastructure/ast-parser.d.ts.map +1 -0
- package/dist/infrastructure/ast-parser.js +273 -0
- package/dist/infrastructure/ast-parser.js.map +1 -0
- package/dist/infrastructure/cache.d.ts +100 -0
- package/dist/infrastructure/cache.d.ts.map +1 -0
- package/dist/infrastructure/cache.js +288 -0
- package/dist/infrastructure/cache.js.map +1 -0
- package/dist/infrastructure/config-loader.d.ts +35 -0
- package/dist/infrastructure/config-loader.d.ts.map +1 -0
- package/dist/infrastructure/config-loader.js +358 -0
- package/dist/infrastructure/config-loader.js.map +1 -0
- package/dist/infrastructure/file-scanner.d.ts +94 -0
- package/dist/infrastructure/file-scanner.d.ts.map +1 -0
- package/dist/infrastructure/file-scanner.js +189 -0
- package/dist/infrastructure/file-scanner.js.map +1 -0
- package/dist/infrastructure/index.d.ts +9 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +9 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +34 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +88 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +88 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +443 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/services/fix-generator.d.ts +56 -0
- package/dist/services/fix-generator.d.ts.map +1 -0
- package/dist/services/fix-generator.js +346 -0
- package/dist/services/fix-generator.js.map +1 -0
- package/dist/services/fix-verifier.d.ts +62 -0
- package/dist/services/fix-verifier.d.ts.map +1 -0
- package/dist/services/fix-verifier.js +224 -0
- package/dist/services/fix-verifier.js.map +1 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +13 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/report-generator.d.ts +87 -0
- package/dist/services/report-generator.d.ts.map +1 -0
- package/dist/services/report-generator.js +463 -0
- package/dist/services/report-generator.js.map +1 -0
- package/dist/services/security-service.d.ts +151 -0
- package/dist/services/security-service.d.ts.map +1 -0
- package/dist/services/security-service.js +279 -0
- package/dist/services/security-service.js.map +1 -0
- package/dist/types/config.d.ts +188 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +89 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/dependency.d.ts +266 -0
- package/dist/types/dependency.d.ts.map +1 -0
- package/dist/types/dependency.js +7 -0
- package/dist/types/dependency.js.map +1 -0
- package/dist/types/fix.d.ts +213 -0
- package/dist/types/fix.d.ts.map +1 -0
- package/dist/types/fix.js +7 -0
- package/dist/types/fix.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/secret.d.ts +151 -0
- package/dist/types/secret.d.ts.map +1 -0
- package/dist/types/secret.js +91 -0
- package/dist/types/secret.js.map +1 -0
- package/dist/types/taint.d.ts +182 -0
- package/dist/types/taint.d.ts.map +1 -0
- package/dist/types/taint.js +24 -0
- package/dist/types/taint.js.map +1 -0
- package/dist/types/vulnerability.d.ts +136 -0
- package/dist/types/vulnerability.d.ts.map +1 -0
- package/dist/types/vulnerability.js +7 -0
- package/dist/types/vulnerability.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fix generator service - generates fix suggestions for vulnerabilities
|
|
3
|
+
* @module @nahisaho/musubix-security/services/fix-generator
|
|
4
|
+
* @trace REQ-SEC-FIX-001
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generate fix ID
|
|
8
|
+
*/
|
|
9
|
+
let fixCounter = 0;
|
|
10
|
+
function generateFixId() {
|
|
11
|
+
const date = new Date();
|
|
12
|
+
const dateStr = date.toISOString().slice(0, 10).replace(/-/g, '');
|
|
13
|
+
return `FIX-${dateStr}-${String(++fixCounter).padStart(3, '0')}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reset fix counter (for testing)
|
|
17
|
+
*/
|
|
18
|
+
export function resetFixCounter() {
|
|
19
|
+
fixCounter = 0;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* SQL Injection fix template
|
|
23
|
+
*/
|
|
24
|
+
const sqlInjectionFix = {
|
|
25
|
+
type: 'injection',
|
|
26
|
+
strategy: 'parameterized-query',
|
|
27
|
+
title: 'Use parameterized queries',
|
|
28
|
+
description: 'Replace string interpolation with parameterized queries to prevent SQL injection',
|
|
29
|
+
rationale: 'Parameterized queries separate SQL code from data, preventing attackers from modifying the query structure.',
|
|
30
|
+
imports: [],
|
|
31
|
+
transform: (vuln) => {
|
|
32
|
+
const snippet = vuln.codeSnippet || '';
|
|
33
|
+
// Pattern: `SELECT * FROM users WHERE id = ${userId}`
|
|
34
|
+
// Replace with: 'SELECT * FROM users WHERE id = ?', [userId]
|
|
35
|
+
const templateRegex = /`([^`]*)\$\{([^}]+)\}([^`]*)`/;
|
|
36
|
+
const match = snippet.match(templateRegex);
|
|
37
|
+
if (match) {
|
|
38
|
+
const [original, before, variable, after] = match;
|
|
39
|
+
const parameterized = `'${before}?${after}', [${variable}]`;
|
|
40
|
+
return [{
|
|
41
|
+
location: vuln.location,
|
|
42
|
+
originalCode: original,
|
|
43
|
+
newCode: parameterized,
|
|
44
|
+
description: 'Convert template literal to parameterized query',
|
|
45
|
+
}];
|
|
46
|
+
}
|
|
47
|
+
// Pattern: 'SELECT * FROM users WHERE id = ' + userId
|
|
48
|
+
const concatRegex = /'([^']+)'\s*\+\s*(\w+)/;
|
|
49
|
+
const concatMatch = snippet.match(concatRegex);
|
|
50
|
+
if (concatMatch) {
|
|
51
|
+
const [original, sql, variable] = concatMatch;
|
|
52
|
+
const parameterized = `'${sql}?', [${variable}]`;
|
|
53
|
+
return [{
|
|
54
|
+
location: vuln.location,
|
|
55
|
+
originalCode: original,
|
|
56
|
+
newCode: parameterized,
|
|
57
|
+
description: 'Convert string concatenation to parameterized query',
|
|
58
|
+
}];
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Command injection fix template
|
|
65
|
+
*/
|
|
66
|
+
const commandInjectionFix = {
|
|
67
|
+
type: 'command-injection',
|
|
68
|
+
strategy: 'command-escape',
|
|
69
|
+
title: 'Use execFile with array arguments',
|
|
70
|
+
description: 'Replace exec() with execFile() and array arguments to prevent command injection',
|
|
71
|
+
rationale: 'execFile() with array arguments does not invoke a shell, preventing shell metacharacter injection.',
|
|
72
|
+
imports: [
|
|
73
|
+
{
|
|
74
|
+
module: 'node:child_process',
|
|
75
|
+
namedImports: ['execFile'],
|
|
76
|
+
insertLine: 0,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
transform: (vuln) => {
|
|
80
|
+
const snippet = vuln.codeSnippet || '';
|
|
81
|
+
// Pattern: exec(`command ${arg}`)
|
|
82
|
+
const execRegex = /exec\s*\(\s*`([^`]+)\$\{([^}]+)\}([^`]*)`\s*\)/;
|
|
83
|
+
const match = snippet.match(execRegex);
|
|
84
|
+
if (match) {
|
|
85
|
+
const [original, before, variable] = match;
|
|
86
|
+
// Extract command and args
|
|
87
|
+
const parts = before.trim().split(/\s+/);
|
|
88
|
+
const command = parts[0];
|
|
89
|
+
const fixedArgs = parts.slice(1).map(a => `'${a}'`);
|
|
90
|
+
fixedArgs.push(variable);
|
|
91
|
+
const replacement = `execFile('${command}', [${fixedArgs.join(', ')}])`;
|
|
92
|
+
return [{
|
|
93
|
+
location: vuln.location,
|
|
94
|
+
originalCode: original,
|
|
95
|
+
newCode: replacement,
|
|
96
|
+
description: 'Replace exec() with execFile() using array arguments',
|
|
97
|
+
}];
|
|
98
|
+
}
|
|
99
|
+
return [];
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Path traversal fix template
|
|
104
|
+
*/
|
|
105
|
+
const pathTraversalFix = {
|
|
106
|
+
type: 'path-traversal',
|
|
107
|
+
strategy: 'path-validation',
|
|
108
|
+
title: 'Validate and sanitize file paths',
|
|
109
|
+
description: 'Add path validation to prevent directory traversal attacks',
|
|
110
|
+
rationale: 'Validating that the resolved path stays within the allowed directory prevents access to unauthorized files.',
|
|
111
|
+
imports: [
|
|
112
|
+
{
|
|
113
|
+
module: 'node:path',
|
|
114
|
+
namedImports: ['resolve', 'relative'],
|
|
115
|
+
insertLine: 0,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
transform: (vuln) => {
|
|
119
|
+
const snippet = vuln.codeSnippet || '';
|
|
120
|
+
// Pattern: readFile(userPath)
|
|
121
|
+
const fsRegex = /(readFile(?:Sync)?|writeFile(?:Sync)?)\s*\(\s*(\w+)/;
|
|
122
|
+
const match = snippet.match(fsRegex);
|
|
123
|
+
if (match) {
|
|
124
|
+
const [, , pathVar] = match;
|
|
125
|
+
const safePath = `(() => {
|
|
126
|
+
const baseDir = '/allowed/base/dir';
|
|
127
|
+
const resolved = resolve(baseDir, ${pathVar});
|
|
128
|
+
if (!resolved.startsWith(baseDir)) {
|
|
129
|
+
throw new Error('Path traversal detected');
|
|
130
|
+
}
|
|
131
|
+
return resolved;
|
|
132
|
+
})()`;
|
|
133
|
+
return [{
|
|
134
|
+
location: vuln.location,
|
|
135
|
+
originalCode: pathVar,
|
|
136
|
+
newCode: safePath,
|
|
137
|
+
description: 'Add path validation to prevent directory traversal',
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
return [];
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* XSS fix template
|
|
145
|
+
*/
|
|
146
|
+
const xssFix = {
|
|
147
|
+
type: 'xss',
|
|
148
|
+
strategy: 'html-escape',
|
|
149
|
+
title: 'Escape HTML output',
|
|
150
|
+
description: 'Add HTML escaping to prevent Cross-Site Scripting attacks',
|
|
151
|
+
rationale: 'HTML escaping converts special characters to their HTML entities, preventing script injection.',
|
|
152
|
+
imports: [],
|
|
153
|
+
transform: (vuln) => {
|
|
154
|
+
const snippet = vuln.codeSnippet || '';
|
|
155
|
+
// Pattern: res.send(`<div>${userInput}</div>`)
|
|
156
|
+
const sendRegex = /res\.send\s*\(\s*`([^`]*)\$\{([^}]+)\}([^`]*)`\s*\)/;
|
|
157
|
+
const match = snippet.match(sendRegex);
|
|
158
|
+
if (match) {
|
|
159
|
+
const [original, before, variable, after] = match;
|
|
160
|
+
const replacement = `res.send(\`${before}\${escapeHtml(${variable})}${after}\`)`;
|
|
161
|
+
return [{
|
|
162
|
+
location: vuln.location,
|
|
163
|
+
originalCode: original,
|
|
164
|
+
newCode: replacement,
|
|
165
|
+
description: 'Add HTML escaping to output',
|
|
166
|
+
}];
|
|
167
|
+
}
|
|
168
|
+
return [];
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Eval fix template
|
|
173
|
+
*/
|
|
174
|
+
const evalFix = {
|
|
175
|
+
type: 'code-injection',
|
|
176
|
+
strategy: 'input-validation',
|
|
177
|
+
title: 'Remove eval() usage',
|
|
178
|
+
description: 'Replace eval() with safer alternatives',
|
|
179
|
+
rationale: 'eval() executes arbitrary code, which is inherently dangerous. Safer alternatives should be used.',
|
|
180
|
+
imports: [],
|
|
181
|
+
transform: (vuln) => {
|
|
182
|
+
const snippet = vuln.codeSnippet || '';
|
|
183
|
+
// Pattern: eval(jsonString)
|
|
184
|
+
if (snippet.includes('eval') && snippet.includes('JSON')) {
|
|
185
|
+
const evalRegex = /eval\s*\(\s*(\w+)\s*\)/;
|
|
186
|
+
const match = snippet.match(evalRegex);
|
|
187
|
+
if (match) {
|
|
188
|
+
const [original, variable] = match;
|
|
189
|
+
return [{
|
|
190
|
+
location: vuln.location,
|
|
191
|
+
originalCode: original,
|
|
192
|
+
newCode: `JSON.parse(${variable})`,
|
|
193
|
+
description: 'Replace eval() with JSON.parse() for JSON parsing',
|
|
194
|
+
}];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return [];
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Prototype pollution fix template
|
|
202
|
+
*/
|
|
203
|
+
const prototypePollutionFix = {
|
|
204
|
+
type: 'prototype-pollution',
|
|
205
|
+
strategy: 'input-validation',
|
|
206
|
+
title: 'Validate object keys',
|
|
207
|
+
description: 'Add validation to prevent prototype pollution via __proto__ or constructor',
|
|
208
|
+
rationale: 'Blocking dangerous property names prevents attackers from modifying Object.prototype.',
|
|
209
|
+
imports: [],
|
|
210
|
+
transform: (vuln) => {
|
|
211
|
+
const snippet = vuln.codeSnippet || '';
|
|
212
|
+
// Pattern: Object.assign(target, userInput)
|
|
213
|
+
const assignRegex = /Object\.assign\s*\(\s*(\w+)\s*,\s*(\w+)\s*\)/;
|
|
214
|
+
const match = snippet.match(assignRegex);
|
|
215
|
+
if (match) {
|
|
216
|
+
const [original, target, source] = match;
|
|
217
|
+
const safeMerge = `Object.assign(${target}, Object.fromEntries(
|
|
218
|
+
Object.entries(${source}).filter(([k]) => !['__proto__', 'constructor', 'prototype'].includes(k))
|
|
219
|
+
))`;
|
|
220
|
+
return [{
|
|
221
|
+
location: vuln.location,
|
|
222
|
+
originalCode: original,
|
|
223
|
+
newCode: safeMerge,
|
|
224
|
+
description: 'Filter dangerous keys before Object.assign',
|
|
225
|
+
}];
|
|
226
|
+
}
|
|
227
|
+
return [];
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* All fix templates
|
|
232
|
+
*/
|
|
233
|
+
const FIX_TEMPLATES = [
|
|
234
|
+
sqlInjectionFix,
|
|
235
|
+
commandInjectionFix,
|
|
236
|
+
pathTraversalFix,
|
|
237
|
+
xssFix,
|
|
238
|
+
evalFix,
|
|
239
|
+
prototypePollutionFix,
|
|
240
|
+
];
|
|
241
|
+
/**
|
|
242
|
+
* Fix generator service
|
|
243
|
+
*/
|
|
244
|
+
export class FixGenerator {
|
|
245
|
+
templates;
|
|
246
|
+
constructor(_options = {}) {
|
|
247
|
+
this.templates = [...FIX_TEMPLATES];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Generate a fix for a vulnerability
|
|
251
|
+
*/
|
|
252
|
+
generateFix(vuln) {
|
|
253
|
+
// Find matching template
|
|
254
|
+
const template = this.templates.find((t) => t.type === vuln.type);
|
|
255
|
+
if (!template) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
// Generate code edits
|
|
259
|
+
const edits = template.transform(vuln);
|
|
260
|
+
if (edits.length === 0) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
id: generateFixId(),
|
|
265
|
+
vulnerabilityId: vuln.id,
|
|
266
|
+
strategy: template.strategy,
|
|
267
|
+
title: template.title,
|
|
268
|
+
description: template.description,
|
|
269
|
+
edits,
|
|
270
|
+
imports: template.imports,
|
|
271
|
+
confidence: vuln.confidence * 0.8, // Reduce confidence for fixes
|
|
272
|
+
breakingChange: false,
|
|
273
|
+
rationale: template.rationale,
|
|
274
|
+
generatedAt: new Date(),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Generate fixes for multiple vulnerabilities
|
|
279
|
+
*/
|
|
280
|
+
generateFixes(vulnerabilities) {
|
|
281
|
+
const fixes = [];
|
|
282
|
+
for (const vuln of vulnerabilities) {
|
|
283
|
+
const fix = this.generateFix(vuln);
|
|
284
|
+
if (fix) {
|
|
285
|
+
fixes.push(fix);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return fixes;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Generate a fix for a taint path
|
|
292
|
+
*/
|
|
293
|
+
generateTaintFix(path) {
|
|
294
|
+
// Map sink category to vulnerability type
|
|
295
|
+
const categoryToType = {
|
|
296
|
+
'sql-query': 'injection',
|
|
297
|
+
'command-exec': 'command-injection',
|
|
298
|
+
'file-read': 'path-traversal',
|
|
299
|
+
'file-write': 'path-traversal',
|
|
300
|
+
'html-output': 'xss',
|
|
301
|
+
'eval': 'code-injection',
|
|
302
|
+
'redirect': 'open-redirect',
|
|
303
|
+
};
|
|
304
|
+
const vulnType = categoryToType[path.sink.category];
|
|
305
|
+
if (!vulnType) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
// Create a pseudo-vulnerability for fix generation
|
|
309
|
+
const pseudoVuln = {
|
|
310
|
+
id: `TAINT-${path.id}`,
|
|
311
|
+
type: vulnType,
|
|
312
|
+
severity: path.sink.severity,
|
|
313
|
+
cwes: [],
|
|
314
|
+
location: path.sink.location,
|
|
315
|
+
description: `Taint path from ${path.source.category} to ${path.sink.category}`,
|
|
316
|
+
recommendation: `Add sanitization for ${path.sink.category}`,
|
|
317
|
+
confidence: path.confidence,
|
|
318
|
+
ruleId: 'TAINT',
|
|
319
|
+
detectedAt: new Date(),
|
|
320
|
+
};
|
|
321
|
+
const fix = this.generateFix(pseudoVuln);
|
|
322
|
+
if (fix) {
|
|
323
|
+
fix.taintPathId = path.id;
|
|
324
|
+
}
|
|
325
|
+
return fix;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Add a custom fix template
|
|
329
|
+
*/
|
|
330
|
+
addTemplate(template) {
|
|
331
|
+
this.templates.push(template);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Get available strategies
|
|
335
|
+
*/
|
|
336
|
+
getStrategies() {
|
|
337
|
+
return [...new Set(this.templates.map((t) => t.strategy))];
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Create a fix generator
|
|
342
|
+
*/
|
|
343
|
+
export function createFixGenerator(options) {
|
|
344
|
+
return new FixGenerator(options);
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=fix-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-generator.js","sourceRoot":"","sources":["../../src/services/fix-generator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OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC/E,cAAc,EAAE,wBAAwB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC5D,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,IAAI,IAAI,EAAE;SACvB,CAAC;QAEF,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACzC,IAAI,GAAG,EAAE,CAAC;YACR,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,QAAqB;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA8B;IAC/D,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fix verifier service - verifies fixes using formal methods
|
|
3
|
+
* @module @nahisaho/musubix-security/services/fix-verifier
|
|
4
|
+
* @trace REQ-SEC-FIX-002
|
|
5
|
+
*/
|
|
6
|
+
import type { Fix, VerificationResult } from '../types/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Verification options
|
|
9
|
+
*/
|
|
10
|
+
export interface VerificationOptions {
|
|
11
|
+
/** Timeout in milliseconds */
|
|
12
|
+
timeout?: number;
|
|
13
|
+
/** Enable semantic preservation check */
|
|
14
|
+
checkSemantics?: boolean;
|
|
15
|
+
/** Enable regression check */
|
|
16
|
+
checkRegressions?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fix verifier service
|
|
20
|
+
*
|
|
21
|
+
* Uses formal verification to validate that:
|
|
22
|
+
* 1. The fix eliminates the vulnerability
|
|
23
|
+
* 2. The fix preserves program semantics
|
|
24
|
+
* 3. No new vulnerabilities are introduced
|
|
25
|
+
*/
|
|
26
|
+
export declare class FixVerifier {
|
|
27
|
+
private options;
|
|
28
|
+
constructor(options?: VerificationOptions);
|
|
29
|
+
/**
|
|
30
|
+
* Verify a single fix
|
|
31
|
+
*/
|
|
32
|
+
verify(fix: Fix): Promise<VerificationResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Verify multiple fixes
|
|
35
|
+
*/
|
|
36
|
+
verifyBatch(fixes: Fix[]): Promise<VerificationResult[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a fix type can be formally verified
|
|
39
|
+
*/
|
|
40
|
+
private isVerifiable;
|
|
41
|
+
/**
|
|
42
|
+
* Check if the fix eliminates the vulnerability
|
|
43
|
+
*/
|
|
44
|
+
private checkVulnerabilityElimination;
|
|
45
|
+
/**
|
|
46
|
+
* Check if the fix preserves program semantics
|
|
47
|
+
*/
|
|
48
|
+
private checkSemanticPreservation;
|
|
49
|
+
/**
|
|
50
|
+
* Check if the fix introduces any regressions
|
|
51
|
+
*/
|
|
52
|
+
private checkNoRegressions;
|
|
53
|
+
/**
|
|
54
|
+
* Create a verification result
|
|
55
|
+
*/
|
|
56
|
+
private createResult;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a fix verifier
|
|
60
|
+
*/
|
|
61
|
+
export declare function createFixVerifier(options?: VerificationOptions): FixVerifier;
|
|
62
|
+
//# sourceMappingURL=fix-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-verifier.d.ts","sourceRoot":"","sources":["../../src/services/fix-verifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,GAAG,EACH,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAsB;gBAEzB,OAAO,GAAE,mBAAwB;IAQ7C;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA6DnD;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAW9D;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB;;OAEG;YACW,6BAA6B;IAuD3C;;OAEG;YACW,yBAAyB;IAsBvC;;OAEG;YACW,kBAAkB;IAiChC;;OAEG;IACH,OAAO,CAAC,YAAY;CA0BrB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAE5E"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fix verifier service - verifies fixes using formal methods
|
|
3
|
+
* @module @nahisaho/musubix-security/services/fix-verifier
|
|
4
|
+
* @trace REQ-SEC-FIX-002
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fix verifier service
|
|
8
|
+
*
|
|
9
|
+
* Uses formal verification to validate that:
|
|
10
|
+
* 1. The fix eliminates the vulnerability
|
|
11
|
+
* 2. The fix preserves program semantics
|
|
12
|
+
* 3. No new vulnerabilities are introduced
|
|
13
|
+
*/
|
|
14
|
+
export class FixVerifier {
|
|
15
|
+
options;
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.options = {
|
|
18
|
+
timeout: options.timeout ?? 30000, // 30 seconds
|
|
19
|
+
checkSemantics: options.checkSemantics ?? true,
|
|
20
|
+
checkRegressions: options.checkRegressions ?? true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Verify a single fix
|
|
25
|
+
*/
|
|
26
|
+
async verify(fix) {
|
|
27
|
+
const startTime = Date.now();
|
|
28
|
+
try {
|
|
29
|
+
// Check if fix can be verified
|
|
30
|
+
if (!this.isVerifiable(fix)) {
|
|
31
|
+
return this.createResult(fix.id, 'unsupported', {
|
|
32
|
+
eliminatesVulnerability: false,
|
|
33
|
+
preservesSemantics: false,
|
|
34
|
+
noRegressions: false,
|
|
35
|
+
method: 'static-analysis',
|
|
36
|
+
duration: Date.now() - startTime,
|
|
37
|
+
error: 'Fix type not supported for formal verification',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// Run verification checks
|
|
41
|
+
const eliminatesVuln = await this.checkVulnerabilityElimination(fix);
|
|
42
|
+
const preservesSemantics = this.options.checkSemantics
|
|
43
|
+
? await this.checkSemanticPreservation(fix)
|
|
44
|
+
: true;
|
|
45
|
+
const noRegressions = this.options.checkRegressions
|
|
46
|
+
? await this.checkNoRegressions(fix)
|
|
47
|
+
: true;
|
|
48
|
+
// Determine overall status
|
|
49
|
+
let status = 'verified';
|
|
50
|
+
if (!eliminatesVuln || !preservesSemantics || !noRegressions) {
|
|
51
|
+
status = 'failed';
|
|
52
|
+
}
|
|
53
|
+
return this.createResult(fix.id, status, {
|
|
54
|
+
eliminatesVulnerability: eliminatesVuln,
|
|
55
|
+
preservesSemantics,
|
|
56
|
+
noRegressions,
|
|
57
|
+
method: 'static-analysis',
|
|
58
|
+
duration: Date.now() - startTime,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (error.message?.includes('timeout')) {
|
|
63
|
+
return this.createResult(fix.id, 'timeout', {
|
|
64
|
+
eliminatesVulnerability: false,
|
|
65
|
+
preservesSemantics: false,
|
|
66
|
+
noRegressions: false,
|
|
67
|
+
method: 'static-analysis',
|
|
68
|
+
duration: Date.now() - startTime,
|
|
69
|
+
error: 'Verification timed out',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return this.createResult(fix.id, 'failed', {
|
|
73
|
+
eliminatesVulnerability: false,
|
|
74
|
+
preservesSemantics: false,
|
|
75
|
+
noRegressions: false,
|
|
76
|
+
method: 'static-analysis',
|
|
77
|
+
duration: Date.now() - startTime,
|
|
78
|
+
error: error.message,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Verify multiple fixes
|
|
84
|
+
*/
|
|
85
|
+
async verifyBatch(fixes) {
|
|
86
|
+
const results = [];
|
|
87
|
+
for (const fix of fixes) {
|
|
88
|
+
const result = await this.verify(fix);
|
|
89
|
+
results.push(result);
|
|
90
|
+
}
|
|
91
|
+
return results;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Check if a fix type can be formally verified
|
|
95
|
+
*/
|
|
96
|
+
isVerifiable(fix) {
|
|
97
|
+
// Currently support verification for these strategies
|
|
98
|
+
const verifiableStrategies = [
|
|
99
|
+
'parameterized-query',
|
|
100
|
+
'html-escape',
|
|
101
|
+
'path-validation',
|
|
102
|
+
'input-validation',
|
|
103
|
+
];
|
|
104
|
+
return verifiableStrategies.includes(fix.strategy);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Check if the fix eliminates the vulnerability
|
|
108
|
+
*/
|
|
109
|
+
async checkVulnerabilityElimination(fix) {
|
|
110
|
+
// Analyze the fix edits to determine if they address the vulnerability
|
|
111
|
+
switch (fix.strategy) {
|
|
112
|
+
case 'parameterized-query':
|
|
113
|
+
// Check if the fix uses parameterization
|
|
114
|
+
return fix.edits.some((edit) => {
|
|
115
|
+
const newCode = edit.newCode;
|
|
116
|
+
// Look for parameterized query patterns
|
|
117
|
+
return (newCode.includes('?') && newCode.includes('[') || // ? placeholder with array
|
|
118
|
+
newCode.includes('$1') || newCode.includes(':param') || // named params
|
|
119
|
+
newCode.includes('.prepare('));
|
|
120
|
+
});
|
|
121
|
+
case 'html-escape':
|
|
122
|
+
// Check if output is escaped
|
|
123
|
+
return fix.edits.some((edit) => {
|
|
124
|
+
const newCode = edit.newCode;
|
|
125
|
+
return (newCode.includes('escapeHtml') ||
|
|
126
|
+
newCode.includes('encode') ||
|
|
127
|
+
newCode.includes('sanitize'));
|
|
128
|
+
});
|
|
129
|
+
case 'path-validation':
|
|
130
|
+
// Check if path is validated
|
|
131
|
+
return fix.edits.some((edit) => {
|
|
132
|
+
const newCode = edit.newCode;
|
|
133
|
+
return (newCode.includes('startsWith') ||
|
|
134
|
+
newCode.includes('resolve') ||
|
|
135
|
+
newCode.includes('normalize'));
|
|
136
|
+
});
|
|
137
|
+
case 'input-validation':
|
|
138
|
+
// Check if input is validated
|
|
139
|
+
return fix.edits.some((edit) => {
|
|
140
|
+
const newCode = edit.newCode;
|
|
141
|
+
return (newCode.includes('validate') ||
|
|
142
|
+
newCode.includes('filter') ||
|
|
143
|
+
newCode.includes('sanitize') ||
|
|
144
|
+
newCode.includes('__proto__') // blocking prototype pollution
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
default:
|
|
148
|
+
return true; // Assume true for unknown strategies
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Check if the fix preserves program semantics
|
|
153
|
+
*/
|
|
154
|
+
async checkSemanticPreservation(fix) {
|
|
155
|
+
// Simple heuristic checks for semantic preservation
|
|
156
|
+
for (const edit of fix.edits) {
|
|
157
|
+
// Check that the fix doesn't completely remove functionality
|
|
158
|
+
if (edit.newCode.trim() === '' && edit.originalCode.trim() !== '') {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
// Check that the fix maintains similar structure
|
|
162
|
+
const origFunctionCalls = (edit.originalCode.match(/\w+\s*\(/g) || []).length;
|
|
163
|
+
const newFunctionCalls = (edit.newCode.match(/\w+\s*\(/g) || []).length;
|
|
164
|
+
// Allow for minor differences (e.g., wrapping in escapeHtml())
|
|
165
|
+
if (Math.abs(origFunctionCalls - newFunctionCalls) > 3) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Check if the fix introduces any regressions
|
|
173
|
+
*/
|
|
174
|
+
async checkNoRegressions(fix) {
|
|
175
|
+
// Check for common patterns that might introduce issues
|
|
176
|
+
for (const edit of fix.edits) {
|
|
177
|
+
const newCode = edit.newCode;
|
|
178
|
+
// Check for potential runtime errors
|
|
179
|
+
if (newCode.includes('throw new Error') && !edit.originalCode.includes('throw')) {
|
|
180
|
+
// This is intentional for path validation, etc.
|
|
181
|
+
// Only flag if it looks unintentional
|
|
182
|
+
}
|
|
183
|
+
// Check for potential performance issues
|
|
184
|
+
const origLoops = (edit.originalCode.match(/\b(for|while|map|filter|reduce)\b/g) || []).length;
|
|
185
|
+
const newLoops = (newCode.match(/\b(for|while|map|filter|reduce)\b/g) || []).length;
|
|
186
|
+
if (newLoops > origLoops + 2) {
|
|
187
|
+
// Significant increase in loops might indicate performance regression
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
// Check that we're not introducing new dangerous patterns
|
|
191
|
+
const dangerousPatterns = ['eval(', 'new Function(', '__proto__', 'innerHTML'];
|
|
192
|
+
for (const pattern of dangerousPatterns) {
|
|
193
|
+
if (newCode.includes(pattern) && !edit.originalCode.includes(pattern)) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Create a verification result
|
|
202
|
+
*/
|
|
203
|
+
createResult(fixId, status, data) {
|
|
204
|
+
return {
|
|
205
|
+
fixId,
|
|
206
|
+
status,
|
|
207
|
+
eliminatesVulnerability: data.eliminatesVulnerability,
|
|
208
|
+
preservesSemantics: data.preservesSemantics,
|
|
209
|
+
noRegressions: data.noRegressions,
|
|
210
|
+
method: data.method,
|
|
211
|
+
details: data.details,
|
|
212
|
+
duration: data.duration,
|
|
213
|
+
timestamp: new Date(),
|
|
214
|
+
error: data.error,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Create a fix verifier
|
|
220
|
+
*/
|
|
221
|
+
export function createFixVerifier(options) {
|
|
222
|
+
return new FixVerifier(options);
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=fix-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-verifier.js","sourceRoot":"","sources":["../../src/services/fix-verifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH;;;;;;;GAOG;AACH,MAAM,OAAO,WAAW;IACd,OAAO,CAAsB;IAErC,YAAY,UAA+B,EAAE;QAC3C,IAAI,CAAC,OAAO,GAAG;YACb,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,aAAa;YAChD,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,IAAI;YAC9C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,IAAI;SACnD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,GAAQ;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,+BAA+B;YAC/B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE,aAAa,EAAE;oBAC9C,uBAAuB,EAAE,KAAK;oBAC9B,kBAAkB,EAAE,KAAK;oBACzB,aAAa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,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Services module entry point
|
|
3
|
+
* @module @nahisaho/musubix-security/services
|
|
4
|
+
*/
|
|
5
|
+
export { FixGenerator, createFixGenerator, } from './fix-generator.js';
|
|
6
|
+
export { FixVerifier, createFixVerifier, type VerificationOptions, } from './fix-verifier.js';
|
|
7
|
+
export { ReportGenerator, createReportGenerator, type ReportFormat, type CombinedResults, type ReportMetadata, } from './report-generator.js';
|
|
8
|
+
export { SecurityService, createSecurityService, scanForVulnerabilities, runSecurityScan, type ScanOptions, type CompleteScanResult, } from './security-service.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,YAAY,EACZ,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC"}
|