@interlace/eslint-devkit 1.0.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/AGENTS.md +352 -0
- package/CHANGELOG.md +88 -0
- package/LICENSE +22 -0
- package/README.md +528 -0
- package/package.json +88 -0
- package/src/aria-definitions.d.ts +9 -0
- package/src/aria-definitions.js +973 -0
- package/src/aria-definitions.js.map +1 -0
- package/src/ast/ast-utils.d.ts +81 -0
- package/src/ast/ast-utils.js +201 -0
- package/src/ast/ast-utils.js.map +1 -0
- package/src/ast/index.d.ts +1 -0
- package/src/ast/index.js +6 -0
- package/src/ast/index.js.map +1 -0
- package/src/index.d.ts +30 -0
- package/src/index.js +54 -0
- package/src/index.js.map +1 -0
- package/src/messaging/constants.d.ts +120 -0
- package/src/messaging/constants.js +744 -0
- package/src/messaging/constants.js.map +1 -0
- package/src/messaging/formatters.d.ts +124 -0
- package/src/messaging/formatters.js +330 -0
- package/src/messaging/formatters.js.map +1 -0
- package/src/messaging/index.d.ts +3 -0
- package/src/messaging/index.js +8 -0
- package/src/messaging/index.js.map +1 -0
- package/src/messaging/types.d.ts +122 -0
- package/src/messaging/types.js +8 -0
- package/src/messaging/types.js.map +1 -0
- package/src/node/fs.d.ts +65 -0
- package/src/node/fs.js +129 -0
- package/src/node/fs.js.map +1 -0
- package/src/node/index.d.ts +3 -0
- package/src/node/index.js +8 -0
- package/src/node/index.js.map +1 -0
- package/src/node/os.d.ts +24 -0
- package/src/node/os.js +49 -0
- package/src/node/os.js.map +1 -0
- package/src/node/path.d.ts +121 -0
- package/src/node/path.js +209 -0
- package/src/node/path.js.map +1 -0
- package/src/resolver/dependency-analysis.d.ts +421 -0
- package/src/resolver/dependency-analysis.js +934 -0
- package/src/resolver/dependency-analysis.js.map +1 -0
- package/src/resolver/index.d.ts +4 -0
- package/src/resolver/index.js +9 -0
- package/src/resolver/index.js.map +1 -0
- package/src/resolver/resolver-adapter.d.ts +53 -0
- package/src/resolver/resolver-adapter.js +126 -0
- package/src/resolver/resolver-adapter.js.map +1 -0
- package/src/resolver/resolver-detection.d.ts +36 -0
- package/src/resolver/resolver-detection.js +219 -0
- package/src/resolver/resolver-detection.js.map +1 -0
- package/src/resolver/resolver.d.ts +52 -0
- package/src/resolver/resolver.js +294 -0
- package/src/resolver/resolver.js.map +1 -0
- package/src/resolver.d.ts +1 -0
- package/src/resolver.js +5 -0
- package/src/resolver.js.map +1 -0
- package/src/rule-creation/index.d.ts +1 -0
- package/src/rule-creation/index.js +6 -0
- package/src/rule-creation/index.js.map +1 -0
- package/src/rule-creation/rule-creator.d.ts +42 -0
- package/src/rule-creation/rule-creator.js +42 -0
- package/src/rule-creation/rule-creator.js.map +1 -0
- package/src/security/index.d.ts +1 -0
- package/src/security/index.js +6 -0
- package/src/security/index.js.map +1 -0
- package/src/security/security-utils.d.ts +303 -0
- package/src/security/security-utils.js +607 -0
- package/src/security/security-utils.js.map +1 -0
- package/src/types/index.d.ts +1 -0
- package/src/types/index.js +6 -0
- package/src/types/index.js.map +1 -0
- package/src/types/type-utils.d.ts +146 -0
- package/src/types/type-utils.js +329 -0
- package/src/types/type-utils.js.map +1 -0
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Constants and mappings for LLM message formatting
|
|
4
|
+
*
|
|
5
|
+
* Contains all static data, severity mappings, CWE definitions, and icon constants
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MessageIcons = exports.CWE_COMPLIANCE_MAPPING = exports.CWE_MAPPING = exports.OWASP_2021_TO_2025 = exports.OWASP_DETAILS = exports.OWASP_2021_DETAILS = exports.OWASP_2025_DETAILS = exports.CVSS_RANGES = void 0;
|
|
9
|
+
exports.severityToCVSS = severityToCVSS;
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// SEVERITY TYPES & CVSS MAPPING (NIST Standard)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* CVSS 3.1 Score mapping per NIST guidelines
|
|
15
|
+
* @see https://nvd.nist.gov/vuln-metrics/cvss
|
|
16
|
+
*/
|
|
17
|
+
exports.CVSS_RANGES = {
|
|
18
|
+
CRITICAL: { min: 9.0, max: 10.0, label: '9.0-10.0' },
|
|
19
|
+
HIGH: { min: 7.0, max: 8.9, label: '7.0-8.9' },
|
|
20
|
+
MEDIUM: { min: 4.0, max: 6.9, label: '4.0-6.9' },
|
|
21
|
+
LOW: { min: 0.1, max: 3.9, label: '0.1-3.9' },
|
|
22
|
+
INFO: { min: 0.0, max: 0.0, label: '0.0' },
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Convert severity to representative CVSS score
|
|
26
|
+
*/
|
|
27
|
+
function severityToCVSS(severity) {
|
|
28
|
+
const range = exports.CVSS_RANGES[severity];
|
|
29
|
+
return Number(((range.min + range.max) / 2).toFixed(1));
|
|
30
|
+
}
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// OWASP TOP 10 2025 CATEGORIES (NEW - Released November 2025)
|
|
33
|
+
// ============================================================================
|
|
34
|
+
/**
|
|
35
|
+
* OWASP Top 10 2025 Categories (Latest)
|
|
36
|
+
* @see https://owasp.org/Top10/2025/
|
|
37
|
+
*
|
|
38
|
+
* Key changes from 2021:
|
|
39
|
+
* - A03: NEW "Software Supply Chain Failures" (consolidates A06:2021 + A08:2021)
|
|
40
|
+
* - A10: NEW "Mishandling of Exceptional Conditions" (replaces SSRF)
|
|
41
|
+
* - Categories reordered based on 2025 threat landscape
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* OWASP 2025 category details (PRIMARY)
|
|
45
|
+
*
|
|
46
|
+
* NOTE: OWASP Top 10 2025 URLs use a projected format. If links are broken,
|
|
47
|
+
* the system falls back to equivalent 2021 categories via OWASP_2021_TO_2025 mapping.
|
|
48
|
+
* Monitor https://owasp.org/Top10/ for official 2025 release URLs.
|
|
49
|
+
*/
|
|
50
|
+
exports.OWASP_2025_DETAILS = {
|
|
51
|
+
'A01:2025': {
|
|
52
|
+
name: 'Broken Access Control',
|
|
53
|
+
description: 'Access control enforces policy such that users cannot act outside their intended permissions',
|
|
54
|
+
link: 'https://owasp.org/Top10/A01_2021-Broken_Access_Control/', // Using confirmed 2021 URL
|
|
55
|
+
fallbackLink: 'https://owasp.org/Top10/A01_2021-Broken_Access_Control/',
|
|
56
|
+
},
|
|
57
|
+
'A02:2025': {
|
|
58
|
+
name: 'Security Misconfiguration',
|
|
59
|
+
description: 'Missing security hardening, improperly configured permissions, default credentials',
|
|
60
|
+
link: 'https://owasp.org/Top10/A05_2021-Security_Misconfiguration/', // Using confirmed 2021 URL
|
|
61
|
+
fallbackLink: 'https://owasp.org/Top10/A05_2021-Security_Misconfiguration/',
|
|
62
|
+
},
|
|
63
|
+
'A03:2025': {
|
|
64
|
+
name: 'Software Supply Chain Failures',
|
|
65
|
+
description: 'Vulnerabilities in dependencies, malicious packages, compromised CI/CD pipelines',
|
|
66
|
+
link: 'https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/', // Using 2021 equivalent
|
|
67
|
+
fallbackLink: 'https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/',
|
|
68
|
+
},
|
|
69
|
+
'A04:2025': {
|
|
70
|
+
name: 'Cryptographic Failures',
|
|
71
|
+
description: 'Failures related to cryptography leading to sensitive data exposure',
|
|
72
|
+
link: 'https://owasp.org/Top10/A02_2021-Cryptographic_Failures/', // Using confirmed 2021 URL
|
|
73
|
+
fallbackLink: 'https://owasp.org/Top10/A02_2021-Cryptographic_Failures/',
|
|
74
|
+
},
|
|
75
|
+
'A05:2025': {
|
|
76
|
+
name: 'Injection',
|
|
77
|
+
description: 'User-supplied data not validated, filtered, or sanitized by the application',
|
|
78
|
+
link: 'https://owasp.org/Top10/A03_2021-Injection/', // Using confirmed 2021 URL
|
|
79
|
+
fallbackLink: 'https://owasp.org/Top10/A03_2021-Injection/',
|
|
80
|
+
},
|
|
81
|
+
'A06:2025': {
|
|
82
|
+
name: 'Insecure Design',
|
|
83
|
+
description: 'Missing or ineffective control design, distinct from implementation flaws',
|
|
84
|
+
link: 'https://owasp.org/Top10/A04_2021-Insecure_Design/', // Using confirmed 2021 URL
|
|
85
|
+
fallbackLink: 'https://owasp.org/Top10/A04_2021-Insecure_Design/',
|
|
86
|
+
},
|
|
87
|
+
'A07:2025': {
|
|
88
|
+
name: 'Authentication Failures',
|
|
89
|
+
description: 'User identity, authentication, and session management weaknesses',
|
|
90
|
+
link: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/', // Using confirmed 2021 URL
|
|
91
|
+
fallbackLink: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/',
|
|
92
|
+
},
|
|
93
|
+
'A08:2025': {
|
|
94
|
+
name: 'Software or Data Integrity Failures',
|
|
95
|
+
description: 'Code and infrastructure that does not protect against integrity violations',
|
|
96
|
+
link: 'https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/', // Using confirmed 2021 URL
|
|
97
|
+
fallbackLink: 'https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/',
|
|
98
|
+
},
|
|
99
|
+
'A09:2025': {
|
|
100
|
+
name: 'Logging & Alerting Failures',
|
|
101
|
+
description: 'Insufficient logging, detection, monitoring, and active response',
|
|
102
|
+
link: 'https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/', // Using confirmed 2021 URL
|
|
103
|
+
fallbackLink: 'https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/',
|
|
104
|
+
},
|
|
105
|
+
'A10:2025': {
|
|
106
|
+
name: 'Mishandling of Exceptional Conditions',
|
|
107
|
+
description: 'Improper error handling, uncaught exceptions, information leakage via errors',
|
|
108
|
+
link: 'https://owasp.org/Top10/A03_2021-Injection/', // No direct 2021 equivalent, using closest category
|
|
109
|
+
fallbackLink: 'https://owasp.org/Top10/A03_2021-Injection/',
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* OWASP 2021 category details (legacy support)
|
|
114
|
+
*/
|
|
115
|
+
exports.OWASP_2021_DETAILS = {
|
|
116
|
+
'A01:2021': {
|
|
117
|
+
name: 'Broken Access Control',
|
|
118
|
+
description: 'Access control enforces policy such that users cannot act outside of their intended permissions',
|
|
119
|
+
link: 'https://owasp.org/Top10/A01_2021-Broken_Access_Control/',
|
|
120
|
+
},
|
|
121
|
+
'A02:2021': {
|
|
122
|
+
name: 'Cryptographic Failures',
|
|
123
|
+
description: 'Failures related to cryptography that lead to sensitive data exposure',
|
|
124
|
+
link: 'https://owasp.org/Top10/A02_2021-Cryptographic_Failures/',
|
|
125
|
+
},
|
|
126
|
+
'A03:2021': {
|
|
127
|
+
name: 'Injection',
|
|
128
|
+
description: 'User-supplied data is not validated, filtered, or sanitized by the application',
|
|
129
|
+
link: 'https://owasp.org/Top10/A03_2021-Injection/',
|
|
130
|
+
},
|
|
131
|
+
'A04:2021': {
|
|
132
|
+
name: 'Insecure Design',
|
|
133
|
+
description: 'Missing or ineffective control design, distinct from implementation flaws',
|
|
134
|
+
link: 'https://owasp.org/Top10/A04_2021-Insecure_Design/',
|
|
135
|
+
},
|
|
136
|
+
'A05:2021': {
|
|
137
|
+
name: 'Security Misconfiguration',
|
|
138
|
+
description: 'Missing security hardening or improperly configured permissions',
|
|
139
|
+
link: 'https://owasp.org/Top10/A05_2021-Security_Misconfiguration/',
|
|
140
|
+
},
|
|
141
|
+
'A06:2021': {
|
|
142
|
+
name: 'Vulnerable Components',
|
|
143
|
+
description: 'Components with known vulnerabilities that may undermine defenses',
|
|
144
|
+
link: 'https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/',
|
|
145
|
+
},
|
|
146
|
+
'A07:2021': {
|
|
147
|
+
name: 'Auth Failures',
|
|
148
|
+
description: 'Confirmation of user identity, authentication, and session management weaknesses',
|
|
149
|
+
link: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/',
|
|
150
|
+
},
|
|
151
|
+
'A08:2021': {
|
|
152
|
+
name: 'Data Integrity Failures',
|
|
153
|
+
description: 'Code and infrastructure that does not protect against integrity violations',
|
|
154
|
+
link: 'https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/',
|
|
155
|
+
},
|
|
156
|
+
'A09:2021': {
|
|
157
|
+
name: 'Logging Failures',
|
|
158
|
+
description: 'Insufficient logging, detection, monitoring, and active response',
|
|
159
|
+
link: 'https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/',
|
|
160
|
+
},
|
|
161
|
+
'A10:2021': {
|
|
162
|
+
name: 'SSRF',
|
|
163
|
+
description: 'Server-Side Request Forgery occurs when fetching a remote resource without validating URL',
|
|
164
|
+
link: 'https://owasp.org/Top10/A10_2021-Server-Side_Request_Forgery_%28SSRF%29/',
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Combined OWASP details (2025 + 2021)
|
|
169
|
+
*/
|
|
170
|
+
exports.OWASP_DETAILS = {
|
|
171
|
+
...exports.OWASP_2025_DETAILS,
|
|
172
|
+
...exports.OWASP_2021_DETAILS,
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Maps 2021 categories to 2025 equivalents
|
|
176
|
+
*/
|
|
177
|
+
exports.OWASP_2021_TO_2025 = {
|
|
178
|
+
'A01:2021': 'A01:2025', // Broken Access Control â Broken Access Control
|
|
179
|
+
'A02:2021': 'A04:2025', // Cryptographic Failures â Cryptographic Failures
|
|
180
|
+
'A03:2021': 'A05:2025', // Injection â Injection
|
|
181
|
+
'A04:2021': 'A06:2025', // Insecure Design â Insecure Design
|
|
182
|
+
'A05:2021': 'A02:2025', // Security Misconfiguration â Security Misconfiguration
|
|
183
|
+
'A06:2021': 'A03:2025', // Vulnerable Components â Software Supply Chain Failures
|
|
184
|
+
'A07:2021': 'A07:2025', // Auth Failures â Authentication Failures
|
|
185
|
+
'A08:2021': 'A08:2025', // Data Integrity Failures â Software or Data Integrity Failures
|
|
186
|
+
'A09:2021': 'A09:2025', // Logging Failures â Logging & Alerting Failures
|
|
187
|
+
'A10:2021': 'A05:2025', // SSRF â Injection (SSRF absorbed into injection/other categories)
|
|
188
|
+
};
|
|
189
|
+
// ============================================================================
|
|
190
|
+
// CWE TO OWASP 2025/CVSS MAPPING (Updated for OWASP Top 10 2025)
|
|
191
|
+
// ============================================================================
|
|
192
|
+
/**
|
|
193
|
+
* Maps common CWE IDs to OWASP 2025 categories and typical CVSS scores
|
|
194
|
+
* This enables automatic enrichment of security rules
|
|
195
|
+
*
|
|
196
|
+
* @see https://owasp.org/Top10/2025/
|
|
197
|
+
*/
|
|
198
|
+
exports.CWE_MAPPING = {
|
|
199
|
+
// =========================================================================
|
|
200
|
+
// A01:2025 - Broken Access Control
|
|
201
|
+
// =========================================================================
|
|
202
|
+
'CWE-22': {
|
|
203
|
+
owasp: 'A01:2025',
|
|
204
|
+
cvss: 7.5,
|
|
205
|
+
severity: 'HIGH',
|
|
206
|
+
name: 'Path Traversal',
|
|
207
|
+
},
|
|
208
|
+
'CWE-269': {
|
|
209
|
+
owasp: 'A01:2025',
|
|
210
|
+
cvss: 8.8,
|
|
211
|
+
severity: 'HIGH',
|
|
212
|
+
name: 'Improper Privilege Management',
|
|
213
|
+
},
|
|
214
|
+
'CWE-284': {
|
|
215
|
+
owasp: 'A01:2025',
|
|
216
|
+
cvss: 7.5,
|
|
217
|
+
severity: 'HIGH',
|
|
218
|
+
name: 'Improper Access Control',
|
|
219
|
+
},
|
|
220
|
+
'CWE-352': {
|
|
221
|
+
owasp: 'A01:2025',
|
|
222
|
+
cvss: 8.8,
|
|
223
|
+
severity: 'HIGH',
|
|
224
|
+
name: 'Cross-Site Request Forgery (CSRF)',
|
|
225
|
+
},
|
|
226
|
+
'CWE-639': {
|
|
227
|
+
owasp: 'A01:2025',
|
|
228
|
+
cvss: 8.1,
|
|
229
|
+
severity: 'HIGH',
|
|
230
|
+
name: 'Insecure Direct Object Reference',
|
|
231
|
+
},
|
|
232
|
+
'CWE-862': {
|
|
233
|
+
owasp: 'A01:2025',
|
|
234
|
+
cvss: 8.1,
|
|
235
|
+
severity: 'HIGH',
|
|
236
|
+
name: 'Missing Authorization',
|
|
237
|
+
},
|
|
238
|
+
'CWE-863': {
|
|
239
|
+
owasp: 'A01:2025',
|
|
240
|
+
cvss: 8.1,
|
|
241
|
+
severity: 'HIGH',
|
|
242
|
+
name: 'Incorrect Authorization',
|
|
243
|
+
},
|
|
244
|
+
'CWE-915': {
|
|
245
|
+
owasp: 'A01:2025',
|
|
246
|
+
cvss: 9.8,
|
|
247
|
+
severity: 'CRITICAL',
|
|
248
|
+
name: 'Object Injection',
|
|
249
|
+
},
|
|
250
|
+
'CWE-942': {
|
|
251
|
+
owasp: 'A01:2025',
|
|
252
|
+
cvss: 7.5,
|
|
253
|
+
severity: 'HIGH',
|
|
254
|
+
name: 'CORS Misconfiguration',
|
|
255
|
+
},
|
|
256
|
+
'CWE-918': {
|
|
257
|
+
owasp: 'A01:2025',
|
|
258
|
+
cvss: 9.1,
|
|
259
|
+
severity: 'CRITICAL',
|
|
260
|
+
name: 'Server-Side Request Forgery (SSRF)',
|
|
261
|
+
},
|
|
262
|
+
// =========================================================================
|
|
263
|
+
// A02:2025 - Security Misconfiguration
|
|
264
|
+
// =========================================================================
|
|
265
|
+
'CWE-16': {
|
|
266
|
+
owasp: 'A02:2025',
|
|
267
|
+
cvss: 5.3,
|
|
268
|
+
severity: 'MEDIUM',
|
|
269
|
+
name: 'Configuration',
|
|
270
|
+
},
|
|
271
|
+
'CWE-209': {
|
|
272
|
+
owasp: 'A02:2025',
|
|
273
|
+
cvss: 5.3,
|
|
274
|
+
severity: 'MEDIUM',
|
|
275
|
+
name: 'Error Information Exposure',
|
|
276
|
+
},
|
|
277
|
+
'CWE-614': {
|
|
278
|
+
owasp: 'A02:2025',
|
|
279
|
+
cvss: 5.3,
|
|
280
|
+
severity: 'MEDIUM',
|
|
281
|
+
name: 'Sensitive Cookie in HTTPS without Secure',
|
|
282
|
+
},
|
|
283
|
+
'CWE-1004': {
|
|
284
|
+
owasp: 'A02:2025',
|
|
285
|
+
cvss: 5.3,
|
|
286
|
+
severity: 'MEDIUM',
|
|
287
|
+
name: 'Sensitive Cookie Without HttpOnly',
|
|
288
|
+
},
|
|
289
|
+
'CWE-1275': {
|
|
290
|
+
owasp: 'A02:2025',
|
|
291
|
+
cvss: 5.3,
|
|
292
|
+
severity: 'MEDIUM',
|
|
293
|
+
name: 'Sensitive Cookie with Improper SameSite',
|
|
294
|
+
},
|
|
295
|
+
// =========================================================================
|
|
296
|
+
// A03:2025 - Software Supply Chain Failures (NEW in 2025)
|
|
297
|
+
// =========================================================================
|
|
298
|
+
'CWE-426': {
|
|
299
|
+
owasp: 'A03:2025',
|
|
300
|
+
cvss: 7.5,
|
|
301
|
+
severity: 'HIGH',
|
|
302
|
+
name: 'Untrusted Search Path',
|
|
303
|
+
},
|
|
304
|
+
'CWE-427': {
|
|
305
|
+
owasp: 'A03:2025',
|
|
306
|
+
cvss: 7.8,
|
|
307
|
+
severity: 'HIGH',
|
|
308
|
+
name: 'Uncontrolled Search Path Element',
|
|
309
|
+
},
|
|
310
|
+
'CWE-431': {
|
|
311
|
+
owasp: 'A03:2025',
|
|
312
|
+
cvss: 7.5,
|
|
313
|
+
severity: 'HIGH',
|
|
314
|
+
name: 'Missing Handler',
|
|
315
|
+
},
|
|
316
|
+
'CWE-829': {
|
|
317
|
+
owasp: 'A03:2025',
|
|
318
|
+
cvss: 7.5,
|
|
319
|
+
severity: 'HIGH',
|
|
320
|
+
name: 'Untrusted Control Sphere Inclusion',
|
|
321
|
+
},
|
|
322
|
+
'CWE-937': {
|
|
323
|
+
owasp: 'A03:2025',
|
|
324
|
+
cvss: 7.5,
|
|
325
|
+
severity: 'HIGH',
|
|
326
|
+
name: 'Using Components with Known Vulnerabilities',
|
|
327
|
+
},
|
|
328
|
+
'CWE-1035': {
|
|
329
|
+
owasp: 'A03:2025',
|
|
330
|
+
cvss: 7.5,
|
|
331
|
+
severity: 'HIGH',
|
|
332
|
+
name: 'Vulnerable Third-Party Component',
|
|
333
|
+
},
|
|
334
|
+
'CWE-1078': {
|
|
335
|
+
owasp: 'A03:2025',
|
|
336
|
+
cvss: 5.3,
|
|
337
|
+
severity: 'MEDIUM',
|
|
338
|
+
name: 'Deprecated API',
|
|
339
|
+
},
|
|
340
|
+
'CWE-1104': {
|
|
341
|
+
owasp: 'A03:2025',
|
|
342
|
+
cvss: 5.3,
|
|
343
|
+
severity: 'MEDIUM',
|
|
344
|
+
name: 'Unmaintainable Third-Party Components',
|
|
345
|
+
},
|
|
346
|
+
// =========================================================================
|
|
347
|
+
// A04:2025 - Cryptographic Failures
|
|
348
|
+
// =========================================================================
|
|
349
|
+
'CWE-327': {
|
|
350
|
+
owasp: 'A04:2025',
|
|
351
|
+
cvss: 7.5,
|
|
352
|
+
severity: 'HIGH',
|
|
353
|
+
name: 'Broken Cryptographic Algorithm',
|
|
354
|
+
},
|
|
355
|
+
'CWE-328': {
|
|
356
|
+
owasp: 'A04:2025',
|
|
357
|
+
cvss: 7.5,
|
|
358
|
+
severity: 'HIGH',
|
|
359
|
+
name: 'Reversible One-Way Hash',
|
|
360
|
+
},
|
|
361
|
+
'CWE-330': {
|
|
362
|
+
owasp: 'A04:2025',
|
|
363
|
+
cvss: 5.3,
|
|
364
|
+
severity: 'MEDIUM',
|
|
365
|
+
name: 'Insufficient Randomness',
|
|
366
|
+
},
|
|
367
|
+
'CWE-331': {
|
|
368
|
+
owasp: 'A04:2025',
|
|
369
|
+
cvss: 5.3,
|
|
370
|
+
severity: 'MEDIUM',
|
|
371
|
+
name: 'Insufficient Entropy',
|
|
372
|
+
},
|
|
373
|
+
'CWE-338': {
|
|
374
|
+
owasp: 'A04:2025',
|
|
375
|
+
cvss: 5.3,
|
|
376
|
+
severity: 'MEDIUM',
|
|
377
|
+
name: 'Weak PRNG',
|
|
378
|
+
},
|
|
379
|
+
'CWE-759': {
|
|
380
|
+
owasp: 'A04:2025',
|
|
381
|
+
cvss: 7.5,
|
|
382
|
+
severity: 'HIGH',
|
|
383
|
+
name: 'One-Way Hash without Salt',
|
|
384
|
+
},
|
|
385
|
+
'CWE-798': {
|
|
386
|
+
owasp: 'A04:2025',
|
|
387
|
+
cvss: 9.8,
|
|
388
|
+
severity: 'CRITICAL',
|
|
389
|
+
name: 'Hardcoded Credentials',
|
|
390
|
+
},
|
|
391
|
+
'CWE-326': {
|
|
392
|
+
owasp: 'A04:2025',
|
|
393
|
+
cvss: 5.9,
|
|
394
|
+
severity: 'MEDIUM',
|
|
395
|
+
name: 'Inadequate Encryption Strength',
|
|
396
|
+
},
|
|
397
|
+
'CWE-311': {
|
|
398
|
+
owasp: 'A04:2025',
|
|
399
|
+
cvss: 7.5,
|
|
400
|
+
severity: 'HIGH',
|
|
401
|
+
name: 'Missing Encryption of Sensitive Data',
|
|
402
|
+
},
|
|
403
|
+
// =========================================================================
|
|
404
|
+
// A05:2025 - Injection
|
|
405
|
+
// =========================================================================
|
|
406
|
+
'CWE-89': {
|
|
407
|
+
owasp: 'A05:2025',
|
|
408
|
+
cvss: 9.8,
|
|
409
|
+
severity: 'CRITICAL',
|
|
410
|
+
name: 'SQL Injection',
|
|
411
|
+
},
|
|
412
|
+
'CWE-78': {
|
|
413
|
+
owasp: 'A05:2025',
|
|
414
|
+
cvss: 9.8,
|
|
415
|
+
severity: 'CRITICAL',
|
|
416
|
+
name: 'OS Command Injection',
|
|
417
|
+
},
|
|
418
|
+
'CWE-79': {
|
|
419
|
+
owasp: 'A05:2025',
|
|
420
|
+
cvss: 6.1,
|
|
421
|
+
severity: 'MEDIUM',
|
|
422
|
+
name: 'Cross-site Scripting (XSS)',
|
|
423
|
+
},
|
|
424
|
+
'CWE-94': {
|
|
425
|
+
owasp: 'A05:2025',
|
|
426
|
+
cvss: 9.8,
|
|
427
|
+
severity: 'CRITICAL',
|
|
428
|
+
name: 'Code Injection',
|
|
429
|
+
},
|
|
430
|
+
'CWE-95': {
|
|
431
|
+
owasp: 'A05:2025',
|
|
432
|
+
cvss: 9.8,
|
|
433
|
+
severity: 'CRITICAL',
|
|
434
|
+
name: 'Eval Injection',
|
|
435
|
+
},
|
|
436
|
+
'CWE-917': {
|
|
437
|
+
owasp: 'A05:2025',
|
|
438
|
+
cvss: 9.8,
|
|
439
|
+
severity: 'CRITICAL',
|
|
440
|
+
name: 'Expression Language Injection',
|
|
441
|
+
},
|
|
442
|
+
'CWE-1321': {
|
|
443
|
+
owasp: 'A05:2025',
|
|
444
|
+
cvss: 9.8,
|
|
445
|
+
severity: 'CRITICAL',
|
|
446
|
+
name: 'Prototype Pollution',
|
|
447
|
+
},
|
|
448
|
+
'CWE-77': {
|
|
449
|
+
owasp: 'A05:2025',
|
|
450
|
+
cvss: 9.8,
|
|
451
|
+
severity: 'CRITICAL',
|
|
452
|
+
name: 'Command Injection',
|
|
453
|
+
},
|
|
454
|
+
'CWE-90': {
|
|
455
|
+
owasp: 'A05:2025',
|
|
456
|
+
cvss: 9.8,
|
|
457
|
+
severity: 'CRITICAL',
|
|
458
|
+
name: 'LDAP Injection',
|
|
459
|
+
},
|
|
460
|
+
'CWE-611': {
|
|
461
|
+
owasp: 'A05:2025',
|
|
462
|
+
cvss: 9.1,
|
|
463
|
+
severity: 'CRITICAL',
|
|
464
|
+
name: 'XXE (XML External Entity)',
|
|
465
|
+
},
|
|
466
|
+
// =========================================================================
|
|
467
|
+
// A06:2025 - Insecure Design
|
|
468
|
+
// =========================================================================
|
|
469
|
+
'CWE-20': {
|
|
470
|
+
owasp: 'A06:2025',
|
|
471
|
+
cvss: 7.5,
|
|
472
|
+
severity: 'HIGH',
|
|
473
|
+
name: 'Improper Input Validation',
|
|
474
|
+
},
|
|
475
|
+
'CWE-400': {
|
|
476
|
+
owasp: 'A06:2025',
|
|
477
|
+
cvss: 7.5,
|
|
478
|
+
severity: 'HIGH',
|
|
479
|
+
name: 'Uncontrolled Resource Consumption (ReDoS)',
|
|
480
|
+
},
|
|
481
|
+
'CWE-407': {
|
|
482
|
+
owasp: 'A06:2025',
|
|
483
|
+
cvss: 5.3,
|
|
484
|
+
severity: 'MEDIUM',
|
|
485
|
+
name: 'Circular Dependencies',
|
|
486
|
+
},
|
|
487
|
+
'CWE-697': {
|
|
488
|
+
owasp: 'A06:2025',
|
|
489
|
+
cvss: 5.3,
|
|
490
|
+
severity: 'MEDIUM',
|
|
491
|
+
name: 'Incorrect Comparison',
|
|
492
|
+
},
|
|
493
|
+
'CWE-602': {
|
|
494
|
+
owasp: 'A06:2025',
|
|
495
|
+
cvss: 6.5,
|
|
496
|
+
severity: 'MEDIUM',
|
|
497
|
+
name: 'Client-Side Enforcement of Server-Side Security',
|
|
498
|
+
},
|
|
499
|
+
'CWE-656': {
|
|
500
|
+
owasp: 'A06:2025',
|
|
501
|
+
cvss: 5.3,
|
|
502
|
+
severity: 'MEDIUM',
|
|
503
|
+
name: 'Reliance on Security Through Obscurity',
|
|
504
|
+
},
|
|
505
|
+
'CWE-799': {
|
|
506
|
+
owasp: 'A06:2025',
|
|
507
|
+
cvss: 5.3,
|
|
508
|
+
severity: 'MEDIUM',
|
|
509
|
+
name: 'Improper Control of Interaction Frequency',
|
|
510
|
+
},
|
|
511
|
+
// =========================================================================
|
|
512
|
+
// A07:2025 - Authentication Failures
|
|
513
|
+
// =========================================================================
|
|
514
|
+
'CWE-287': {
|
|
515
|
+
owasp: 'A07:2025',
|
|
516
|
+
cvss: 9.8,
|
|
517
|
+
severity: 'CRITICAL',
|
|
518
|
+
name: 'Improper Authentication',
|
|
519
|
+
},
|
|
520
|
+
'CWE-306': {
|
|
521
|
+
owasp: 'A07:2025',
|
|
522
|
+
cvss: 9.8,
|
|
523
|
+
severity: 'CRITICAL',
|
|
524
|
+
name: 'Missing Authentication',
|
|
525
|
+
},
|
|
526
|
+
'CWE-307': {
|
|
527
|
+
owasp: 'A07:2025',
|
|
528
|
+
cvss: 7.5,
|
|
529
|
+
severity: 'HIGH',
|
|
530
|
+
name: 'Improper Restriction of Authentication Attempts',
|
|
531
|
+
},
|
|
532
|
+
'CWE-521': {
|
|
533
|
+
owasp: 'A07:2025',
|
|
534
|
+
cvss: 5.3,
|
|
535
|
+
severity: 'MEDIUM',
|
|
536
|
+
name: 'Weak Password Requirements',
|
|
537
|
+
},
|
|
538
|
+
'CWE-613': {
|
|
539
|
+
owasp: 'A07:2025',
|
|
540
|
+
cvss: 5.4,
|
|
541
|
+
severity: 'MEDIUM',
|
|
542
|
+
name: 'Insufficient Session Expiration',
|
|
543
|
+
},
|
|
544
|
+
'CWE-384': {
|
|
545
|
+
owasp: 'A07:2025',
|
|
546
|
+
cvss: 8.1,
|
|
547
|
+
severity: 'HIGH',
|
|
548
|
+
name: 'Session Fixation',
|
|
549
|
+
},
|
|
550
|
+
'CWE-620': {
|
|
551
|
+
owasp: 'A07:2025',
|
|
552
|
+
cvss: 6.8,
|
|
553
|
+
severity: 'MEDIUM',
|
|
554
|
+
name: 'Unverified Password Change',
|
|
555
|
+
},
|
|
556
|
+
// =========================================================================
|
|
557
|
+
// A08:2025 - Software or Data Integrity Failures
|
|
558
|
+
// =========================================================================
|
|
559
|
+
'CWE-345': {
|
|
560
|
+
owasp: 'A08:2025',
|
|
561
|
+
cvss: 7.5,
|
|
562
|
+
severity: 'HIGH',
|
|
563
|
+
name: 'Insufficient Verification of Data Authenticity',
|
|
564
|
+
},
|
|
565
|
+
'CWE-502': {
|
|
566
|
+
owasp: 'A08:2025',
|
|
567
|
+
cvss: 9.8,
|
|
568
|
+
severity: 'CRITICAL',
|
|
569
|
+
name: 'Deserialization of Untrusted Data',
|
|
570
|
+
},
|
|
571
|
+
'CWE-494': {
|
|
572
|
+
owasp: 'A08:2025',
|
|
573
|
+
cvss: 8.1,
|
|
574
|
+
severity: 'HIGH',
|
|
575
|
+
name: 'Download of Code Without Integrity Check',
|
|
576
|
+
},
|
|
577
|
+
'CWE-353': {
|
|
578
|
+
owasp: 'A08:2025',
|
|
579
|
+
cvss: 6.5,
|
|
580
|
+
severity: 'MEDIUM',
|
|
581
|
+
name: 'Missing Support for Integrity Check',
|
|
582
|
+
},
|
|
583
|
+
// =========================================================================
|
|
584
|
+
// A09:2025 - Logging & Alerting Failures
|
|
585
|
+
// =========================================================================
|
|
586
|
+
'CWE-117': {
|
|
587
|
+
owasp: 'A09:2025',
|
|
588
|
+
cvss: 5.3,
|
|
589
|
+
severity: 'MEDIUM',
|
|
590
|
+
name: 'Improper Output Neutralization for Logs',
|
|
591
|
+
},
|
|
592
|
+
'CWE-223': {
|
|
593
|
+
owasp: 'A09:2025',
|
|
594
|
+
cvss: 5.3,
|
|
595
|
+
severity: 'MEDIUM',
|
|
596
|
+
name: 'Omission of Security-relevant Information',
|
|
597
|
+
},
|
|
598
|
+
'CWE-532': {
|
|
599
|
+
owasp: 'A09:2025',
|
|
600
|
+
cvss: 5.3,
|
|
601
|
+
severity: 'MEDIUM',
|
|
602
|
+
name: 'Log Information Exposure',
|
|
603
|
+
},
|
|
604
|
+
'CWE-778': {
|
|
605
|
+
owasp: 'A09:2025',
|
|
606
|
+
cvss: 5.3,
|
|
607
|
+
severity: 'MEDIUM',
|
|
608
|
+
name: 'Insufficient Logging',
|
|
609
|
+
},
|
|
610
|
+
'CWE-779': {
|
|
611
|
+
owasp: 'A09:2025',
|
|
612
|
+
cvss: 7.5,
|
|
613
|
+
severity: 'HIGH',
|
|
614
|
+
name: 'Logging of Excessive Data',
|
|
615
|
+
},
|
|
616
|
+
// =========================================================================
|
|
617
|
+
// A10:2025 - Mishandling of Exceptional Conditions (NEW in 2025)
|
|
618
|
+
// =========================================================================
|
|
619
|
+
'CWE-252': {
|
|
620
|
+
owasp: 'A10:2025',
|
|
621
|
+
cvss: 5.3,
|
|
622
|
+
severity: 'MEDIUM',
|
|
623
|
+
name: 'Unchecked Return Value',
|
|
624
|
+
},
|
|
625
|
+
'CWE-248': {
|
|
626
|
+
owasp: 'A10:2025',
|
|
627
|
+
cvss: 7.5,
|
|
628
|
+
severity: 'HIGH',
|
|
629
|
+
name: 'Uncaught Exception',
|
|
630
|
+
},
|
|
631
|
+
'CWE-390': {
|
|
632
|
+
owasp: 'A10:2025',
|
|
633
|
+
cvss: 5.3,
|
|
634
|
+
severity: 'MEDIUM',
|
|
635
|
+
name: 'Detection of Error Condition Without Action',
|
|
636
|
+
},
|
|
637
|
+
'CWE-391': {
|
|
638
|
+
owasp: 'A10:2025',
|
|
639
|
+
cvss: 5.3,
|
|
640
|
+
severity: 'MEDIUM',
|
|
641
|
+
name: 'Unchecked Error Condition',
|
|
642
|
+
},
|
|
643
|
+
'CWE-392': {
|
|
644
|
+
owasp: 'A10:2025',
|
|
645
|
+
cvss: 7.5,
|
|
646
|
+
severity: 'HIGH',
|
|
647
|
+
name: 'Missing Report of Error Condition',
|
|
648
|
+
},
|
|
649
|
+
'CWE-397': {
|
|
650
|
+
owasp: 'A10:2025',
|
|
651
|
+
cvss: 5.3,
|
|
652
|
+
severity: 'MEDIUM',
|
|
653
|
+
name: 'Throwing Generic Exception',
|
|
654
|
+
},
|
|
655
|
+
'CWE-754': {
|
|
656
|
+
owasp: 'A10:2025',
|
|
657
|
+
cvss: 7.5,
|
|
658
|
+
severity: 'HIGH',
|
|
659
|
+
name: 'Improper Check for Unusual Conditions',
|
|
660
|
+
},
|
|
661
|
+
'CWE-755': {
|
|
662
|
+
owasp: 'A10:2025',
|
|
663
|
+
cvss: 7.5,
|
|
664
|
+
severity: 'HIGH',
|
|
665
|
+
name: 'Improper Handling of Exceptional Conditions',
|
|
666
|
+
},
|
|
667
|
+
};
|
|
668
|
+
// ============================================================================
|
|
669
|
+
// COMPLIANCE FRAMEWORKS
|
|
670
|
+
// ============================================================================
|
|
671
|
+
/**
|
|
672
|
+
* Maps CWE categories to relevant compliance frameworks
|
|
673
|
+
*/
|
|
674
|
+
exports.CWE_COMPLIANCE_MAPPING = {
|
|
675
|
+
// Injection - All frameworks care about data integrity
|
|
676
|
+
'CWE-89': ['SOC2', 'PCI-DSS', 'HIPAA', 'ISO27001'],
|
|
677
|
+
'CWE-78': ['SOC2', 'PCI-DSS', 'ISO27001', 'NIST-CSF'],
|
|
678
|
+
'CWE-79': ['SOC2', 'PCI-DSS', 'GDPR', 'ISO27001'],
|
|
679
|
+
'CWE-94': ['SOC2', 'PCI-DSS', 'ISO27001'],
|
|
680
|
+
'CWE-95': ['SOC2', 'PCI-DSS', 'ISO27001'],
|
|
681
|
+
// Access Control - Critical for all frameworks
|
|
682
|
+
'CWE-22': ['SOC2', 'PCI-DSS', 'HIPAA', 'ISO27001'],
|
|
683
|
+
'CWE-269': ['SOC2', 'PCI-DSS', 'HIPAA', 'GDPR', 'ISO27001'],
|
|
684
|
+
'CWE-306': ['SOC2', 'PCI-DSS', 'HIPAA', 'GDPR', 'ISO27001', 'NIST-CSF'],
|
|
685
|
+
'CWE-862': ['SOC2', 'PCI-DSS', 'HIPAA', 'ISO27001'],
|
|
686
|
+
'CWE-915': ['SOC2', 'PCI-DSS', 'ISO27001'],
|
|
687
|
+
// Cryptographic - PCI-DSS, HIPAA especially strict
|
|
688
|
+
'CWE-327': ['PCI-DSS', 'HIPAA', 'ISO27001', 'NIST-CSF'],
|
|
689
|
+
'CWE-330': ['PCI-DSS', 'ISO27001'],
|
|
690
|
+
'CWE-798': ['SOC2', 'PCI-DSS', 'HIPAA', 'GDPR', 'ISO27001', 'NIST-CSF'],
|
|
691
|
+
// Data Protection - GDPR, HIPAA critical
|
|
692
|
+
'CWE-20': ['SOC2', 'PCI-DSS', 'HIPAA', 'GDPR', 'ISO27001'],
|
|
693
|
+
'CWE-200': ['GDPR', 'HIPAA', 'PCI-DSS', 'SOC2'],
|
|
694
|
+
'CWE-532': ['GDPR', 'HIPAA', 'PCI-DSS', 'SOC2'],
|
|
695
|
+
// Logging - SOC2, ISO27001 require logging
|
|
696
|
+
'CWE-778': ['SOC2', 'ISO27001', 'PCI-DSS', 'NIST-CSF'],
|
|
697
|
+
};
|
|
698
|
+
// ============================================================================
|
|
699
|
+
// ICON CONSTANTS
|
|
700
|
+
// ============================================================================
|
|
701
|
+
/**
|
|
702
|
+
* Common icon constants for consistency
|
|
703
|
+
*/
|
|
704
|
+
exports.MessageIcons = {
|
|
705
|
+
/** Security issues */
|
|
706
|
+
SECURITY: 'đ',
|
|
707
|
+
/** Warnings */
|
|
708
|
+
WARNING: 'â ī¸',
|
|
709
|
+
/** Package/dependency issues */
|
|
710
|
+
PACKAGE: 'đĻ',
|
|
711
|
+
/** Development practices */
|
|
712
|
+
DEVELOPMENT: 'đ§',
|
|
713
|
+
/** Performance issues */
|
|
714
|
+
PERFORMANCE: 'âĄ',
|
|
715
|
+
/** Accessibility issues */
|
|
716
|
+
ACCESSIBILITY: 'âŋ',
|
|
717
|
+
/** Code quality */
|
|
718
|
+
QUALITY: 'đ',
|
|
719
|
+
/** Architecture issues */
|
|
720
|
+
ARCHITECTURE: 'đī¸',
|
|
721
|
+
/** Migration/refactoring */
|
|
722
|
+
MIGRATION: 'đ',
|
|
723
|
+
/** Deprecation */
|
|
724
|
+
DEPRECATION: 'â',
|
|
725
|
+
/** Domain/DDD */
|
|
726
|
+
DOMAIN: 'đ',
|
|
727
|
+
/** Complexity */
|
|
728
|
+
COMPLEXITY: 'đ§ ',
|
|
729
|
+
/** Duplication */
|
|
730
|
+
DUPLICATION: 'đ',
|
|
731
|
+
/** Information/suggestions */
|
|
732
|
+
INFO: 'âšī¸',
|
|
733
|
+
/** Success/fix applied */
|
|
734
|
+
SUCCESS: 'â
',
|
|
735
|
+
/** Strategy/approach */
|
|
736
|
+
STRATEGY: 'đ¯',
|
|
737
|
+
/** Authentication */
|
|
738
|
+
AUTH: 'đ',
|
|
739
|
+
/** Data protection */
|
|
740
|
+
DATA: 'đĄī¸',
|
|
741
|
+
/** Compliance */
|
|
742
|
+
COMPLIANCE: 'đ',
|
|
743
|
+
};
|
|
744
|
+
//# sourceMappingURL=constants.js.map
|