@zerothreatai/vulnerability-registry 3.0.0 → 5.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.
Files changed (77) hide show
  1. package/dist/categories/authentication.js +34 -17
  2. package/dist/categories/configuration.js +561 -60
  3. package/dist/categories/injection.js +68 -34
  4. package/dist/categories/sensitive-paths.js +168 -84
  5. package/dist/categories/ssrf.js +22 -11
  6. package/dist/categories/xss.js +30 -15
  7. package/dist/category.d.ts +6 -0
  8. package/dist/category.js +15 -0
  9. package/dist/error-codes.d.ts +20 -0
  10. package/dist/error-codes.js +20 -0
  11. package/dist/index.d.ts +9 -1
  12. package/dist/index.js +5 -1
  13. package/dist/scanner.d.ts +6 -0
  14. package/dist/scanner.js +22 -0
  15. package/dist/types.d.ts +2 -0
  16. package/dist-cjs/categories/authentication.js +34 -17
  17. package/dist-cjs/categories/configuration.js +561 -60
  18. package/dist-cjs/categories/injection.js +68 -34
  19. package/dist-cjs/categories/sensitive-paths.js +168 -84
  20. package/dist-cjs/categories/ssrf.js +22 -11
  21. package/dist-cjs/categories/xss.js +30 -15
  22. package/dist-cjs/category.js +18 -0
  23. package/dist-cjs/error-codes.js +20 -0
  24. package/dist-cjs/index.js +7 -1
  25. package/dist-cjs/scanner.js +25 -0
  26. package/package.json +35 -32
  27. package/scripts/assign-ids.ts +105 -0
  28. package/scripts/check-duplicate-ids.ts +45 -0
  29. package/src/categories/authentication.ts +145 -128
  30. package/src/categories/configuration.ts +1632 -1111
  31. package/src/categories/injection.ts +158 -124
  32. package/src/categories/sensitive-paths.ts +168 -84
  33. package/src/categories/ssrf.ts +22 -11
  34. package/src/categories/xss.ts +30 -15
  35. package/src/category.ts +16 -0
  36. package/src/error-codes.ts +25 -5
  37. package/src/id-registry.json +1235 -0
  38. package/src/index.ts +20 -14
  39. package/src/scanner.ts +23 -0
  40. package/src/types.ts +4 -2
  41. package/zerothreatai-vulnerability-registry-4npm .0.0.tgz +0 -0
  42. package/src/categories/authentication.d.ts +0 -8
  43. package/src/categories/authentication.d.ts.map +0 -1
  44. package/src/categories/authentication.js +0 -378
  45. package/src/categories/authentication.js.map +0 -1
  46. package/src/categories/configuration.d.ts +0 -8
  47. package/src/categories/configuration.d.ts.map +0 -1
  48. package/src/categories/configuration.js +0 -906
  49. package/src/categories/configuration.js.map +0 -1
  50. package/src/categories/injection.d.ts +0 -8
  51. package/src/categories/injection.d.ts.map +0 -1
  52. package/src/categories/injection.js +0 -750
  53. package/src/categories/injection.js.map +0 -1
  54. package/src/categories/sensitive-paths.d.ts +0 -9
  55. package/src/categories/sensitive-paths.d.ts.map +0 -1
  56. package/src/categories/sensitive-paths.js +0 -1791
  57. package/src/categories/sensitive-paths.js.map +0 -1
  58. package/src/categories/ssrf.d.ts +0 -8
  59. package/src/categories/ssrf.d.ts.map +0 -1
  60. package/src/categories/ssrf.js +0 -250
  61. package/src/categories/ssrf.js.map +0 -1
  62. package/src/categories/xss.d.ts +0 -7
  63. package/src/categories/xss.d.ts.map +0 -1
  64. package/src/categories/xss.js +0 -328
  65. package/src/categories/xss.js.map +0 -1
  66. package/src/error-codes.d.ts +0 -242
  67. package/src/error-codes.d.ts.map +0 -1
  68. package/src/error-codes.js +0 -315
  69. package/src/error-codes.js.map +0 -1
  70. package/src/index.d.ts +0 -60
  71. package/src/index.d.ts.map +0 -1
  72. package/src/index.js +0 -107
  73. package/src/index.js.map +0 -1
  74. package/src/types.d.ts +0 -86
  75. package/src/types.d.ts.map +0 -1
  76. package/src/types.js +0 -7
  77. package/src/types.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ const ROOT = path.resolve("D:/new-git-project/agents/shared/vulnerability-registry");
5
+ const REGISTRY_PATH = path.join(ROOT, "src", "id-registry.json");
6
+
7
+ type RegistryEntry = {
8
+ id: number;
9
+ code: string;
10
+ };
11
+
12
+ function main(): void {
13
+ if (!fs.existsSync(REGISTRY_PATH)) {
14
+ throw new Error(`Missing registry file: ${REGISTRY_PATH}`);
15
+ }
16
+ const raw = fs.readFileSync(REGISTRY_PATH, "utf-8");
17
+ const data = JSON.parse(raw);
18
+ const entries: RegistryEntry[] = data.entries ?? [];
19
+
20
+ const seen = new Map<number, string>();
21
+ const duplicates = new Map<number, string[]>();
22
+
23
+ for (const entry of entries) {
24
+ if (seen.has(entry.id)) {
25
+ const existing = seen.get(entry.id)!;
26
+ const list = duplicates.get(entry.id) ?? [existing];
27
+ list.push(entry.code);
28
+ duplicates.set(entry.id, list);
29
+ } else {
30
+ seen.set(entry.id, entry.code);
31
+ }
32
+ }
33
+
34
+ if (duplicates.size > 0) {
35
+ const lines: string[] = [];
36
+ for (const [id, codes] of Array.from(duplicates.entries()).sort((a, b) => a[0] - b[0])) {
37
+ lines.push(`${id}: ${codes.join(", ")}`);
38
+ }
39
+ throw new Error(`Duplicate vulnerability IDs found:\n${lines.join("\n")}`);
40
+ }
41
+
42
+ console.log("OK: No duplicate vulnerability IDs in id-registry.json");
43
+ }
44
+
45
+ main();
@@ -12,11 +12,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
12
12
  // JWT VULNERABILITIES
13
13
  // ========================================
14
14
  [VulnerabilityCode.JWT_NONE_ALGORITHM]: {
15
- id: 57,
15
+ id: 100,
16
16
  code: VulnerabilityCode.JWT_NONE_ALGORITHM,
17
17
  title: 'JWT Vulnerability - None Algorithm Attack',
18
18
  description: 'Critical JWT vulnerability where the server accepts tokens with "alg": "none" in the header, allowing attackers to forge valid tokens without knowing the secret key by simply removing the signature and modifying claims to impersonate any user including administrators.',
19
19
  severity: 'critical',
20
+ levelId: 1,
20
21
  category: 'authentication',
21
22
  scanner: 'jwt',
22
23
  cvss: {
@@ -34,11 +35,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
34
35
  },
35
36
 
36
37
  [VulnerabilityCode.JWT_WEAK_SECRET]: {
37
- id: 58,
38
+ id: 101,
38
39
  code: VulnerabilityCode.JWT_WEAK_SECRET,
39
40
  title: 'JWT Vulnerability - Weak Secret Key',
40
41
  description: 'JWT implementation using a weak or common secret key for HMAC signature verification that can be brute-forced or found in common secret dictionaries, allowing attackers to forge arbitrary valid tokens and bypass authentication to access any user account.',
41
42
  severity: 'high',
43
+ levelId: 2,
42
44
  category: 'authentication',
43
45
  scanner: 'jwt',
44
46
  cvss: {
@@ -56,11 +58,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
56
58
  },
57
59
 
58
60
  [VulnerabilityCode.JWT_KEY_CONFUSION]: {
59
- id: 59,
61
+ id: 102,
60
62
  code: VulnerabilityCode.JWT_KEY_CONFUSION,
61
63
  title: 'JWT Vulnerability - Algorithm Confusion Attack',
62
64
  description: 'JWT key confusion vulnerability where the server public key can be used as an HMAC secret by switching the algorithm from RS256 to HS256, allowing attackers to forge valid tokens using the publicly available key to generate valid HMAC signatures.',
63
65
  severity: 'critical',
66
+ levelId: 1,
64
67
  category: 'authentication',
65
68
  scanner: 'jwt',
66
69
  cvss: {
@@ -81,11 +84,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
81
84
  // BROKEN ACCESS CONTROL
82
85
  // ========================================
83
86
  [VulnerabilityCode.BAC_ANONYMOUS_ACCESS]: {
84
- id: 60,
87
+ id: 103,
85
88
  code: VulnerabilityCode.BAC_ANONYMOUS_ACCESS,
86
89
  title: 'Broken Access Control - Anonymous Access',
87
90
  description: 'Critical broken access control vulnerability where authenticated endpoints can be accessed without any authentication by simply removing auth headers or cookies, exposing sensitive functionality and data to unauthenticated attackers without any credential requirement.',
88
91
  severity: 'high',
92
+ levelId: 2,
89
93
  category: 'access_control',
90
94
  scanner: 'broken-access',
91
95
  cvss: {
@@ -103,11 +107,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
103
107
  },
104
108
 
105
109
  [VulnerabilityCode.BAC_IDOR]: {
106
- id: 61,
110
+ id: 104,
107
111
  code: VulnerabilityCode.BAC_IDOR,
108
112
  title: 'Broken Access Control - Insecure Direct Object Reference',
109
113
  description: 'IDOR vulnerability where users can access or modify resources belonging to other users by manipulating predictable identifiers like sequential IDs in URLs or request parameters, without proper authorization checks verifying resource ownership.',
110
114
  severity: 'high',
115
+ levelId: 2,
111
116
  category: 'access_control',
112
117
  scanner: 'broken-access',
113
118
  cvss: {
@@ -125,11 +130,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
125
130
  },
126
131
 
127
132
  [VulnerabilityCode.BAC_VERTICAL_PRIVILEGE]: {
128
- id: 62,
133
+ id: 105,
129
134
  code: VulnerabilityCode.BAC_VERTICAL_PRIVILEGE,
130
135
  title: 'Broken Access Control - Vertical Privilege Escalation',
131
136
  description: 'Vertical privilege escalation vulnerability allowing regular users to access or perform administrative functions by directly accessing admin endpoints or manipulating role/permission parameters, bypassing role-based access controls to gain elevated privileges.',
132
137
  severity: 'critical',
138
+ levelId: 1,
133
139
  category: 'access_control',
134
140
  scanner: 'broken-access',
135
141
  cvss: {
@@ -150,11 +156,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
150
156
  // MASS ASSIGNMENT
151
157
  // ========================================
152
158
  [VulnerabilityCode.MASSASSIGN_ROLE_ESCALATION]: {
153
- id: 63,
159
+ id: 106,
154
160
  code: VulnerabilityCode.MASSASSIGN_ROLE_ESCALATION,
155
161
  title: 'Mass Assignment - Role Escalation',
156
162
  description: 'Mass assignment vulnerability allowing attackers to escalate privileges by including additional parameters like "role", "isAdmin", or "permissions" in requests that the application binds to user objects without proper allowlist filtering of settable fields.',
157
163
  severity: 'high',
164
+ levelId: 2,
158
165
  category: 'access_control',
159
166
  scanner: 'model-state',
160
167
  cvss: {
@@ -172,11 +179,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
172
179
  },
173
180
 
174
181
  [VulnerabilityCode.MASSASSIGN_PROTOTYPE_POLLUTION]: {
175
- id: 64,
182
+ id: 107,
176
183
  code: VulnerabilityCode.MASSASSIGN_PROTOTYPE_POLLUTION,
177
184
  title: 'Mass Assignment - Prototype Pollution',
178
185
  description: 'JavaScript prototype pollution vulnerability through mass assignment where attackers inject __proto__ or constructor.prototype properties that modify the Object prototype globally, potentially leading to denial of service, security bypass, or remote code execution.',
179
186
  severity: 'high',
187
+ levelId: 2,
180
188
  category: 'access_control',
181
189
  scanner: 'model-state',
182
190
  cvss: {
@@ -194,11 +202,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
194
202
  },
195
203
 
196
204
  [VulnerabilityCode.JWT_EXPIRED_TOKEN]: {
197
- id: 65,
205
+ id: 108,
198
206
  code: VulnerabilityCode.JWT_EXPIRED_TOKEN,
199
207
  title: 'JWT Vulnerability - Expired Token Accepted',
200
208
  description: 'JWT implementation does not properly validate token expiration (exp claim), accepting expired tokens that should be rejected. This allows attackers with previously captured tokens to reuse them indefinitely, maintaining unauthorized access without credential updates.',
201
209
  severity: 'medium',
210
+ levelId: 3,
202
211
  category: 'authentication',
203
212
  scanner: 'jwt',
204
213
  cvss: {
@@ -216,11 +225,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
216
225
  },
217
226
 
218
227
  [VulnerabilityCode.JWT_MISSING_CLAIMS]: {
219
- id: 66,
228
+ id: 109,
220
229
  code: VulnerabilityCode.JWT_MISSING_CLAIMS,
221
230
  title: 'JWT Vulnerability - Missing Required Claims',
222
231
  description: 'JWT tokens are missing critical security claims like exp (expiration), iat (issued at), nbf (not before), or iss (issuer), reducing the security guarantees of the token system and potentially allowing token reuse, replay attacks, or cross-tenant access.',
223
232
  severity: 'medium',
233
+ levelId: 3,
224
234
  category: 'authentication',
225
235
  scanner: 'jwt',
226
236
  cvss: {
@@ -238,11 +248,12 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
238
248
  },
239
249
 
240
250
  [VulnerabilityCode.BAC_HORIZONTAL_PRIVILEGE]: {
241
- id: 67,
251
+ id: 110,
242
252
  code: VulnerabilityCode.BAC_HORIZONTAL_PRIVILEGE,
243
253
  title: 'Broken Access Control - Horizontal Privilege Escalation',
244
254
  description: 'Horizontal privilege escalation vulnerability where authenticated users can access data or perform actions belonging to other users at the same privilege level by manipulating user identifiers, object references, or session parameters without ownership verification.',
245
255
  severity: 'high',
256
+ levelId: 2,
246
257
  category: 'access_control',
247
258
  scanner: 'broken-access',
248
259
  cvss: {
@@ -259,12 +270,13 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
259
270
  remediation: 'Implement record-level authorization checks. Verify resource ownership against the authenticated user session. Use indirect references that map to actual resources server-side.',
260
271
  },
261
272
 
262
- [VulnerabilityCode.MASSASSIGN_HIDDEN_FIELD]: {
263
- id: 68,
264
- code: VulnerabilityCode.MASSASSIGN_HIDDEN_FIELD,
265
- title: 'Mass Assignment - Hidden Field Manipulation',
273
+ [VulnerabilityCode.MASSASSIGN_HIDDEN_FIELD]: {
274
+ id: 111,
275
+ code: VulnerabilityCode.MASSASSIGN_HIDDEN_FIELD,
276
+ title: 'Mass Assignment - Hidden Field Manipulation',
266
277
  description: 'Mass assignment vulnerability where attackers can modify hidden form fields or server-side computed values like price, discount, userId, or timestamp by including them in request bodies, bypassing UI restrictions to manipulate business logic or data integrity.',
267
278
  severity: 'medium',
279
+ levelId: 3,
268
280
  category: 'access_control',
269
281
  scanner: 'model-state',
270
282
  cvss: {
@@ -278,118 +290,123 @@ export const AUTH_VULNERABILITIES: Record<string, VulnerabilityDefinition> = {
278
290
  owasp: [
279
291
  { id: 'A08:2021', name: 'Software and Data Integrity Failures', url: 'https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures/' },
280
292
  ],
281
- remediation: 'Never trust client-provided values for server-computed fields. Use explicit DTOs with allowlisted fields. Recompute amounts, timestamps, and IDs server-side.',
282
- },
283
-
284
- [VulnerabilityCode.JWT_CLAIM_TAMPERING]: {
285
- id: 131,
286
- code: VulnerabilityCode.JWT_CLAIM_TAMPERING,
287
- title: 'JWT - Claim Tampering',
288
- description: 'JWT claim tampering vulnerability where attackers can modify token claims such as roles, user IDs, or permissions and the server accepts the tampered token, enabling privilege escalation or unauthorized access.',
289
- severity: 'high',
290
- category: 'authentication',
291
- scanner: 'jwt',
292
- cvss: {
293
- score: 8.1,
294
- vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
295
- severity: 'HIGH',
296
- },
297
- cwe: [
298
- { id: 'CWE-345', name: 'Insufficient Verification of Data Authenticity', url: 'https://cwe.mitre.org/data/definitions/345.html' },
299
- ],
300
- owasp: [
301
- { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
302
- ],
303
- remediation: 'Validate JWT signatures using strong algorithms and trusted keys. Reject unsigned or weakly signed tokens. Enforce claim validation and server-side authorization checks.',
304
- },
305
-
306
- [VulnerabilityCode.JWT_KID_INJECTION]: {
307
- id: 132,
308
- code: VulnerabilityCode.JWT_KID_INJECTION,
309
- title: 'JWT - KID Header Injection',
310
- description: 'JWT key identifier (kid) injection vulnerability where attackers manipulate the kid header to influence key selection or file paths, potentially bypassing signature verification or loading attacker-controlled keys.',
311
- severity: 'high',
312
- category: 'authentication',
313
- scanner: 'jwt',
314
- cvss: {
315
- score: 7.5,
316
- vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
317
- severity: 'HIGH',
318
- },
319
- cwe: [
320
- { id: 'CWE-73', name: 'External Control of File Name or Path', url: 'https://cwe.mitre.org/data/definitions/73.html' },
321
- ],
322
- owasp: [
323
- { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
324
- ],
325
- remediation: 'Avoid direct use of kid as a file path or URL. Use a strict allowlist of key IDs and map to known keys in configuration. Reject unexpected or oversized kid values.',
326
- },
327
-
328
- [VulnerabilityCode.JWT_JKU_INJECTION]: {
329
- id: 133,
330
- code: VulnerabilityCode.JWT_JKU_INJECTION,
331
- title: 'JWT - JKU Header Injection',
332
- description: 'JWT JKU (JWK Set URL) header injection vulnerability where attackers can control the URL used to fetch signing keys, allowing them to supply their own keys and forge valid tokens.',
333
- severity: 'high',
334
- category: 'authentication',
335
- scanner: 'jwt',
336
- cvss: {
337
- score: 8.1,
338
- vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
339
- severity: 'HIGH',
340
- },
341
- cwe: [
342
- { id: 'CWE-346', name: 'Origin Validation Error', url: 'https://cwe.mitre.org/data/definitions/346.html' },
343
- ],
344
- owasp: [
345
- { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
346
- ],
347
- remediation: 'Ignore untrusted JKU values or restrict to a strict allowlist of trusted JWKS endpoints. Pin keys or use local key material where possible.',
348
- },
349
-
350
- [VulnerabilityCode.JWT_EMBEDDED_JWK]: {
351
- id: 134,
352
- code: VulnerabilityCode.JWT_EMBEDDED_JWK,
353
- title: 'JWT - Embedded JWK Injection',
354
- description: 'JWT embedded JWK vulnerability where attackers include their own JWK in the token header and the server accepts it as a trusted signing key, enabling forged tokens and authentication bypass.',
355
- severity: 'high',
356
- category: 'authentication',
357
- scanner: 'jwt',
358
- cvss: {
359
- score: 8.1,
360
- vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
361
- severity: 'HIGH',
362
- },
363
- cwe: [
364
- { id: 'CWE-347', name: 'Improper Verification of Cryptographic Signature', url: 'https://cwe.mitre.org/data/definitions/347.html' },
365
- ],
366
- owasp: [
367
- { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
368
- ],
369
- remediation: 'Reject embedded JWKs from tokens unless explicitly required and validated against a trusted key set. Use pinned keys and strict header validation.',
370
- },
371
-
372
- [VulnerabilityCode.JWT_X5C_INJECTION]: {
373
- id: 135,
374
- code: VulnerabilityCode.JWT_X5C_INJECTION,
375
- title: 'JWT - X5C Header Injection',
376
- description: 'JWT x5c header injection vulnerability where attackers provide an untrusted certificate chain, allowing them to influence key selection or bypass signature validation if certificate trust is not strictly enforced.',
377
- severity: 'high',
378
- category: 'authentication',
379
- scanner: 'jwt',
380
- cvss: {
381
- score: 7.5,
382
- vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
383
- severity: 'HIGH',
384
- },
385
- cwe: [
386
- { id: 'CWE-295', name: 'Improper Certificate Validation', url: 'https://cwe.mitre.org/data/definitions/295.html' },
387
- ],
388
- owasp: [
389
- { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
390
- ],
391
- remediation: 'Ignore untrusted x5c headers or validate certificate chains against a trusted root store with strict policy. Prefer pinned public keys or JWKS allowlists.',
392
- },
393
- };
293
+ remediation: 'Never trust client-provided values for server-computed fields. Use explicit DTOs with allowlisted fields. Recompute amounts, timestamps, and IDs server-side.',
294
+ },
295
+
296
+ [VulnerabilityCode.JWT_CLAIM_TAMPERING]: {
297
+ id: 112,
298
+ code: VulnerabilityCode.JWT_CLAIM_TAMPERING,
299
+ title: 'JWT - Claim Tampering',
300
+ description: 'JWT claim tampering vulnerability where attackers can modify token claims such as roles, user IDs, or permissions and the server accepts the tampered token, enabling privilege escalation or unauthorized access.',
301
+ severity: 'high',
302
+ levelId: 2,
303
+ category: 'authentication',
304
+ scanner: 'jwt',
305
+ cvss: {
306
+ score: 8.1,
307
+ vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
308
+ severity: 'HIGH',
309
+ },
310
+ cwe: [
311
+ { id: 'CWE-345', name: 'Insufficient Verification of Data Authenticity', url: 'https://cwe.mitre.org/data/definitions/345.html' },
312
+ ],
313
+ owasp: [
314
+ { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
315
+ ],
316
+ remediation: 'Validate JWT signatures using strong algorithms and trusted keys. Reject unsigned or weakly signed tokens. Enforce claim validation and server-side authorization checks.',
317
+ },
318
+
319
+ [VulnerabilityCode.JWT_KID_INJECTION]: {
320
+ id: 113,
321
+ code: VulnerabilityCode.JWT_KID_INJECTION,
322
+ title: 'JWT - KID Header Injection',
323
+ description: 'JWT key identifier (kid) injection vulnerability where attackers manipulate the kid header to influence key selection or file paths, potentially bypassing signature verification or loading attacker-controlled keys.',
324
+ severity: 'high',
325
+ levelId: 2,
326
+ category: 'authentication',
327
+ scanner: 'jwt',
328
+ cvss: {
329
+ score: 7.5,
330
+ vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
331
+ severity: 'HIGH',
332
+ },
333
+ cwe: [
334
+ { id: 'CWE-73', name: 'External Control of File Name or Path', url: 'https://cwe.mitre.org/data/definitions/73.html' },
335
+ ],
336
+ owasp: [
337
+ { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
338
+ ],
339
+ remediation: 'Avoid direct use of kid as a file path or URL. Use a strict allowlist of key IDs and map to known keys in configuration. Reject unexpected or oversized kid values.',
340
+ },
341
+
342
+ [VulnerabilityCode.JWT_JKU_INJECTION]: {
343
+ id: 114,
344
+ code: VulnerabilityCode.JWT_JKU_INJECTION,
345
+ title: 'JWT - JKU Header Injection',
346
+ description: 'JWT JKU (JWK Set URL) header injection vulnerability where attackers can control the URL used to fetch signing keys, allowing them to supply their own keys and forge valid tokens.',
347
+ severity: 'high',
348
+ levelId: 2,
349
+ category: 'authentication',
350
+ scanner: 'jwt',
351
+ cvss: {
352
+ score: 8.1,
353
+ vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
354
+ severity: 'HIGH',
355
+ },
356
+ cwe: [
357
+ { id: 'CWE-346', name: 'Origin Validation Error', url: 'https://cwe.mitre.org/data/definitions/346.html' },
358
+ ],
359
+ owasp: [
360
+ { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
361
+ ],
362
+ remediation: 'Ignore untrusted JKU values or restrict to a strict allowlist of trusted JWKS endpoints. Pin keys or use local key material where possible.',
363
+ },
364
+
365
+ [VulnerabilityCode.JWT_EMBEDDED_JWK]: {
366
+ id: 115,
367
+ code: VulnerabilityCode.JWT_EMBEDDED_JWK,
368
+ title: 'JWT - Embedded JWK Injection',
369
+ description: 'JWT embedded JWK vulnerability where attackers include their own JWK in the token header and the server accepts it as a trusted signing key, enabling forged tokens and authentication bypass.',
370
+ severity: 'high',
371
+ levelId: 2,
372
+ category: 'authentication',
373
+ scanner: 'jwt',
374
+ cvss: {
375
+ score: 8.1,
376
+ vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
377
+ severity: 'HIGH',
378
+ },
379
+ cwe: [
380
+ { id: 'CWE-347', name: 'Improper Verification of Cryptographic Signature', url: 'https://cwe.mitre.org/data/definitions/347.html' },
381
+ ],
382
+ owasp: [
383
+ { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
384
+ ],
385
+ remediation: 'Reject embedded JWKs from tokens unless explicitly required and validated against a trusted key set. Use pinned keys and strict header validation.',
386
+ },
387
+
388
+ [VulnerabilityCode.JWT_X5C_INJECTION]: {
389
+ id: 116,
390
+ code: VulnerabilityCode.JWT_X5C_INJECTION,
391
+ title: 'JWT - X5C Header Injection',
392
+ description: 'JWT x5c header injection vulnerability where attackers provide an untrusted certificate chain, allowing them to influence key selection or bypass signature validation if certificate trust is not strictly enforced.',
393
+ severity: 'high',
394
+ levelId: 2,
395
+ category: 'authentication',
396
+ scanner: 'jwt',
397
+ cvss: {
398
+ score: 7.5,
399
+ vector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N',
400
+ severity: 'HIGH',
401
+ },
402
+ cwe: [
403
+ { id: 'CWE-295', name: 'Improper Certificate Validation', url: 'https://cwe.mitre.org/data/definitions/295.html' },
404
+ ],
405
+ owasp: [
406
+ { id: 'A07:2021', name: 'Identification and Authentication Failures', url: 'https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/' },
407
+ ],
408
+ remediation: 'Ignore untrusted x5c headers or validate certificate chains against a trusted root store with strict policy. Prefer pinned public keys or JWKS allowlists.',
409
+ },
410
+ };
394
411
 
395
412
  export default AUTH_VULNERABILITIES;