getdoorman 1.0.5 → 1.0.7

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 (37) hide show
  1. package/bin/doorman.js +18 -11
  2. package/bin/getdoorman.js +18 -11
  3. package/package.json +4 -4
  4. package/src/auth.js +2 -2
  5. package/src/compliance.js +3 -2
  6. package/src/hooks.js +11 -31
  7. package/src/reporter.js +7 -6
  8. package/src/rules/bugs/ai-codegen.js +1 -1
  9. package/src/rules/bugs/crypto-bugs.js +1 -1
  10. package/src/rules/bugs/go-bugs.js +1 -1
  11. package/src/rules/bugs/nextjs-bugs.js +3 -1
  12. package/src/rules/compliance/healthcare.js +4 -4
  13. package/src/rules/compliance/regional-eu.js +1 -1
  14. package/src/rules/compliance/regional-international.js +4 -4
  15. package/src/rules/infrastructure/index.js +5 -5
  16. package/src/rules/quality/index.js +8 -8
  17. package/src/rules/scope-rules.js +2 -2
  18. package/src/rules/security/ai-api.js +8 -8
  19. package/src/rules/security/auth.js +5 -5
  20. package/src/rules/security/csharp.js +15 -15
  21. package/src/rules/security/dart.js +6 -6
  22. package/src/rules/security/deserialization.js +1 -1
  23. package/src/rules/security/go.js +8 -8
  24. package/src/rules/security/injection.js +26 -23
  25. package/src/rules/security/mcp-server.js +4 -4
  26. package/src/rules/security/oauth-jwt.js +1 -1
  27. package/src/rules/security/path-traversal.js +6 -6
  28. package/src/rules/security/php.js +28 -28
  29. package/src/rules/security/ruby.js +20 -20
  30. package/src/rules/security/rust.js +6 -6
  31. package/src/rules/security/shell.js +9 -9
  32. package/src/rules/security/ssrf.js +19 -3
  33. package/src/rules/security/swift.js +3 -3
  34. package/src/rules/security/taint.js +1 -1
  35. package/src/scanner.js +1 -2
  36. package/src/telemetry.js +2 -1
  37. package/src/version.js +8 -0
@@ -75,7 +75,7 @@ const rules = [
75
75
  {
76
76
  id: 'SEC-AUTH-001',
77
77
  category: 'security',
78
- severity: 'critical',
78
+ severity: 'high',
79
79
  confidence: 'likely',
80
80
  title: 'Plaintext password storage detected',
81
81
  check({ files }) {
@@ -615,7 +615,7 @@ const rules = [
615
615
  {
616
616
  id: 'SEC-AUTH-014',
617
617
  category: 'security',
618
- severity: 'critical',
618
+ severity: 'high',
619
619
  confidence: 'likely',
620
620
  title: 'OAuth open redirect via unvalidated redirect_uri',
621
621
  check({ files }) {
@@ -1012,7 +1012,7 @@ rules.push({
1012
1012
 
1013
1013
  // SEC-AUTH-026: Session fixation
1014
1014
  rules.push({
1015
- id: 'SEC-AUTH-026', category: 'security', severity: 'critical', confidence: 'likely',
1015
+ id: 'SEC-AUTH-026', category: 'security', severity: 'high', confidence: 'likely',
1016
1016
  title: 'Session fixation: session not regenerated after login',
1017
1017
  check({ files }) {
1018
1018
  const findings = [];
@@ -1171,7 +1171,7 @@ rules.push({
1171
1171
 
1172
1172
  // SEC-AUTH-034: JWT decoded without verification
1173
1173
  rules.push({
1174
- id: 'SEC-AUTH-034', category: 'security', severity: 'critical', confidence: 'likely',
1174
+ id: 'SEC-AUTH-034', category: 'security', severity: 'high', confidence: 'likely',
1175
1175
  title: 'JWT decoded without signature verification',
1176
1176
  check({ files }) {
1177
1177
  const findings = [];
@@ -1233,7 +1233,7 @@ rules.push({
1233
1233
 
1234
1234
  // SEC-AUTH-037: Authentication bypass via type coercion
1235
1235
  rules.push({
1236
- id: 'SEC-AUTH-037', category: 'security', severity: 'critical', confidence: 'likely',
1236
+ id: 'SEC-AUTH-037', category: 'security', severity: 'high', confidence: 'likely',
1237
1237
  title: 'Password comparison with == — type coercion bypass',
1238
1238
  check({ files }) {
1239
1239
  const findings = [];
@@ -50,7 +50,7 @@ const rules = [
50
50
  {
51
51
  id: 'SEC-CS-001',
52
52
  category: 'security',
53
- severity: 'critical',
53
+ severity: 'high',
54
54
  confidence: 'likely',
55
55
  title: 'SQL Injection via String Concatenation in SqlCommand',
56
56
  description: 'Building SQL queries with string concatenation in SqlCommand allows SQL injection.',
@@ -67,7 +67,7 @@ const rules = [
67
67
  {
68
68
  id: 'SEC-CS-002',
69
69
  category: 'security',
70
- severity: 'critical',
70
+ severity: 'high',
71
71
  confidence: 'likely',
72
72
  title: 'SQL Injection via String Interpolation',
73
73
  description: 'Using string interpolation ($"...") in SQL commands allows injection.',
@@ -84,7 +84,7 @@ const rules = [
84
84
  {
85
85
  id: 'SEC-CS-003',
86
86
  category: 'security',
87
- severity: 'critical',
87
+ severity: 'high',
88
88
  confidence: 'likely',
89
89
  title: 'SQL Injection via String.Format',
90
90
  description: 'Using String.Format to build SQL queries enables injection attacks.',
@@ -181,7 +181,7 @@ const rules = [
181
181
  {
182
182
  id: 'SEC-CS-009',
183
183
  category: 'security',
184
- severity: 'critical',
184
+ severity: 'high',
185
185
  confidence: 'likely',
186
186
  title: 'Command Injection via Process.Start',
187
187
  description: 'Passing user-controlled data to Process.Start enables arbitrary command execution.',
@@ -197,7 +197,7 @@ const rules = [
197
197
  {
198
198
  id: 'SEC-CS-010',
199
199
  category: 'security',
200
- severity: 'critical',
200
+ severity: 'high',
201
201
  confidence: 'likely',
202
202
  title: 'Command Injection via ProcessStartInfo',
203
203
  description: 'Setting ProcessStartInfo.Arguments with user input enables command injection.',
@@ -245,7 +245,7 @@ const rules = [
245
245
  {
246
246
  id: 'SEC-CS-013',
247
247
  category: 'security',
248
- severity: 'critical',
248
+ severity: 'high',
249
249
  confidence: 'likely',
250
250
  title: 'LDAP Injection',
251
251
  description: 'Building LDAP filters with string concatenation allows injection attacks.',
@@ -262,7 +262,7 @@ const rules = [
262
262
  {
263
263
  id: 'SEC-CS-014',
264
264
  category: 'security',
265
- severity: 'critical',
265
+ severity: 'high',
266
266
  confidence: 'likely',
267
267
  title: 'LDAP Injection via String Interpolation',
268
268
  description: 'Using string interpolation in LDAP filters enables injection.',
@@ -278,7 +278,7 @@ const rules = [
278
278
  {
279
279
  id: 'SEC-CS-015',
280
280
  category: 'security',
281
- severity: 'critical',
281
+ severity: 'high',
282
282
  confidence: 'likely',
283
283
  title: 'XXE: XmlDocument Without Safe Settings',
284
284
  description: 'XmlDocument processes external entities by default, enabling XXE attacks.',
@@ -294,7 +294,7 @@ const rules = [
294
294
  {
295
295
  id: 'SEC-CS-016',
296
296
  category: 'security',
297
- severity: 'critical',
297
+ severity: 'high',
298
298
  confidence: 'likely',
299
299
  title: 'XXE: XmlTextReader Without Safe Settings',
300
300
  description: 'XmlTextReader processes DTDs and external entities by default.',
@@ -490,7 +490,7 @@ const rules = [
490
490
  {
491
491
  id: 'SEC-CS-028',
492
492
  category: 'security',
493
- severity: 'critical',
493
+ severity: 'high',
494
494
  confidence: 'likely',
495
495
  title: 'Hardcoded Connection String',
496
496
  description: 'Database connection strings with credentials hardcoded in source code.',
@@ -506,7 +506,7 @@ const rules = [
506
506
  {
507
507
  id: 'SEC-CS-029',
508
508
  category: 'security',
509
- severity: 'critical',
509
+ severity: 'high',
510
510
  confidence: 'likely',
511
511
  title: 'Hardcoded Credentials',
512
512
  description: 'Passwords or API keys hardcoded in source code risk exposure.',
@@ -651,7 +651,7 @@ const rules = [
651
651
  {
652
652
  id: 'SEC-CS-038',
653
653
  category: 'security',
654
- severity: 'critical',
654
+ severity: 'high',
655
655
  confidence: 'likely',
656
656
  title: 'Dynamic Assembly Loading with User Input',
657
657
  description: 'Loading assemblies from user-controlled paths enables arbitrary code execution.',
@@ -667,7 +667,7 @@ const rules = [
667
667
  {
668
668
  id: 'SEC-CS-039',
669
669
  category: 'security',
670
- severity: 'critical',
670
+ severity: 'high',
671
671
  confidence: 'likely',
672
672
  title: 'Dynamic Type Instantiation with User Input',
673
673
  description: 'Activator.CreateInstance with user-controlled type names can instantiate malicious types.',
@@ -764,7 +764,7 @@ const rules = [
764
764
  {
765
765
  id: 'SEC-CS-045',
766
766
  category: 'security',
767
- severity: 'critical',
767
+ severity: 'high',
768
768
  confidence: 'likely',
769
769
  title: 'Hardcoded Encryption Key',
770
770
  description: 'Encryption keys hardcoded in source code can be extracted from assemblies.',
@@ -845,7 +845,7 @@ const rules = [
845
845
  {
846
846
  id: 'SEC-CS-050',
847
847
  category: 'security',
848
- severity: 'critical',
848
+ severity: 'high',
849
849
  confidence: 'likely',
850
850
  title: 'SQL Injection via Entity Framework Raw SQL',
851
851
  description: 'Using FromSqlRaw or ExecuteSqlRaw with string interpolation bypasses EF parameterization.',
@@ -55,7 +55,7 @@ const rules = [
55
55
  {
56
56
  id: 'SEC-DART-002',
57
57
  category: 'security',
58
- severity: 'critical',
58
+ severity: 'high',
59
59
  confidence: 'likely',
60
60
  title: 'Hardcoded API Key or Secret',
61
61
  description: 'API keys or secrets hardcoded in Dart code can be extracted from the compiled app.',
@@ -175,7 +175,7 @@ const rules = [
175
175
  {
176
176
  id: 'SEC-DART-008',
177
177
  category: 'security',
178
- severity: 'critical',
178
+ severity: 'high',
179
179
  confidence: 'likely',
180
180
  title: 'SQL Injection in sqflite',
181
181
  description: 'String interpolation in rawQuery/rawInsert/rawUpdate/rawDelete enables SQL injection.',
@@ -375,7 +375,7 @@ const rules = [
375
375
  {
376
376
  id: 'SEC-DART-018',
377
377
  category: 'security',
378
- severity: 'critical',
378
+ severity: 'high',
379
379
  confidence: 'likely',
380
380
  title: 'Disabled Certificate Verification in HttpClient',
381
381
  description: 'Setting SecurityContext with allowLegacyUnsafeRenegotiation disables TLS protections.',
@@ -395,7 +395,7 @@ const rules = [
395
395
  {
396
396
  id: 'SEC-DART-019',
397
397
  category: 'security',
398
- severity: 'critical',
398
+ severity: 'high',
399
399
  confidence: 'likely',
400
400
  title: 'Dynamic Code Execution',
401
401
  description: 'Using dart:mirrors or evaluateJavascript with user input can lead to code injection.',
@@ -455,7 +455,7 @@ const rules = [
455
455
  {
456
456
  id: 'SEC-DART-022',
457
457
  category: 'security',
458
- severity: 'critical',
458
+ severity: 'high',
459
459
  confidence: 'likely',
460
460
  title: 'Hardcoded OAuth Client Secret',
461
461
  description: 'OAuth client secrets embedded in mobile apps can be extracted and used to impersonate the app.',
@@ -575,7 +575,7 @@ const rules = [
575
575
  {
576
576
  id: 'SEC-DART-028',
577
577
  category: 'security',
578
- severity: 'critical',
578
+ severity: 'high',
579
579
  confidence: 'likely',
580
580
  title: 'Process Execution with User Input',
581
581
  description: 'Process.run or Process.start with unsanitized input can lead to command injection.',
@@ -204,7 +204,7 @@ const rules = [
204
204
  {
205
205
  id: 'SEC-DES-008',
206
206
  category: 'security',
207
- severity: 'critical',
207
+ severity: 'high',
208
208
  confidence: 'likely',
209
209
  title: 'XML Parser Without XXE Protection',
210
210
  description:
@@ -50,7 +50,7 @@ const rules = [
50
50
  {
51
51
  id: 'SEC-GO-001',
52
52
  category: 'security',
53
- severity: 'critical',
53
+ severity: 'high',
54
54
  confidence: 'likely',
55
55
  title: 'SQL Injection via fmt.Sprintf in Query',
56
56
  description: 'Using fmt.Sprintf to build SQL queries passed to db.Query or db.Exec allows SQL injection.',
@@ -66,7 +66,7 @@ const rules = [
66
66
  {
67
67
  id: 'SEC-GO-002',
68
68
  category: 'security',
69
- severity: 'critical',
69
+ severity: 'high',
70
70
  confidence: 'likely',
71
71
  title: 'SQL Injection via String Concatenation',
72
72
  description: 'Concatenating strings to build SQL queries allows injection attacks.',
@@ -82,7 +82,7 @@ const rules = [
82
82
  {
83
83
  id: 'SEC-GO-003',
84
84
  category: 'security',
85
- severity: 'critical',
85
+ severity: 'high',
86
86
  confidence: 'likely',
87
87
  title: 'Command Injection via exec.Command',
88
88
  description: 'Passing user-controlled input to exec.Command can lead to arbitrary command execution.',
@@ -98,7 +98,7 @@ const rules = [
98
98
  {
99
99
  id: 'SEC-GO-004',
100
100
  category: 'security',
101
- severity: 'critical',
101
+ severity: 'high',
102
102
  confidence: 'likely',
103
103
  title: 'Command Injection via Shell Execution',
104
104
  description: 'Using exec.Command with bash/sh -c and string interpolation enables command injection.',
@@ -290,7 +290,7 @@ const rules = [
290
290
  {
291
291
  id: 'SEC-GO-016',
292
292
  category: 'security',
293
- severity: 'critical',
293
+ severity: 'high',
294
294
  confidence: 'likely',
295
295
  title: 'Hardcoded Password',
296
296
  description: 'Passwords hardcoded in source code can be extracted and used to compromise systems.',
@@ -306,7 +306,7 @@ const rules = [
306
306
  {
307
307
  id: 'SEC-GO-017',
308
308
  category: 'security',
309
- severity: 'critical',
309
+ severity: 'high',
310
310
  confidence: 'likely',
311
311
  title: 'Hardcoded API Key',
312
312
  description: 'API keys hardcoded in source code can be extracted from binaries or repositories.',
@@ -466,7 +466,7 @@ const rules = [
466
466
  {
467
467
  id: 'SEC-GO-027',
468
468
  category: 'security',
469
- severity: 'critical',
469
+ severity: 'high',
470
470
  confidence: 'likely',
471
471
  title: 'JWT Parsing Without Proper Validation',
472
472
  description: 'Using jwt.Parse without specifying valid signing methods allows algorithm substitution attacks.',
@@ -738,7 +738,7 @@ const rules = [
738
738
  {
739
739
  id: 'SEC-GO-044',
740
740
  category: 'security',
741
- severity: 'critical',
741
+ severity: 'high',
742
742
  confidence: 'likely',
743
743
  title: 'SQL Injection in GORM Raw Query',
744
744
  description: 'Using db.Raw with fmt.Sprintf allows SQL injection through GORM.',
@@ -42,7 +42,7 @@ const rules = [
42
42
  {
43
43
  id: 'SEC-INJ-001',
44
44
  category: 'security',
45
- severity: 'critical',
45
+ severity: 'high',
46
46
  confidence: 'likely',
47
47
  title: 'SQL Injection via String Concatenation',
48
48
  description:
@@ -82,7 +82,7 @@ const rules = [
82
82
  {
83
83
  id: 'SEC-INJ-002',
84
84
  category: 'security',
85
- severity: 'critical',
85
+ severity: 'high',
86
86
  confidence: 'likely',
87
87
  title: 'SQL Injection via ORM Raw Queries',
88
88
  description:
@@ -108,7 +108,7 @@ const rules = [
108
108
  {
109
109
  id: 'SEC-INJ-003',
110
110
  category: 'security',
111
- severity: 'critical',
111
+ severity: 'high',
112
112
  confidence: 'likely',
113
113
  title: 'NoSQL Injection via MongoDB',
114
114
  description:
@@ -138,7 +138,7 @@ const rules = [
138
138
  {
139
139
  id: 'SEC-INJ-004',
140
140
  category: 'security',
141
- severity: 'critical',
141
+ severity: 'high',
142
142
  confidence: 'likely',
143
143
  title: 'Command Injection via exec',
144
144
  description:
@@ -169,7 +169,7 @@ const rules = [
169
169
  {
170
170
  id: 'SEC-INJ-005',
171
171
  category: 'security',
172
- severity: 'critical',
172
+ severity: 'high',
173
173
  confidence: 'likely',
174
174
  title: 'Command Injection via Shell Spawn',
175
175
  description:
@@ -288,7 +288,7 @@ const rules = [
288
288
  {
289
289
  id: 'SEC-INJ-008',
290
290
  category: 'security',
291
- severity: 'critical',
291
+ severity: 'high',
292
292
  confidence: 'likely',
293
293
  title: 'Server-Side Template Injection (SSTI)',
294
294
  description:
@@ -520,7 +520,7 @@ const rules = [
520
520
  {
521
521
  id: 'SEC-INJ-015',
522
522
  category: 'security',
523
- severity: 'critical',
523
+ severity: 'high',
524
524
  confidence: 'likely',
525
525
  title: 'XML External Entity (XXE) Injection',
526
526
  description:
@@ -727,7 +727,7 @@ const rules = [
727
727
  {
728
728
  id: 'SEC-INJ-019',
729
729
  category: 'security',
730
- severity: 'critical',
730
+ severity: 'high',
731
731
  confidence: 'likely',
732
732
  title: 'Prototype Pollution',
733
733
  description:
@@ -757,7 +757,7 @@ const rules = [
757
757
  {
758
758
  id: 'SEC-INJ-020',
759
759
  category: 'security',
760
- severity: 'critical',
760
+ severity: 'high',
761
761
  confidence: 'likely',
762
762
  title: 'Path Traversal',
763
763
  description:
@@ -797,7 +797,7 @@ const rules = [
797
797
  {
798
798
  id: 'SEC-INJ-021',
799
799
  category: 'security',
800
- severity: 'critical',
800
+ severity: 'high',
801
801
  confidence: 'likely',
802
802
  title: 'SSRF: fetch/axios called with user-controlled URL',
803
803
  description: 'Making HTTP requests to URLs derived from user input enables Server-Side Request Forgery (SSRF), allowing attackers to probe internal services, cloud metadata endpoints, or exfiltrate data.',
@@ -819,7 +819,7 @@ const rules = [
819
819
  {
820
820
  id: 'SEC-INJ-022',
821
821
  category: 'security',
822
- severity: 'critical',
822
+ severity: 'high',
823
823
  confidence: 'likely',
824
824
  title: 'SSRF: http.request with user-controlled host option',
825
825
  description: 'Node.js http.request/https.request called with options derived from user input allows SSRF attacks targeting internal services.',
@@ -927,7 +927,7 @@ const rules = [
927
927
  {
928
928
  id: 'SEC-INJ-026',
929
929
  category: 'security',
930
- severity: 'critical',
930
+ severity: 'high',
931
931
  confidence: 'likely',
932
932
  title: 'SSTI: EJS template rendered with user-controlled template string',
933
933
  description: 'Passing user input as the template string to ejs.render() allows arbitrary JavaScript execution on the server.',
@@ -949,7 +949,7 @@ const rules = [
949
949
  {
950
950
  id: 'SEC-INJ-027',
951
951
  category: 'security',
952
- severity: 'critical',
952
+ severity: 'high',
953
953
  confidence: 'likely',
954
954
  title: 'SSTI: Pug template compiled from user-controlled input',
955
955
  description: 'pug.compile() or pug.render() with user-supplied template strings allows arbitrary code execution.',
@@ -971,7 +971,7 @@ const rules = [
971
971
  {
972
972
  id: 'SEC-INJ-028',
973
973
  category: 'security',
974
- severity: 'critical',
974
+ severity: 'high',
975
975
  confidence: 'likely',
976
976
  title: 'SSTI: Handlebars template compiled from user-controlled input',
977
977
  description: 'Handlebars.compile() called with user input allows template injection leading to remote code execution.',
@@ -1180,7 +1180,7 @@ const rules = [
1180
1180
  {
1181
1181
  id: 'SEC-INJ-036',
1182
1182
  category: 'security',
1183
- severity: 'critical',
1183
+ severity: 'high',
1184
1184
  confidence: 'likely',
1185
1185
  title: 'LDAP Injection via unsanitized user input in LDAP query',
1186
1186
  description: 'Building LDAP filter strings with user input without escaping special characters allows LDAP injection attacks.',
@@ -1202,7 +1202,7 @@ const rules = [
1202
1202
  {
1203
1203
  id: 'SEC-INJ-037',
1204
1204
  category: 'security',
1205
- severity: 'critical',
1205
+ severity: 'high',
1206
1206
  confidence: 'likely',
1207
1207
  title: 'eval() called with user-controlled input — arbitrary code execution',
1208
1208
  description: 'eval() with any user-supplied string allows remote code execution. This is one of the most dangerous patterns in JavaScript.',
@@ -1291,17 +1291,20 @@ export default rules;
1291
1291
 
1292
1292
  // SEC-INJ-041: SQL injection via template literal in raw query
1293
1293
  rules.push({
1294
- id: 'SEC-INJ-041', category: 'security', severity: 'critical', confidence: 'likely',
1294
+ id: 'SEC-INJ-041', category: 'security', severity: 'high', confidence: 'likely',
1295
1295
  title: 'SQL Injection via template literal in query string',
1296
1296
  check({ files }) {
1297
1297
  const findings = [];
1298
- const p = /['"`]\s*(?:SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)\s[^'"`]*\$\{/i;
1298
+ // Must have SQL keyword + SQL clause keyword (FROM/INTO/SET/WHERE/VALUES/TABLE) + ${interpolation}
1299
+ const p = /`\s*(?:SELECT\s.*\sFROM|INSERT\s.*\sINTO|UPDATE\s.*\sSET|DELETE\s.*\sFROM|CREATE\s.*\sTABLE|DROP\s.*\sTABLE|ALTER\s.*\sTABLE)[^`]*\$\{/i;
1299
1300
  for (const [path, content] of files) {
1300
1301
  if (SKIP_PATH.test(path) || !isJS(path)) continue;
1301
1302
  const lines = content.split('\n');
1302
1303
  for (let i = 0; i < lines.length; i++) {
1303
1304
  if (COMMENT_LINE.test(lines[i])) continue;
1304
- if (p.test(lines[i])) findings.push({ ruleId: 'SEC-INJ-041', category: 'security', severity: 'critical', title: 'SQL built with template literal — injection risk', description: 'Template literals in SQL strings allow injection when they contain user input. Use parameterized queries.', file: path, line: i + 1, fix: null });
1305
+ // Check current line + next 2 lines (SQL queries often span multiple lines)
1306
+ const block = lines.slice(i, i + 3).join(' ');
1307
+ if (p.test(block)) findings.push({ ruleId: 'SEC-INJ-041', category: 'security', severity: 'critical', title: 'SQL built with template literal — injection risk', description: 'Template literals in SQL strings allow injection when they contain user input. Use parameterized queries.', file: path, line: i + 1, fix: null });
1305
1308
  }
1306
1309
  }
1307
1310
  return findings;
@@ -1426,7 +1429,7 @@ rules.push({
1426
1429
 
1427
1430
  // SEC-INJ-048: Unsafe shell execution with variables
1428
1431
  rules.push({
1429
- id: 'SEC-INJ-048', category: 'security', severity: 'critical', confidence: 'likely',
1432
+ id: 'SEC-INJ-048', category: 'security', severity: 'high', confidence: 'likely',
1430
1433
  title: 'Shell command constructed with variable interpolation',
1431
1434
  check({ files }) {
1432
1435
  const findings = [];
@@ -1467,7 +1470,7 @@ rules.push({
1467
1470
 
1468
1471
  // SEC-INJ-050: Arbitrary file read via path parameter
1469
1472
  rules.push({
1470
- id: 'SEC-INJ-050', category: 'security', severity: 'critical', confidence: 'likely',
1473
+ id: 'SEC-INJ-050', category: 'security', severity: 'high', confidence: 'likely',
1471
1474
  title: 'File read using user-controlled filename — path traversal',
1472
1475
  check({ files }) {
1473
1476
  const findings = [];
@@ -1505,7 +1508,7 @@ rules.push({
1505
1508
 
1506
1509
  // SEC-INJ-052: Subprocess injection via template literal
1507
1510
  rules.push({
1508
- id: 'SEC-INJ-052', category: 'security', severity: 'critical', confidence: 'likely',
1511
+ id: 'SEC-INJ-052', category: 'security', severity: 'high', confidence: 'likely',
1509
1512
  title: 'subprocess injection via template in spawn/fork',
1510
1513
  check({ files }) {
1511
1514
  const findings = [];
@@ -1543,7 +1546,7 @@ rules.push({
1543
1546
 
1544
1547
  // SEC-INJ-054: Unsafe use of vm.runInNewContext with user data
1545
1548
  rules.push({
1546
- id: 'SEC-INJ-054', category: 'security', severity: 'critical', confidence: 'likely',
1549
+ id: 'SEC-INJ-054', category: 'security', severity: 'high', confidence: 'likely',
1547
1550
  title: 'vm.runInNewContext/runInContext with user data — sandbox escape risk',
1548
1551
  check({ files }) {
1549
1552
  const findings = [];
@@ -19,8 +19,8 @@ function checkAll(rule, files, pattern) {
19
19
  const rules = [
20
20
  { id: 'SEC-MCP-001', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP tool without input validation', check({ files }) { return checkAll(this, files, /server\.tool\([^,]+,\s*async\s*\(\s*\{/); } },
21
21
  { id: 'SEC-MCP-002', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP params in file operation', check({ files }) { return checkAll(this, files, /fs\.\w+\(\s*(?:params|args|input)\.\w+/); } },
22
- { id: 'SEC-MCP-003', category: 'security', severity: 'critical', confidence: 'likely', title: 'MCP params in exec/spawn', check({ files }) { return checkAll(this, files, /(?:exec|spawn|execSync)\(\s*(?:params|args|input)\./); } },
23
- { id: 'SEC-MCP-004', category: 'security', severity: 'critical', confidence: 'likely', title: 'MCP params in SQL query', check({ files }) { return checkAll(this, files, /(?:query|execute)\(\s*`[^`]*\$\{(?:params|args|input)\./); } },
22
+ { id: 'SEC-MCP-003', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP params in exec/spawn', check({ files }) { return checkAll(this, files, /(?:exec|spawn|execSync)\(\s*(?:params|args|input)\./); } },
23
+ { id: 'SEC-MCP-004', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP params in SQL query', check({ files }) { return checkAll(this, files, /(?:query|execute)\(\s*`[^`]*\$\{(?:params|args|input)\./); } },
24
24
  { id: 'SEC-MCP-005', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP params in eval', check({ files }) { return checkAll(this, files, /(?:eval|new\s+Function)\(\s*(?:params|args|input)\./); } },
25
25
  { id: 'SEC-MCP-006', category: 'security', severity: 'medium', confidence: 'suggestion', title: 'MCP tool without schema', check({ files }) { return checkAll(this, files, /server\.tool\(\s*['"][^'"]+['"]\s*,\s*(?:async\s*)?\(/); } },
26
26
  { id: 'SEC-MCP-007', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP params in URL (SSRF)', check({ files }) { return checkAll(this, files, /(?:fetch|axios|got|request)\(\s*(?:params|args|input)\./); } },
@@ -47,8 +47,8 @@ const rules = [
47
47
  { id: 'SEC-MCP-028', category: 'security', severity: 'low', confidence: 'suggestion', title: 'MCP description leaks impl', check({ files }) { return checkAll(this, files, /description:\s*['"].*(?:database|internal|private)/i); } },
48
48
  { id: 'SEC-MCP-029', category: 'security', severity: 'medium', confidence: 'likely', title: 'MCP cross-tool data leak', check({ files }) { return checkAll(this, files, /(?:global|globalThis)\.\w+.*=.*(?:params|args)\./); } },
49
49
  { id: 'SEC-MCP-030', category: 'security', severity: 'medium', confidence: 'suggestion', title: 'MCP debug mode enabled', check({ files }) { return checkAll(this, files, /(?:debug|verbose)\s*[:=]\s*true/); } },
50
- { id: 'SEC-MCP-031', category: 'security', severity: 'critical', confidence: 'likely', title: 'MCP shell injection', check({ files }) { return checkAll(this, files, /exec\(\s*`[^`]*\$\{(?:params|args|input)\./); } },
51
- { id: 'SEC-MCP-032', category: 'security', severity: 'critical', confidence: 'likely', title: 'MCP template injection', check({ files }) { return checkAll(this, files, /(?:render|compile|template)\(\s*(?:params|args|input)\./); } },
50
+ { id: 'SEC-MCP-031', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP shell injection', check({ files }) { return checkAll(this, files, /(?:child_process\.|execSync|execFile)\s*\(\s*`[^`]*\$\{(?:params|args|input)\./); } },
51
+ { id: 'SEC-MCP-032', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP template injection', check({ files }) { return checkAll(this, files, /(?:render|compile|template)\(\s*(?:params|args|input)\./); } },
52
52
  { id: 'SEC-MCP-033', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP LDAP injection', check({ files }) { return checkAll(this, files, /(?:ldap|LDAP).*(?:search|bind).*(?:params|args)\./); } },
53
53
  { id: 'SEC-MCP-034', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP XML injection', check({ files }) { return checkAll(this, files, /[<].*\$\{(?:params|args|input)\./); } },
54
54
  { id: 'SEC-MCP-035', category: 'security', severity: 'high', confidence: 'likely', title: 'MCP header injection', check({ files }) { return checkAll(this, files, /setHeader\([^,]+,\s*(?:params|args|input)\./); } },
@@ -303,7 +303,7 @@ const rules = [
303
303
  {
304
304
  id: 'SEC-JWT-010',
305
305
  category: 'security',
306
- severity: 'critical',
306
+ severity: 'high',
307
307
  confidence: 'likely',
308
308
  title: 'JWT Payload Decoded Without Verification',
309
309
  description:
@@ -39,7 +39,7 @@ const rules = [
39
39
  {
40
40
  id: 'SEC-PT-001',
41
41
  category: 'security',
42
- severity: 'critical',
42
+ severity: 'high',
43
43
  confidence: 'likely',
44
44
  title: 'fs.readFile with User-Controlled Path (Path Traversal)',
45
45
  description:
@@ -62,7 +62,7 @@ const rules = [
62
62
  {
63
63
  id: 'SEC-PT-002',
64
64
  category: 'security',
65
- severity: 'critical',
65
+ severity: 'high',
66
66
  confidence: 'likely',
67
67
  title: 'fs.writeFile with User-Controlled Path (Path Traversal)',
68
68
  description:
@@ -154,7 +154,7 @@ const rules = [
154
154
  {
155
155
  id: 'SEC-PT-006',
156
156
  category: 'security',
157
- severity: 'critical',
157
+ severity: 'high',
158
158
  confidence: 'likely',
159
159
  title: 'fs.createReadStream with User-Controlled Path',
160
160
  description:
@@ -177,7 +177,7 @@ const rules = [
177
177
  {
178
178
  id: 'SEC-PT-007',
179
179
  category: 'security',
180
- severity: 'critical',
180
+ severity: 'high',
181
181
  confidence: 'likely',
182
182
  title: 'Zip Extraction Without Path Validation (Zip Slip)',
183
183
  description:
@@ -213,7 +213,7 @@ const rules = [
213
213
  {
214
214
  id: 'SEC-PT-008',
215
215
  category: 'security',
216
- severity: 'critical',
216
+ severity: 'high',
217
217
  confidence: 'likely',
218
218
  title: 'fs.unlink/rm with User-Controlled Path (Arbitrary File Deletion)',
219
219
  description:
@@ -272,7 +272,7 @@ const rules = [
272
272
  {
273
273
  id: 'SEC-PT-010',
274
274
  category: 'security',
275
- severity: 'critical',
275
+ severity: 'high',
276
276
  confidence: 'likely',
277
277
  title: 'Template/View File Inclusion with User Input (LFI)',
278
278
  description: