@sun-asterisk/sunlint 1.3.36 → 1.3.37
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/cli.js +33 -0
- package/config/rules/enhanced-rules-registry.json +354 -98
- package/config/rules/rules-registry-generated.json +197 -171
- package/core/architecture-integration.js +115 -17
- package/core/cli-action-handler.js +101 -27
- package/core/cli-program.js +5 -0
- package/core/github-annotate-service.js +62 -0
- package/core/impact-integration.js +31 -16
- package/core/init-command.js +227 -0
- package/core/output-service.js +53 -5
- package/core/summary-report-service.js +46 -0
- package/core/unified-rule-registry.js +2 -1
- package/engines/eslint-engine.js +6 -0
- package/engines/impact/core/detectors/database-detector.js +1 -1
- package/engines/impact/core/detectors/endpoint-detector.js +1 -1
- package/engines/impact/core/report-generator.js +235 -73
- package/origin-rules/security-en.md +470 -282
- package/package.json +1 -1
- package/rules/security/S001_backend_auth_communications/dart/analyzer.js +44 -0
- package/rules/security/S001_backend_auth_communications/index.js +87 -0
- package/rules/security/S001_backend_auth_communications/typescript/analyzer.js +164 -0
- package/rules/security/S002_os_command_injection/dart/analyzer.js +44 -0
- package/rules/security/S002_os_command_injection/index.js +87 -0
- package/rules/security/S002_os_command_injection/typescript/analyzer.js +194 -0
- package/rules/security/S008_svg_content_validation/dart/analyzer.js +44 -0
- package/rules/security/S008_svg_content_validation/index.js +87 -0
- package/rules/security/S008_svg_content_validation/typescript/analyzer.js +216 -0
- package/rules/security/S018_no_sensitive_browser_storage/dart/analyzer.js +44 -0
- package/rules/security/S018_no_sensitive_browser_storage/index.js +86 -0
- package/rules/security/S018_no_sensitive_browser_storage/typescript/analyzer.js +193 -0
- package/rules/security/S021_referrer_policy/dart/analyzer.js +44 -0
- package/rules/security/S021_referrer_policy/index.js +86 -0
- package/rules/security/S021_referrer_policy/typescript/analyzer.js +183 -0
- package/rules/security/S023_no_json_injection/config.json +133 -44
- package/rules/security/S023_no_json_injection/dart/analyzer.js +7 -6
- package/rules/security/S023_no_json_injection/typescript/analyzer.js +402 -126
- package/rules/security/S023_no_json_injection/typescript/ast-analyzer.js +571 -154
- package/rules/security/S026_tls_all_connections/config.json +30 -0
- package/rules/security/S026_tls_all_connections/typescript/analyzer.js +339 -0
- package/rules/security/S027_mtls_certificate_validation/config.json +30 -0
- package/rules/security/S027_mtls_certificate_validation/typescript/analyzer.js +225 -0
- package/rules/security/S035_separate_app_hostnames/config.json +28 -0
- package/rules/security/S035_separate_app_hostnames/typescript/analyzer.js +186 -0
- package/rules/security/S036_lfi_rfi_protection/config.json +2 -2
- package/rules/security/S039_tls_certificate_validation/config.json +29 -0
- package/rules/security/S039_tls_certificate_validation/typescript/analyzer.js +229 -0
- package/rules/security/S046_jwt_algorithm_allowlist/config.json +28 -0
- package/rules/security/S046_jwt_algorithm_allowlist/dart/analyzer.js +44 -0
- package/rules/security/S046_jwt_algorithm_allowlist/index.js +87 -0
- package/rules/security/S046_jwt_algorithm_allowlist/typescript/analyzer.js +235 -0
- package/rules/security/S047_oauth_pkce_protection/config.json +31 -0
- package/rules/security/S047_oauth_pkce_protection/dart/analyzer.js +44 -0
- package/rules/security/S047_oauth_pkce_protection/index.js +86 -0
- package/rules/security/S047_oauth_pkce_protection/typescript/analyzer.js +78 -0
- package/rules/security/S048_oauth_redirect_uri_validation/config.json +30 -0
- package/rules/security/S048_oauth_redirect_uri_validation/typescript/analyzer.js +278 -0
- package/rules/security/S049_short_validity_tokens/typescript/config.json +10 -3
- package/rules/security/S050_reference_tokens_entropy/config.json +28 -0
- package/rules/security/S050_reference_tokens_entropy/dart/analyzer.js +45 -0
- package/rules/security/S050_reference_tokens_entropy/index.js +86 -0
- package/rules/security/S050_reference_tokens_entropy/typescript/analyzer.js +74 -0
- package/rules/security/S053_generic_error_messages/config.json +28 -0
- package/rules/security/S053_generic_error_messages/dart/analyzer.js +45 -0
- package/rules/security/S053_generic_error_messages/index.js +86 -0
- package/rules/security/S053_generic_error_messages/typescript/analyzer.js +80 -0
- package/rules/security/S055_content_type_validation/typescript/symbol-based-analyzer.js +64 -2
- package/rules/security/S059_disable_debug_mode/config.json +28 -0
- package/rules/security/S059_disable_debug_mode/dart/analyzer.js +45 -0
- package/rules/security/S059_disable_debug_mode/index.js +86 -0
- package/rules/security/S059_disable_debug_mode/typescript/analyzer.js +85 -0
- package/rules/security/S060_password_minimum_length/config.json +28 -0
- package/rules/security/S060_password_minimum_length/dart/analyzer.js +45 -0
- package/rules/security/S060_password_minimum_length/index.js +86 -0
- package/rules/security/S060_password_minimum_length/typescript/analyzer.js +78 -0
- package/rules/security/S026_json_schema_validation/config.json +0 -27
- package/rules/security/S026_json_schema_validation/typescript/analyzer.js +0 -251
- package/rules/security/S027_no_hardcoded_secrets/config.json +0 -29
- package/rules/security/S027_no_hardcoded_secrets/typescript/analyzer.js +0 -309
- package/rules/security/S027_no_hardcoded_secrets/typescript/categories.json +0 -153
- package/rules/security/S035_path_session_cookies/config.json +0 -99
- package/rules/security/S035_path_session_cookies/typescript/analyzer.js +0 -316
- package/rules/security/S035_path_session_cookies/typescript/regex-based-analyzer.js +0 -724
- package/rules/security/S035_path_session_cookies/typescript/symbol-based-analyzer.js +0 -373
- package/rules/security/S039_no_session_tokens_in_url/config.json +0 -92
- package/rules/security/S039_no_session_tokens_in_url/typescript/analyzer.js +0 -262
- package/rules/security/S039_no_session_tokens_in_url/typescript/regex-based-analyzer.js +0 -337
- package/rules/security/S039_no_session_tokens_in_url/typescript/symbol-based-analyzer.js +0 -443
- package/rules/security/S048_no_current_password_in_reset/config.json +0 -48
- package/rules/security/S048_no_current_password_in_reset/typescript/analyzer.js +0 -366
- /package/rules/security/{S026_json_schema_validation → S026_tls_all_connections}/dart/analyzer.js +0 -0
- /package/rules/security/{S026_json_schema_validation → S026_tls_all_connections}/index.js +0 -0
- /package/rules/security/{S027_no_hardcoded_secrets → S027_mtls_certificate_validation}/dart/analyzer.js +0 -0
- /package/rules/security/{S027_no_hardcoded_secrets → S027_mtls_certificate_validation}/index.js +0 -0
- /package/rules/security/{S027_no_hardcoded_secrets → S027_mtls_certificate_validation}/typescript/categorized-analyzer.js +0 -0
- /package/rules/security/{S035_path_session_cookies → S035_separate_app_hostnames}/dart/analyzer.js +0 -0
- /package/rules/security/{S035_path_session_cookies → S035_separate_app_hostnames}/index.js +0 -0
- /package/rules/security/{S035_path_session_cookies → S035_separate_app_hostnames}/typescript/README.md +0 -0
- /package/rules/security/{S039_no_session_tokens_in_url → S039_tls_certificate_validation}/dart/analyzer.js +0 -0
- /package/rules/security/{S039_no_session_tokens_in_url → S039_tls_certificate_validation}/index.js +0 -0
- /package/rules/security/{S039_no_session_tokens_in_url → S039_tls_certificate_validation}/typescript/README.md +0 -0
- /package/rules/security/{S048_no_current_password_in_reset → S048_oauth_redirect_uri_validation}/dart/analyzer.js +0 -0
- /package/rules/security/{S048_no_current_password_in_reset → S048_oauth_redirect_uri_validation}/index.js +0 -0
- /package/rules/security/{S048_no_current_password_in_reset → S048_oauth_redirect_uri_validation}/typescript/README.md +0 -0
package/cli.js
CHANGED
|
@@ -10,10 +10,42 @@
|
|
|
10
10
|
const chalk = require('chalk');
|
|
11
11
|
const { createCliProgram } = require('./core/cli-program');
|
|
12
12
|
const CliActionHandler = require('./core/cli-action-handler');
|
|
13
|
+
const { initProject } = require('./core/init-command');
|
|
13
14
|
|
|
14
15
|
// Create CLI program
|
|
15
16
|
const program = createCliProgram();
|
|
16
17
|
|
|
18
|
+
// ──────────────────────────────────────────────────────────────
|
|
19
|
+
// Init Command - Initialize project with SunLint skill
|
|
20
|
+
// ──────────────────────────────────────────────────────────────
|
|
21
|
+
const { AI_TOOL_CONFIG, DEFAULT_TOOL, getAvailableToolsHelp } = require('./core/init-command');
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.command('init [directory]')
|
|
25
|
+
.description('Initialize a project with SunLint code quality skill and AGENTS.md')
|
|
26
|
+
.option('-f, --force', 'Overwrite existing files')
|
|
27
|
+
.option('-t, --tool <tool>', `Target AI tool (default: ${DEFAULT_TOOL})`, DEFAULT_TOOL)
|
|
28
|
+
.addHelpText('after', `
|
|
29
|
+
AI Tool Options:
|
|
30
|
+
${getAvailableToolsHelp()}
|
|
31
|
+
|
|
32
|
+
Examples:
|
|
33
|
+
$ sunlint init # Use default (antigravity)
|
|
34
|
+
$ sunlint init -t cursor # For Cursor AI
|
|
35
|
+
$ sunlint init -t claude # For Claude
|
|
36
|
+
$ sunlint init -t github-copilot # For GitHub Copilot
|
|
37
|
+
$ sunlint init ./my-project -t cursor --force
|
|
38
|
+
`)
|
|
39
|
+
.action(async (directory, options) => {
|
|
40
|
+
try {
|
|
41
|
+
const targetDir = directory || process.cwd();
|
|
42
|
+
await initProject(targetDir, options);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(chalk.red('Error initializing project:'), error.message);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
17
49
|
// Set up main action handler
|
|
18
50
|
program.action(async (options) => {
|
|
19
51
|
// Always use modern architecture (legacy removed)
|
|
@@ -34,3 +66,4 @@ process.on('uncaughtException', (error) => {
|
|
|
34
66
|
|
|
35
67
|
// Parse CLI arguments
|
|
36
68
|
program.parse();
|
|
69
|
+
|
|
@@ -1549,7 +1549,8 @@
|
|
|
1549
1549
|
"regex": 85,
|
|
1550
1550
|
"ast": 90
|
|
1551
1551
|
}
|
|
1552
|
-
}
|
|
1552
|
+
},
|
|
1553
|
+
"analyzerPath": "rules/security/S001_backend_auth_communications"
|
|
1553
1554
|
},
|
|
1554
1555
|
"S002": {
|
|
1555
1556
|
"name": "IDOR Check",
|
|
@@ -1568,7 +1569,8 @@
|
|
|
1568
1569
|
"security",
|
|
1569
1570
|
"idor",
|
|
1570
1571
|
"access-control"
|
|
1571
|
-
]
|
|
1572
|
+
],
|
|
1573
|
+
"analyzerPath": "rules/security/S002_os_command_injection"
|
|
1572
1574
|
},
|
|
1573
1575
|
"S003": {
|
|
1574
1576
|
"name": "Open Redirect Protection",
|
|
@@ -1793,7 +1795,8 @@
|
|
|
1793
1795
|
"security",
|
|
1794
1796
|
"cryptography",
|
|
1795
1797
|
"agility"
|
|
1796
|
-
]
|
|
1798
|
+
],
|
|
1799
|
+
"analyzerPath": "rules/security/S008_svg_content_validation"
|
|
1797
1800
|
},
|
|
1798
1801
|
"S009": {
|
|
1799
1802
|
"name": "No Insecure Crypto",
|
|
@@ -2052,7 +2055,8 @@
|
|
|
2052
2055
|
"security",
|
|
2053
2056
|
"validation",
|
|
2054
2057
|
"input"
|
|
2055
|
-
]
|
|
2058
|
+
],
|
|
2059
|
+
"analyzerPath": "rules/security/S018_no_sensitive_browser_storage"
|
|
2056
2060
|
},
|
|
2057
2061
|
"S019": {
|
|
2058
2062
|
"name": "SMTP Injection Protection",
|
|
@@ -2274,42 +2278,76 @@
|
|
|
2274
2278
|
}
|
|
2275
2279
|
},
|
|
2276
2280
|
"S026": {
|
|
2277
|
-
"name": "
|
|
2278
|
-
"description": "
|
|
2281
|
+
"name": "Use TLS encryption for all inbound and outbound connections",
|
|
2282
|
+
"description": "Ensure all application connections use encrypted TLS protocol. Detect insecure HTTP, WS, unencrypted database connections, and disabled SSL/TLS settings.",
|
|
2279
2283
|
"category": "security",
|
|
2280
|
-
"severity": "
|
|
2284
|
+
"severity": "critical",
|
|
2281
2285
|
"languages": [
|
|
2282
2286
|
"typescript",
|
|
2283
|
-
"javascript"
|
|
2287
|
+
"javascript",
|
|
2288
|
+
"dart"
|
|
2284
2289
|
],
|
|
2285
|
-
"analyzer": "
|
|
2286
|
-
"
|
|
2290
|
+
"analyzer": "./rules/security/S026_tls_all_connections/typescript/analyzer.js",
|
|
2291
|
+
"config": "./rules/security/S026_tls_all_connections/config.json",
|
|
2287
2292
|
"version": "1.0.0",
|
|
2288
2293
|
"status": "stable",
|
|
2289
2294
|
"tags": [
|
|
2290
2295
|
"security",
|
|
2291
|
-
"
|
|
2292
|
-
"
|
|
2293
|
-
|
|
2296
|
+
"tls",
|
|
2297
|
+
"encryption",
|
|
2298
|
+
"https",
|
|
2299
|
+
"owasp"
|
|
2300
|
+
],
|
|
2301
|
+
"strategy": {
|
|
2302
|
+
"preferred": "heuristic",
|
|
2303
|
+
"fallbacks": [
|
|
2304
|
+
"heuristic"
|
|
2305
|
+
],
|
|
2306
|
+
"accuracy": {
|
|
2307
|
+
"heuristic": 90
|
|
2308
|
+
}
|
|
2309
|
+
},
|
|
2310
|
+
"engineMappings": {
|
|
2311
|
+
"heuristic": [
|
|
2312
|
+
"rules/security/S026_tls_all_connections/typescript/analyzer.js"
|
|
2313
|
+
]
|
|
2314
|
+
}
|
|
2294
2315
|
},
|
|
2295
2316
|
"S027": {
|
|
2296
|
-
"name": "
|
|
2297
|
-
"description": "
|
|
2317
|
+
"name": "Validate mTLS client certificates before allowing authenticated operations",
|
|
2318
|
+
"description": "Ensure mutual TLS (mTLS) client certificate validation is properly implemented before allowing authenticated operations. Detect missing certificate validation, disabled verification, and improper mTLS configuration.",
|
|
2298
2319
|
"category": "security",
|
|
2299
|
-
"severity": "
|
|
2320
|
+
"severity": "critical",
|
|
2300
2321
|
"languages": [
|
|
2301
2322
|
"typescript",
|
|
2302
|
-
"javascript"
|
|
2323
|
+
"javascript",
|
|
2324
|
+
"dart"
|
|
2303
2325
|
],
|
|
2304
|
-
"analyzer": "
|
|
2305
|
-
"
|
|
2326
|
+
"analyzer": "./rules/security/S027_mtls_certificate_validation/typescript/analyzer.js",
|
|
2327
|
+
"config": "./rules/security/S027_mtls_certificate_validation/config.json",
|
|
2306
2328
|
"version": "1.0.0",
|
|
2307
2329
|
"status": "stable",
|
|
2308
2330
|
"tags": [
|
|
2309
2331
|
"security",
|
|
2310
|
-
"
|
|
2311
|
-
"
|
|
2312
|
-
|
|
2332
|
+
"mtls",
|
|
2333
|
+
"certificate",
|
|
2334
|
+
"authentication",
|
|
2335
|
+
"owasp"
|
|
2336
|
+
],
|
|
2337
|
+
"strategy": {
|
|
2338
|
+
"preferred": "heuristic",
|
|
2339
|
+
"fallbacks": [
|
|
2340
|
+
"heuristic"
|
|
2341
|
+
],
|
|
2342
|
+
"accuracy": {
|
|
2343
|
+
"heuristic": 85
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
"engineMappings": {
|
|
2347
|
+
"heuristic": [
|
|
2348
|
+
"rules/security/S027_mtls_certificate_validation/typescript/analyzer.js"
|
|
2349
|
+
]
|
|
2350
|
+
}
|
|
2313
2351
|
},
|
|
2314
2352
|
"S028": {
|
|
2315
2353
|
"name": "Limit upload file size and number of files per user",
|
|
@@ -2536,53 +2574,77 @@
|
|
|
2536
2574
|
}
|
|
2537
2575
|
},
|
|
2538
2576
|
"S035": {
|
|
2539
|
-
"name": "
|
|
2540
|
-
"description": "
|
|
2577
|
+
"name": "Host separate applications on different hostnames to leverage same-origin policy",
|
|
2578
|
+
"description": "Detect applications sharing hostnames or domains which bypasses browser same-origin policy protection. Separate apps should use different hostnames for security isolation.",
|
|
2541
2579
|
"category": "security",
|
|
2542
|
-
"severity": "
|
|
2580
|
+
"severity": "medium",
|
|
2543
2581
|
"languages": [
|
|
2544
2582
|
"typescript",
|
|
2545
|
-
"javascript"
|
|
2583
|
+
"javascript",
|
|
2584
|
+
"dart"
|
|
2546
2585
|
],
|
|
2547
|
-
"analyzer": "
|
|
2586
|
+
"analyzer": "./rules/security/S035_separate_app_hostnames/typescript/analyzer.js",
|
|
2587
|
+
"config": "./rules/security/S035_separate_app_hostnames/config.json",
|
|
2548
2588
|
"version": "1.0.0",
|
|
2549
2589
|
"status": "stable",
|
|
2550
2590
|
"tags": [
|
|
2551
2591
|
"security",
|
|
2552
|
-
"
|
|
2553
|
-
"
|
|
2592
|
+
"same-origin",
|
|
2593
|
+
"hostname",
|
|
2594
|
+
"isolation",
|
|
2595
|
+
"owasp"
|
|
2554
2596
|
],
|
|
2555
2597
|
"strategy": {
|
|
2556
|
-
"
|
|
2557
|
-
"
|
|
2558
|
-
"heuristic"
|
|
2559
|
-
|
|
2560
|
-
|
|
2598
|
+
"preferred": "heuristic",
|
|
2599
|
+
"fallbacks": [
|
|
2600
|
+
"heuristic"
|
|
2601
|
+
],
|
|
2602
|
+
"accuracy": {
|
|
2603
|
+
"heuristic": 80
|
|
2561
2604
|
}
|
|
2562
2605
|
},
|
|
2563
|
-
"
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2606
|
+
"engineMappings": {
|
|
2607
|
+
"heuristic": [
|
|
2608
|
+
"rules/security/S035_separate_app_hostnames/typescript/analyzer.js"
|
|
2609
|
+
]
|
|
2610
|
+
}
|
|
2567
2611
|
},
|
|
2568
2612
|
"S036": {
|
|
2569
|
-
"name": "
|
|
2570
|
-
"description": "Prevent
|
|
2613
|
+
"name": "Use internal data for file paths, validate user filenames strictly",
|
|
2614
|
+
"description": "Prevent path traversal, LFI, RFI, and SSRF attacks by validating file paths and user-provided filenames. Use allowlists, reject path separators, and resolve paths securely.",
|
|
2571
2615
|
"category": "security",
|
|
2572
2616
|
"severity": "error",
|
|
2573
2617
|
"languages": [
|
|
2574
2618
|
"typescript",
|
|
2575
|
-
"javascript"
|
|
2619
|
+
"javascript",
|
|
2620
|
+
"dart"
|
|
2576
2621
|
],
|
|
2577
|
-
"analyzer": "
|
|
2578
|
-
"
|
|
2622
|
+
"analyzer": "./rules/security/S036_lfi_rfi_protection/typescript/analyzer.js",
|
|
2623
|
+
"config": "./rules/security/S036_lfi_rfi_protection/config.json",
|
|
2579
2624
|
"version": "1.0.0",
|
|
2580
2625
|
"status": "stable",
|
|
2581
2626
|
"tags": [
|
|
2582
2627
|
"security",
|
|
2583
2628
|
"file-inclusion",
|
|
2584
|
-
"path-traversal"
|
|
2585
|
-
|
|
2629
|
+
"path-traversal",
|
|
2630
|
+
"lfi",
|
|
2631
|
+
"rfi",
|
|
2632
|
+
"owasp"
|
|
2633
|
+
],
|
|
2634
|
+
"strategy": {
|
|
2635
|
+
"preferred": "heuristic",
|
|
2636
|
+
"fallbacks": [
|
|
2637
|
+
"heuristic"
|
|
2638
|
+
],
|
|
2639
|
+
"accuracy": {
|
|
2640
|
+
"heuristic": 85
|
|
2641
|
+
}
|
|
2642
|
+
},
|
|
2643
|
+
"engineMappings": {
|
|
2644
|
+
"heuristic": [
|
|
2645
|
+
"rules/security/S036_lfi_rfi_protection/typescript/analyzer.js"
|
|
2646
|
+
]
|
|
2647
|
+
}
|
|
2586
2648
|
},
|
|
2587
2649
|
"S037": {
|
|
2588
2650
|
"name": "Configure comprehensive cache headers to prevent sensitive data leakage",
|
|
@@ -2657,38 +2719,38 @@
|
|
|
2657
2719
|
}
|
|
2658
2720
|
},
|
|
2659
2721
|
"S039": {
|
|
2660
|
-
"name": "
|
|
2661
|
-
"description": "
|
|
2722
|
+
"name": "TLS clients must validate server certificates to prevent MitM attacks",
|
|
2723
|
+
"description": "Ensure TLS clients properly validate server certificates. Detect disabled certificate verification, missing CA validation, and insecure TLS configurations that allow man-in-the-middle attacks.",
|
|
2662
2724
|
"category": "security",
|
|
2663
|
-
"severity": "
|
|
2725
|
+
"severity": "critical",
|
|
2664
2726
|
"languages": [
|
|
2665
2727
|
"typescript",
|
|
2666
|
-
"javascript"
|
|
2728
|
+
"javascript",
|
|
2729
|
+
"dart"
|
|
2667
2730
|
],
|
|
2668
|
-
"analyzer": "./rules/security/
|
|
2669
|
-
"config": "./rules/security/
|
|
2731
|
+
"analyzer": "./rules/security/S039_tls_certificate_validation/typescript/analyzer.js",
|
|
2732
|
+
"config": "./rules/security/S039_tls_certificate_validation/config.json",
|
|
2670
2733
|
"version": "1.0.0",
|
|
2671
|
-
"status": "
|
|
2734
|
+
"status": "stable",
|
|
2672
2735
|
"tags": [
|
|
2673
2736
|
"security",
|
|
2674
|
-
"
|
|
2675
|
-
"
|
|
2676
|
-
"
|
|
2737
|
+
"tls",
|
|
2738
|
+
"certificate",
|
|
2739
|
+
"mitm",
|
|
2740
|
+
"owasp"
|
|
2677
2741
|
],
|
|
2678
2742
|
"strategy": {
|
|
2679
|
-
"preferred": "
|
|
2743
|
+
"preferred": "heuristic",
|
|
2680
2744
|
"fallbacks": [
|
|
2681
|
-
"
|
|
2682
|
-
"regex"
|
|
2745
|
+
"heuristic"
|
|
2683
2746
|
],
|
|
2684
2747
|
"accuracy": {
|
|
2685
|
-
"
|
|
2686
|
-
"regex": 70
|
|
2748
|
+
"heuristic": 90
|
|
2687
2749
|
}
|
|
2688
2750
|
},
|
|
2689
2751
|
"engineMappings": {
|
|
2690
2752
|
"heuristic": [
|
|
2691
|
-
"rules/security/
|
|
2753
|
+
"rules/security/S039_tls_certificate_validation/typescript/analyzer.js"
|
|
2692
2754
|
]
|
|
2693
2755
|
}
|
|
2694
2756
|
},
|
|
@@ -2841,61 +2903,112 @@
|
|
|
2841
2903
|
}
|
|
2842
2904
|
},
|
|
2843
2905
|
"S046": {
|
|
2844
|
-
"name": "
|
|
2845
|
-
"description": "
|
|
2906
|
+
"name": "Use explicit algorithm allowlist for JWT verification",
|
|
2907
|
+
"description": "Ensure JWT verification uses an explicit algorithm allowlist to prevent algorithm confusion attacks. Detect missing or weak algorithm configurations in JWT libraries.",
|
|
2846
2908
|
"category": "security",
|
|
2847
|
-
"severity": "
|
|
2909
|
+
"severity": "critical",
|
|
2848
2910
|
"languages": [
|
|
2849
2911
|
"typescript",
|
|
2850
|
-
"javascript"
|
|
2912
|
+
"javascript",
|
|
2913
|
+
"dart"
|
|
2851
2914
|
],
|
|
2852
|
-
"analyzer": "
|
|
2853
|
-
"
|
|
2915
|
+
"analyzer": "./rules/security/S046_jwt_algorithm_allowlist/typescript/analyzer.js",
|
|
2916
|
+
"config": "./rules/security/S046_jwt_algorithm_allowlist/config.json",
|
|
2854
2917
|
"version": "1.0.0",
|
|
2855
2918
|
"status": "stable",
|
|
2856
2919
|
"tags": [
|
|
2857
2920
|
"security",
|
|
2858
|
-
"
|
|
2859
|
-
"
|
|
2860
|
-
|
|
2921
|
+
"jwt",
|
|
2922
|
+
"algorithm",
|
|
2923
|
+
"authentication",
|
|
2924
|
+
"owasp"
|
|
2925
|
+
],
|
|
2926
|
+
"strategy": {
|
|
2927
|
+
"preferred": "heuristic",
|
|
2928
|
+
"fallbacks": [
|
|
2929
|
+
"heuristic"
|
|
2930
|
+
],
|
|
2931
|
+
"accuracy": {
|
|
2932
|
+
"heuristic": 90
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2935
|
+
"engineMappings": {
|
|
2936
|
+
"heuristic": [
|
|
2937
|
+
"rules/security/S046_jwt_algorithm_allowlist/typescript/analyzer.js"
|
|
2938
|
+
]
|
|
2939
|
+
}
|
|
2861
2940
|
},
|
|
2862
2941
|
"S047": {
|
|
2863
|
-
"name": "
|
|
2864
|
-
"description": "
|
|
2942
|
+
"name": "Use PKCE protection for OAuth flows to prevent authorization code interception",
|
|
2943
|
+
"description": "Ensure OAuth implementations use PKCE (Proof Key for Code Exchange) to protect against authorization code interception attacks, especially for public clients and mobile apps.",
|
|
2865
2944
|
"category": "security",
|
|
2866
|
-
"severity": "
|
|
2945
|
+
"severity": "critical",
|
|
2867
2946
|
"languages": [
|
|
2868
2947
|
"typescript",
|
|
2869
|
-
"javascript"
|
|
2948
|
+
"javascript",
|
|
2949
|
+
"dart"
|
|
2870
2950
|
],
|
|
2871
|
-
"analyzer": "
|
|
2872
|
-
"
|
|
2951
|
+
"analyzer": "./rules/security/S047_oauth_pkce_protection/typescript/analyzer.js",
|
|
2952
|
+
"config": "./rules/security/S047_oauth_pkce_protection/config.json",
|
|
2873
2953
|
"version": "1.0.0",
|
|
2874
2954
|
"status": "stable",
|
|
2875
2955
|
"tags": [
|
|
2876
2956
|
"security",
|
|
2877
|
-
"
|
|
2878
|
-
"
|
|
2879
|
-
|
|
2957
|
+
"oauth",
|
|
2958
|
+
"pkce",
|
|
2959
|
+
"authorization",
|
|
2960
|
+
"owasp"
|
|
2961
|
+
],
|
|
2962
|
+
"strategy": {
|
|
2963
|
+
"preferred": "heuristic",
|
|
2964
|
+
"fallbacks": [
|
|
2965
|
+
"heuristic"
|
|
2966
|
+
],
|
|
2967
|
+
"accuracy": {
|
|
2968
|
+
"heuristic": 85
|
|
2969
|
+
}
|
|
2970
|
+
},
|
|
2971
|
+
"engineMappings": {
|
|
2972
|
+
"heuristic": [
|
|
2973
|
+
"rules/security/S047_oauth_pkce_protection/typescript/analyzer.js"
|
|
2974
|
+
]
|
|
2975
|
+
}
|
|
2880
2976
|
},
|
|
2881
2977
|
"S048": {
|
|
2882
|
-
"name": "
|
|
2883
|
-
"description": "
|
|
2978
|
+
"name": "Validate OAuth redirect URIs with exact string comparison",
|
|
2979
|
+
"description": "Ensure OAuth redirect URIs are validated using exact string comparison to prevent open redirect vulnerabilities. Detect loose pattern matching, regex-based validation, or missing validation.",
|
|
2884
2980
|
"category": "security",
|
|
2885
|
-
"severity": "
|
|
2981
|
+
"severity": "critical",
|
|
2886
2982
|
"languages": [
|
|
2887
2983
|
"typescript",
|
|
2888
|
-
"javascript"
|
|
2984
|
+
"javascript",
|
|
2985
|
+
"dart"
|
|
2889
2986
|
],
|
|
2890
|
-
"analyzer": "
|
|
2891
|
-
"
|
|
2987
|
+
"analyzer": "./rules/security/S048_oauth_redirect_uri_validation/typescript/analyzer.js",
|
|
2988
|
+
"config": "./rules/security/S048_oauth_redirect_uri_validation/config.json",
|
|
2892
2989
|
"version": "1.0.0",
|
|
2893
2990
|
"status": "stable",
|
|
2894
2991
|
"tags": [
|
|
2895
2992
|
"security",
|
|
2896
|
-
"
|
|
2897
|
-
"
|
|
2898
|
-
|
|
2993
|
+
"oauth",
|
|
2994
|
+
"redirect",
|
|
2995
|
+
"validation",
|
|
2996
|
+
"owasp"
|
|
2997
|
+
],
|
|
2998
|
+
"strategy": {
|
|
2999
|
+
"preferred": "heuristic",
|
|
3000
|
+
"fallbacks": [
|
|
3001
|
+
"heuristic"
|
|
3002
|
+
],
|
|
3003
|
+
"accuracy": {
|
|
3004
|
+
"heuristic": 85
|
|
3005
|
+
}
|
|
3006
|
+
},
|
|
3007
|
+
"engineMappings": {
|
|
3008
|
+
"heuristic": [
|
|
3009
|
+
"rules/security/S048_oauth_redirect_uri_validation/typescript/analyzer.js"
|
|
3010
|
+
]
|
|
3011
|
+
}
|
|
2899
3012
|
},
|
|
2900
3013
|
"S049": {
|
|
2901
3014
|
"name": "Authentication tokens should have short validity periods",
|
|
@@ -2936,23 +3049,40 @@
|
|
|
2936
3049
|
}
|
|
2937
3050
|
},
|
|
2938
3051
|
"S050": {
|
|
2939
|
-
"name": "
|
|
2940
|
-
"description": "
|
|
3052
|
+
"name": "Reference tokens must have at least 128-bit entropy using CSPRNG",
|
|
3053
|
+
"description": "Ensure reference tokens (session IDs, API tokens, etc.) have sufficient entropy (at least 128 bits) and are generated using cryptographically secure pseudo-random number generators (CSPRNG).",
|
|
2941
3054
|
"category": "security",
|
|
2942
|
-
"severity": "
|
|
3055
|
+
"severity": "critical",
|
|
2943
3056
|
"languages": [
|
|
2944
3057
|
"typescript",
|
|
2945
|
-
"javascript"
|
|
3058
|
+
"javascript",
|
|
3059
|
+
"dart"
|
|
2946
3060
|
],
|
|
2947
|
-
"analyzer": "
|
|
2948
|
-
"
|
|
3061
|
+
"analyzer": "./rules/security/S050_reference_tokens_entropy/typescript/analyzer.js",
|
|
3062
|
+
"config": "./rules/security/S050_reference_tokens_entropy/config.json",
|
|
2949
3063
|
"version": "1.0.0",
|
|
2950
3064
|
"status": "stable",
|
|
2951
3065
|
"tags": [
|
|
2952
3066
|
"security",
|
|
2953
|
-
"
|
|
2954
|
-
"
|
|
2955
|
-
|
|
3067
|
+
"tokens",
|
|
3068
|
+
"entropy",
|
|
3069
|
+
"csprng",
|
|
3070
|
+
"owasp"
|
|
3071
|
+
],
|
|
3072
|
+
"strategy": {
|
|
3073
|
+
"preferred": "heuristic",
|
|
3074
|
+
"fallbacks": [
|
|
3075
|
+
"heuristic"
|
|
3076
|
+
],
|
|
3077
|
+
"accuracy": {
|
|
3078
|
+
"heuristic": 85
|
|
3079
|
+
}
|
|
3080
|
+
},
|
|
3081
|
+
"engineMappings": {
|
|
3082
|
+
"heuristic": [
|
|
3083
|
+
"rules/security/S050_reference_tokens_entropy/typescript/analyzer.js"
|
|
3084
|
+
]
|
|
3085
|
+
}
|
|
2956
3086
|
},
|
|
2957
3087
|
"S051": {
|
|
2958
3088
|
"name": "Password length policy enforcement (12-64 chars recommended, reject >128)",
|
|
@@ -3013,6 +3143,41 @@
|
|
|
3013
3143
|
]
|
|
3014
3144
|
}
|
|
3015
3145
|
},
|
|
3146
|
+
"S053": {
|
|
3147
|
+
"name": "Return generic error messages, hide internal details from users",
|
|
3148
|
+
"description": "Prevent exposure of internal error details (stack traces, SQL errors, file paths) to users. Return generic error messages while logging full details server-side.",
|
|
3149
|
+
"category": "security",
|
|
3150
|
+
"severity": "warning",
|
|
3151
|
+
"languages": [
|
|
3152
|
+
"typescript",
|
|
3153
|
+
"javascript",
|
|
3154
|
+
"dart"
|
|
3155
|
+
],
|
|
3156
|
+
"analyzer": "./rules/security/S053_generic_error_messages/typescript/analyzer.js",
|
|
3157
|
+
"config": "./rules/security/S053_generic_error_messages/config.json",
|
|
3158
|
+
"version": "1.0.0",
|
|
3159
|
+
"status": "stable",
|
|
3160
|
+
"tags": [
|
|
3161
|
+
"security",
|
|
3162
|
+
"error-handling",
|
|
3163
|
+
"information-disclosure",
|
|
3164
|
+
"owasp"
|
|
3165
|
+
],
|
|
3166
|
+
"strategy": {
|
|
3167
|
+
"preferred": "heuristic",
|
|
3168
|
+
"fallbacks": [
|
|
3169
|
+
"heuristic"
|
|
3170
|
+
],
|
|
3171
|
+
"accuracy": {
|
|
3172
|
+
"heuristic": 85
|
|
3173
|
+
}
|
|
3174
|
+
},
|
|
3175
|
+
"engineMappings": {
|
|
3176
|
+
"heuristic": [
|
|
3177
|
+
"rules/security/S053_generic_error_messages/typescript/analyzer.js"
|
|
3178
|
+
]
|
|
3179
|
+
}
|
|
3180
|
+
},
|
|
3016
3181
|
"S054": {
|
|
3017
3182
|
"name": "Disallow Default/Built-in Accounts (admin/root/sa/...)",
|
|
3018
3183
|
"description": "Prevent use of default or shared accounts. Enforce per-user identities, initial password change, and disabling well-known built-ins.",
|
|
@@ -3161,6 +3326,78 @@
|
|
|
3161
3326
|
]
|
|
3162
3327
|
}
|
|
3163
3328
|
},
|
|
3329
|
+
"S059": {
|
|
3330
|
+
"name": "Disable debug modes and features in production environments",
|
|
3331
|
+
"description": "Ensure debug modes, verbose logging, and development-only features are disabled in production. Detect hardcoded DEBUG flags, exposed debug endpoints, and development configurations.",
|
|
3332
|
+
"category": "security",
|
|
3333
|
+
"severity": "warning",
|
|
3334
|
+
"languages": [
|
|
3335
|
+
"typescript",
|
|
3336
|
+
"javascript",
|
|
3337
|
+
"dart"
|
|
3338
|
+
],
|
|
3339
|
+
"analyzer": "./rules/security/S059_disable_debug_mode/typescript/analyzer.js",
|
|
3340
|
+
"config": "./rules/security/S059_disable_debug_mode/config.json",
|
|
3341
|
+
"version": "1.0.0",
|
|
3342
|
+
"status": "stable",
|
|
3343
|
+
"tags": [
|
|
3344
|
+
"security",
|
|
3345
|
+
"debug",
|
|
3346
|
+
"production",
|
|
3347
|
+
"configuration",
|
|
3348
|
+
"owasp"
|
|
3349
|
+
],
|
|
3350
|
+
"strategy": {
|
|
3351
|
+
"preferred": "heuristic",
|
|
3352
|
+
"fallbacks": [
|
|
3353
|
+
"heuristic"
|
|
3354
|
+
],
|
|
3355
|
+
"accuracy": {
|
|
3356
|
+
"heuristic": 85
|
|
3357
|
+
}
|
|
3358
|
+
},
|
|
3359
|
+
"engineMappings": {
|
|
3360
|
+
"heuristic": [
|
|
3361
|
+
"rules/security/S059_disable_debug_mode/typescript/analyzer.js"
|
|
3362
|
+
]
|
|
3363
|
+
}
|
|
3364
|
+
},
|
|
3365
|
+
"S060": {
|
|
3366
|
+
"name": "Enforce minimum password length of 8 characters, recommend 15+",
|
|
3367
|
+
"description": "Ensure password validation enforces a minimum length of at least 8 characters (NIST recommendation). Detect weak password length requirements and missing length validation.",
|
|
3368
|
+
"category": "security",
|
|
3369
|
+
"severity": "warning",
|
|
3370
|
+
"languages": [
|
|
3371
|
+
"typescript",
|
|
3372
|
+
"javascript",
|
|
3373
|
+
"dart"
|
|
3374
|
+
],
|
|
3375
|
+
"analyzer": "./rules/security/S060_password_minimum_length/typescript/analyzer.js",
|
|
3376
|
+
"config": "./rules/security/S060_password_minimum_length/config.json",
|
|
3377
|
+
"version": "1.0.0",
|
|
3378
|
+
"status": "stable",
|
|
3379
|
+
"tags": [
|
|
3380
|
+
"security",
|
|
3381
|
+
"password",
|
|
3382
|
+
"authentication",
|
|
3383
|
+
"nist",
|
|
3384
|
+
"owasp"
|
|
3385
|
+
],
|
|
3386
|
+
"strategy": {
|
|
3387
|
+
"preferred": "heuristic",
|
|
3388
|
+
"fallbacks": [
|
|
3389
|
+
"heuristic"
|
|
3390
|
+
],
|
|
3391
|
+
"accuracy": {
|
|
3392
|
+
"heuristic": 85
|
|
3393
|
+
}
|
|
3394
|
+
},
|
|
3395
|
+
"engineMappings": {
|
|
3396
|
+
"heuristic": [
|
|
3397
|
+
"rules/security/S060_password_minimum_length/typescript/analyzer.js"
|
|
3398
|
+
]
|
|
3399
|
+
}
|
|
3400
|
+
},
|
|
3164
3401
|
"T002": {
|
|
3165
3402
|
"id": "T002",
|
|
3166
3403
|
"name": "Rule T002",
|
|
@@ -3384,6 +3621,25 @@
|
|
|
3384
3621
|
],
|
|
3385
3622
|
"accuracy": {}
|
|
3386
3623
|
}
|
|
3624
|
+
},
|
|
3625
|
+
"S021": {
|
|
3626
|
+
"name": "Referrer Policy",
|
|
3627
|
+
"description": "Set Referrer-Policy to prevent sensitive data leakage via Referer header",
|
|
3628
|
+
"category": "security",
|
|
3629
|
+
"severity": "warning",
|
|
3630
|
+
"languages": [
|
|
3631
|
+
"typescript",
|
|
3632
|
+
"javascript"
|
|
3633
|
+
],
|
|
3634
|
+
"analyzer": "heuristic",
|
|
3635
|
+
"analyzerPath": "rules/security/S021_referrer_policy",
|
|
3636
|
+
"version": "1.0.0",
|
|
3637
|
+
"status": "stable",
|
|
3638
|
+
"tags": [
|
|
3639
|
+
"security",
|
|
3640
|
+
"headers",
|
|
3641
|
+
"privacy"
|
|
3642
|
+
]
|
|
3387
3643
|
}
|
|
3388
3644
|
}
|
|
3389
|
-
}
|
|
3645
|
+
}
|