@zerothreatai/vulnerability-registry 3.0.0 → 4.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/dist/categories/authentication.js +17 -0
- package/dist/categories/configuration.js +501 -0
- package/dist/categories/injection.js +34 -0
- package/dist/categories/sensitive-paths.js +84 -0
- package/dist/categories/ssrf.js +11 -0
- package/dist/categories/xss.js +15 -0
- package/dist/category.d.ts +6 -0
- package/dist/category.js +15 -0
- package/dist/error-codes.d.ts +20 -0
- package/dist/error-codes.js +20 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +5 -1
- package/dist/scanner.d.ts +6 -0
- package/dist/scanner.js +22 -0
- package/dist/types.d.ts +2 -0
- package/dist-cjs/categories/authentication.js +17 -0
- package/dist-cjs/categories/configuration.js +501 -0
- package/dist-cjs/categories/injection.js +34 -0
- package/dist-cjs/categories/sensitive-paths.js +84 -0
- package/dist-cjs/categories/ssrf.js +11 -0
- package/dist-cjs/categories/xss.js +15 -0
- package/dist-cjs/category.js +18 -0
- package/dist-cjs/error-codes.js +20 -0
- package/dist-cjs/index.js +7 -1
- package/dist-cjs/scanner.js +25 -0
- package/package.json +1 -1
- package/src/categories/authentication.js +54 -40
- package/src/categories/authentication.ts +134 -117
- package/src/categories/configuration.js +990 -114
- package/src/categories/configuration.ts +1625 -1104
- package/src/categories/injection.js +105 -74
- package/src/categories/injection.ts +129 -95
- package/src/categories/sensitive-paths.js +255 -174
- package/src/categories/sensitive-paths.ts +84 -0
- package/src/categories/ssrf.js +36 -28
- package/src/categories/ssrf.ts +11 -0
- package/src/categories/xss.js +47 -35
- package/src/categories/xss.ts +15 -0
- package/src/category.ts +16 -0
- package/src/error-codes.d.ts +38 -0
- package/src/error-codes.js +41 -6
- package/src/error-codes.ts +25 -5
- package/src/index.js +33 -48
- package/src/index.ts +20 -14
- package/src/scanner.ts +23 -0
- package/src/types.d.ts +2 -0
- package/src/types.js +1 -2
- package/src/types.ts +4 -2
- package/zerothreatai-vulnerability-registry-4npm .0.0.tgz +0 -0
package/src/category.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Category registry - human-friendly titles for categories.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const CATEGORY_REGISTRY: Record<string, { title: string }> = {
|
|
6
|
+
"injection": { title: "Injection" },
|
|
7
|
+
"xss": { title: "Cross-Site Scripting" },
|
|
8
|
+
"authentication": { title: "Authentication" },
|
|
9
|
+
"access_control": { title: "Access Control" },
|
|
10
|
+
"configuration": { title: "Configuration" },
|
|
11
|
+
"information_disclosure": { title: "Information Disclosure" },
|
|
12
|
+
"cryptographic": { title: "Cryptographic" },
|
|
13
|
+
"business_logic": { title: "Business Logic" },
|
|
14
|
+
"ssrf": { title: "Server-Side Request Forgery" },
|
|
15
|
+
"file_inclusion": { title: "File Inclusion" },
|
|
16
|
+
};
|
package/src/error-codes.d.ts
CHANGED
|
@@ -84,13 +84,31 @@ export declare enum VulnerabilityCode {
|
|
|
84
84
|
HEADER_MISSING_REFERRER_POLICY = "HEADER_MISSING_REFERRER_POLICY",
|
|
85
85
|
HEADER_MISSING_PERMISSIONS_POLICY = "HEADER_MISSING_PERMISSIONS_POLICY",
|
|
86
86
|
HEADER_WEAK_CSP = "HEADER_WEAK_CSP",
|
|
87
|
+
HEADER_CSP_REPORT_ONLY = "HEADER_CSP_REPORT_ONLY",
|
|
88
|
+
HEADER_CSP_WEAK_DIRECTIVES = "HEADER_CSP_WEAK_DIRECTIVES",
|
|
89
|
+
HEADER_CSP_DATA_URI_SCRIPT = "HEADER_CSP_DATA_URI_SCRIPT",
|
|
90
|
+
HEADER_CSP_BLOB_URI_SCRIPT = "HEADER_CSP_BLOB_URI_SCRIPT",
|
|
91
|
+
HEADER_CSP_WILDCARD_DEFAULT = "HEADER_CSP_WILDCARD_DEFAULT",
|
|
92
|
+
HEADER_CSP_NO_BASE_URI = "HEADER_CSP_NO_BASE_URI",
|
|
93
|
+
HEADER_CSP_NO_OBJECT_SRC = "HEADER_CSP_NO_OBJECT_SRC",
|
|
94
|
+
HEADER_CSP_NO_FRAME_ANCESTORS = "HEADER_CSP_NO_FRAME_ANCESTORS",
|
|
87
95
|
HEADER_CORS_MISCONFIGURED = "HEADER_CORS_MISCONFIGURED",
|
|
96
|
+
HEADER_CORS_STAR_WITH_CREDENTIALS = "HEADER_CORS_STAR_WITH_CREDENTIALS",
|
|
97
|
+
HEADER_CORS_ORIGIN_REFLECT_NO_VARY = "HEADER_CORS_ORIGIN_REFLECT_NO_VARY",
|
|
98
|
+
HEADER_CORS_NULL_ORIGIN = "HEADER_CORS_NULL_ORIGIN",
|
|
99
|
+
HEADER_CORS_WILDCARD_SUBDOMAIN = "HEADER_CORS_WILDCARD_SUBDOMAIN",
|
|
88
100
|
HEADER_COEP_WITHOUT_COOP = "HEADER_COEP_WITHOUT_COOP",
|
|
89
101
|
HEADER_CORP_UNUSUAL = "HEADER_CORP_UNUSUAL",
|
|
90
102
|
HEADER_EXPECT_CT_PRESENT = "HEADER_EXPECT_CT_PRESENT",
|
|
91
103
|
HEADER_SERVER_HEADER_PRESENT = "HEADER_SERVER_HEADER_PRESENT",
|
|
92
104
|
HEADER_X_POWERED_BY_PRESENT = "HEADER_X_POWERED_BY_PRESENT",
|
|
93
105
|
HEADER_X_XSS_PROTECTION_ENABLED = "HEADER_X_XSS_PROTECTION_ENABLED",
|
|
106
|
+
HEADER_XCONTENT_TYPE_INVALID = "HEADER_XCONTENT_TYPE_INVALID",
|
|
107
|
+
HEADER_REFERRER_POLICY_UNSAFE = "HEADER_REFERRER_POLICY_UNSAFE",
|
|
108
|
+
HEADER_HSTS_BAD_MAX_AGE = "HEADER_HSTS_BAD_MAX_AGE",
|
|
109
|
+
HEADER_HSTS_SHORT_MAX_AGE = "HEADER_HSTS_SHORT_MAX_AGE",
|
|
110
|
+
HEADER_HSTS_NO_INCLUDESUBDOMAINS = "HEADER_HSTS_NO_INCLUDESUBDOMAINS",
|
|
111
|
+
HEADER_HSTS_PRELOAD_LOW_MAX_AGE = "HEADER_HSTS_PRELOAD_LOW_MAX_AGE",
|
|
94
112
|
COOKIE_SAMESITE_NONE_WITHOUT_SECURE = "COOKIE_SAMESITE_NONE_WITHOUT_SECURE",
|
|
95
113
|
COOKIE_SESSION_MISSING_SECURE = "COOKIE_SESSION_MISSING_SECURE",
|
|
96
114
|
COOKIE_MISSING_SECURE = "COOKIE_MISSING_SECURE",
|
|
@@ -111,6 +129,26 @@ export declare enum VulnerabilityCode {
|
|
|
111
129
|
HOST_CACHE_POISONING = "HOST_CACHE_POISONING",
|
|
112
130
|
HOST_PASSWORD_RESET = "HOST_PASSWORD_RESET",
|
|
113
131
|
HOST_REDIRECT = "HOST_REDIRECT",
|
|
132
|
+
DIRBROWSE_GENERIC = "DIRBROWSE_GENERIC",
|
|
133
|
+
DIRBROWSE_GENERIC_SENSITIVE = "DIRBROWSE_GENERIC_SENSITIVE",
|
|
134
|
+
DIRBROWSE_APACHE = "DIRBROWSE_APACHE",
|
|
135
|
+
DIRBROWSE_APACHE_SENSITIVE = "DIRBROWSE_APACHE_SENSITIVE",
|
|
136
|
+
DIRBROWSE_NGINX = "DIRBROWSE_NGINX",
|
|
137
|
+
DIRBROWSE_NGINX_SENSITIVE = "DIRBROWSE_NGINX_SENSITIVE",
|
|
138
|
+
DIRBROWSE_IIS = "DIRBROWSE_IIS",
|
|
139
|
+
DIRBROWSE_IIS_SENSITIVE = "DIRBROWSE_IIS_SENSITIVE",
|
|
140
|
+
DIRBROWSE_TOMCAT = "DIRBROWSE_TOMCAT",
|
|
141
|
+
DIRBROWSE_TOMCAT_SENSITIVE = "DIRBROWSE_TOMCAT_SENSITIVE",
|
|
142
|
+
DIRBROWSE_CADDY = "DIRBROWSE_CADDY",
|
|
143
|
+
DIRBROWSE_CADDY_SENSITIVE = "DIRBROWSE_CADDY_SENSITIVE",
|
|
144
|
+
DIRBROWSE_WEBDAV = "DIRBROWSE_WEBDAV",
|
|
145
|
+
DIRBROWSE_WEBDAV_SENSITIVE = "DIRBROWSE_WEBDAV_SENSITIVE",
|
|
146
|
+
DIRBROWSE_S3 = "DIRBROWSE_S3",
|
|
147
|
+
DIRBROWSE_S3_SENSITIVE = "DIRBROWSE_S3_SENSITIVE",
|
|
148
|
+
DIRBROWSE_GCS = "DIRBROWSE_GCS",
|
|
149
|
+
DIRBROWSE_GCS_SENSITIVE = "DIRBROWSE_GCS_SENSITIVE",
|
|
150
|
+
DIRBROWSE_AZURE_BLOB = "DIRBROWSE_AZURE_BLOB",
|
|
151
|
+
DIRBROWSE_AZURE_BLOB_SENSITIVE = "DIRBROWSE_AZURE_BLOB_SENSITIVE",
|
|
114
152
|
DIRBROWSE_ENABLED = "DIRBROWSE_ENABLED",
|
|
115
153
|
DIRBROWSE_SENSITIVE = "DIRBROWSE_SENSITIVE",
|
|
116
154
|
MASSASSIGN_PROTOTYPE_POLLUTION = "MASSASSIGN_PROTOTYPE_POLLUTION",
|
package/src/error-codes.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Vulnerability Registry - Error Codes
|
|
4
3
|
*
|
|
5
4
|
* Central enum containing all vulnerability error codes across all scanners.
|
|
6
5
|
* Each code maps to a complete VulnerabilityDefinition.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.VulnerabilityCode = void 0;
|
|
10
|
-
var VulnerabilityCode;
|
|
7
|
+
export var VulnerabilityCode;
|
|
11
8
|
(function (VulnerabilityCode) {
|
|
12
9
|
// ========================================
|
|
13
10
|
// SQL INJECTION (SQLI_*)
|
|
@@ -124,13 +121,31 @@ var VulnerabilityCode;
|
|
|
124
121
|
VulnerabilityCode["HEADER_MISSING_REFERRER_POLICY"] = "HEADER_MISSING_REFERRER_POLICY";
|
|
125
122
|
VulnerabilityCode["HEADER_MISSING_PERMISSIONS_POLICY"] = "HEADER_MISSING_PERMISSIONS_POLICY";
|
|
126
123
|
VulnerabilityCode["HEADER_WEAK_CSP"] = "HEADER_WEAK_CSP";
|
|
124
|
+
VulnerabilityCode["HEADER_CSP_REPORT_ONLY"] = "HEADER_CSP_REPORT_ONLY";
|
|
125
|
+
VulnerabilityCode["HEADER_CSP_WEAK_DIRECTIVES"] = "HEADER_CSP_WEAK_DIRECTIVES";
|
|
126
|
+
VulnerabilityCode["HEADER_CSP_DATA_URI_SCRIPT"] = "HEADER_CSP_DATA_URI_SCRIPT";
|
|
127
|
+
VulnerabilityCode["HEADER_CSP_BLOB_URI_SCRIPT"] = "HEADER_CSP_BLOB_URI_SCRIPT";
|
|
128
|
+
VulnerabilityCode["HEADER_CSP_WILDCARD_DEFAULT"] = "HEADER_CSP_WILDCARD_DEFAULT";
|
|
129
|
+
VulnerabilityCode["HEADER_CSP_NO_BASE_URI"] = "HEADER_CSP_NO_BASE_URI";
|
|
130
|
+
VulnerabilityCode["HEADER_CSP_NO_OBJECT_SRC"] = "HEADER_CSP_NO_OBJECT_SRC";
|
|
131
|
+
VulnerabilityCode["HEADER_CSP_NO_FRAME_ANCESTORS"] = "HEADER_CSP_NO_FRAME_ANCESTORS";
|
|
127
132
|
VulnerabilityCode["HEADER_CORS_MISCONFIGURED"] = "HEADER_CORS_MISCONFIGURED";
|
|
133
|
+
VulnerabilityCode["HEADER_CORS_STAR_WITH_CREDENTIALS"] = "HEADER_CORS_STAR_WITH_CREDENTIALS";
|
|
134
|
+
VulnerabilityCode["HEADER_CORS_ORIGIN_REFLECT_NO_VARY"] = "HEADER_CORS_ORIGIN_REFLECT_NO_VARY";
|
|
135
|
+
VulnerabilityCode["HEADER_CORS_NULL_ORIGIN"] = "HEADER_CORS_NULL_ORIGIN";
|
|
136
|
+
VulnerabilityCode["HEADER_CORS_WILDCARD_SUBDOMAIN"] = "HEADER_CORS_WILDCARD_SUBDOMAIN";
|
|
128
137
|
VulnerabilityCode["HEADER_COEP_WITHOUT_COOP"] = "HEADER_COEP_WITHOUT_COOP";
|
|
129
138
|
VulnerabilityCode["HEADER_CORP_UNUSUAL"] = "HEADER_CORP_UNUSUAL";
|
|
130
139
|
VulnerabilityCode["HEADER_EXPECT_CT_PRESENT"] = "HEADER_EXPECT_CT_PRESENT";
|
|
131
140
|
VulnerabilityCode["HEADER_SERVER_HEADER_PRESENT"] = "HEADER_SERVER_HEADER_PRESENT";
|
|
132
141
|
VulnerabilityCode["HEADER_X_POWERED_BY_PRESENT"] = "HEADER_X_POWERED_BY_PRESENT";
|
|
133
142
|
VulnerabilityCode["HEADER_X_XSS_PROTECTION_ENABLED"] = "HEADER_X_XSS_PROTECTION_ENABLED";
|
|
143
|
+
VulnerabilityCode["HEADER_XCONTENT_TYPE_INVALID"] = "HEADER_XCONTENT_TYPE_INVALID";
|
|
144
|
+
VulnerabilityCode["HEADER_REFERRER_POLICY_UNSAFE"] = "HEADER_REFERRER_POLICY_UNSAFE";
|
|
145
|
+
VulnerabilityCode["HEADER_HSTS_BAD_MAX_AGE"] = "HEADER_HSTS_BAD_MAX_AGE";
|
|
146
|
+
VulnerabilityCode["HEADER_HSTS_SHORT_MAX_AGE"] = "HEADER_HSTS_SHORT_MAX_AGE";
|
|
147
|
+
VulnerabilityCode["HEADER_HSTS_NO_INCLUDESUBDOMAINS"] = "HEADER_HSTS_NO_INCLUDESUBDOMAINS";
|
|
148
|
+
VulnerabilityCode["HEADER_HSTS_PRELOAD_LOW_MAX_AGE"] = "HEADER_HSTS_PRELOAD_LOW_MAX_AGE";
|
|
134
149
|
VulnerabilityCode["COOKIE_SAMESITE_NONE_WITHOUT_SECURE"] = "COOKIE_SAMESITE_NONE_WITHOUT_SECURE";
|
|
135
150
|
VulnerabilityCode["COOKIE_SESSION_MISSING_SECURE"] = "COOKIE_SESSION_MISSING_SECURE";
|
|
136
151
|
VulnerabilityCode["COOKIE_MISSING_SECURE"] = "COOKIE_MISSING_SECURE";
|
|
@@ -157,6 +172,26 @@ var VulnerabilityCode;
|
|
|
157
172
|
// ========================================
|
|
158
173
|
// DIRECTORY BROWSING (DIRBROWSE_*)
|
|
159
174
|
// ========================================
|
|
175
|
+
VulnerabilityCode["DIRBROWSE_GENERIC"] = "DIRBROWSE_GENERIC";
|
|
176
|
+
VulnerabilityCode["DIRBROWSE_GENERIC_SENSITIVE"] = "DIRBROWSE_GENERIC_SENSITIVE";
|
|
177
|
+
VulnerabilityCode["DIRBROWSE_APACHE"] = "DIRBROWSE_APACHE";
|
|
178
|
+
VulnerabilityCode["DIRBROWSE_APACHE_SENSITIVE"] = "DIRBROWSE_APACHE_SENSITIVE";
|
|
179
|
+
VulnerabilityCode["DIRBROWSE_NGINX"] = "DIRBROWSE_NGINX";
|
|
180
|
+
VulnerabilityCode["DIRBROWSE_NGINX_SENSITIVE"] = "DIRBROWSE_NGINX_SENSITIVE";
|
|
181
|
+
VulnerabilityCode["DIRBROWSE_IIS"] = "DIRBROWSE_IIS";
|
|
182
|
+
VulnerabilityCode["DIRBROWSE_IIS_SENSITIVE"] = "DIRBROWSE_IIS_SENSITIVE";
|
|
183
|
+
VulnerabilityCode["DIRBROWSE_TOMCAT"] = "DIRBROWSE_TOMCAT";
|
|
184
|
+
VulnerabilityCode["DIRBROWSE_TOMCAT_SENSITIVE"] = "DIRBROWSE_TOMCAT_SENSITIVE";
|
|
185
|
+
VulnerabilityCode["DIRBROWSE_CADDY"] = "DIRBROWSE_CADDY";
|
|
186
|
+
VulnerabilityCode["DIRBROWSE_CADDY_SENSITIVE"] = "DIRBROWSE_CADDY_SENSITIVE";
|
|
187
|
+
VulnerabilityCode["DIRBROWSE_WEBDAV"] = "DIRBROWSE_WEBDAV";
|
|
188
|
+
VulnerabilityCode["DIRBROWSE_WEBDAV_SENSITIVE"] = "DIRBROWSE_WEBDAV_SENSITIVE";
|
|
189
|
+
VulnerabilityCode["DIRBROWSE_S3"] = "DIRBROWSE_S3";
|
|
190
|
+
VulnerabilityCode["DIRBROWSE_S3_SENSITIVE"] = "DIRBROWSE_S3_SENSITIVE";
|
|
191
|
+
VulnerabilityCode["DIRBROWSE_GCS"] = "DIRBROWSE_GCS";
|
|
192
|
+
VulnerabilityCode["DIRBROWSE_GCS_SENSITIVE"] = "DIRBROWSE_GCS_SENSITIVE";
|
|
193
|
+
VulnerabilityCode["DIRBROWSE_AZURE_BLOB"] = "DIRBROWSE_AZURE_BLOB";
|
|
194
|
+
VulnerabilityCode["DIRBROWSE_AZURE_BLOB_SENSITIVE"] = "DIRBROWSE_AZURE_BLOB_SENSITIVE";
|
|
160
195
|
VulnerabilityCode["DIRBROWSE_ENABLED"] = "DIRBROWSE_ENABLED";
|
|
161
196
|
VulnerabilityCode["DIRBROWSE_SENSITIVE"] = "DIRBROWSE_SENSITIVE";
|
|
162
197
|
// ========================================
|
|
@@ -311,5 +346,5 @@ var VulnerabilityCode;
|
|
|
311
346
|
// ========================================
|
|
312
347
|
VulnerabilityCode["CLICK_FRAMEABLE"] = "CLICK_FRAMEABLE";
|
|
313
348
|
VulnerabilityCode["CLICK_PARTIAL_PROTECTION"] = "CLICK_PARTIAL_PROTECTION";
|
|
314
|
-
})(VulnerabilityCode || (
|
|
315
|
-
|
|
349
|
+
})(VulnerabilityCode || (VulnerabilityCode = {}));
|
|
350
|
+
export default VulnerabilityCode;
|
package/src/error-codes.ts
CHANGED
|
@@ -182,11 +182,31 @@ export enum VulnerabilityCode {
|
|
|
182
182
|
HOST_PASSWORD_RESET = 'HOST_PASSWORD_RESET',
|
|
183
183
|
HOST_REDIRECT = 'HOST_REDIRECT',
|
|
184
184
|
|
|
185
|
-
// ========================================
|
|
186
|
-
// DIRECTORY BROWSING (DIRBROWSE_*)
|
|
187
|
-
// ========================================
|
|
188
|
-
|
|
189
|
-
|
|
185
|
+
// ========================================
|
|
186
|
+
// DIRECTORY BROWSING (DIRBROWSE_*)
|
|
187
|
+
// ========================================
|
|
188
|
+
DIRBROWSE_GENERIC = 'DIRBROWSE_GENERIC',
|
|
189
|
+
DIRBROWSE_GENERIC_SENSITIVE = 'DIRBROWSE_GENERIC_SENSITIVE',
|
|
190
|
+
DIRBROWSE_APACHE = 'DIRBROWSE_APACHE',
|
|
191
|
+
DIRBROWSE_APACHE_SENSITIVE = 'DIRBROWSE_APACHE_SENSITIVE',
|
|
192
|
+
DIRBROWSE_NGINX = 'DIRBROWSE_NGINX',
|
|
193
|
+
DIRBROWSE_NGINX_SENSITIVE = 'DIRBROWSE_NGINX_SENSITIVE',
|
|
194
|
+
DIRBROWSE_IIS = 'DIRBROWSE_IIS',
|
|
195
|
+
DIRBROWSE_IIS_SENSITIVE = 'DIRBROWSE_IIS_SENSITIVE',
|
|
196
|
+
DIRBROWSE_TOMCAT = 'DIRBROWSE_TOMCAT',
|
|
197
|
+
DIRBROWSE_TOMCAT_SENSITIVE = 'DIRBROWSE_TOMCAT_SENSITIVE',
|
|
198
|
+
DIRBROWSE_CADDY = 'DIRBROWSE_CADDY',
|
|
199
|
+
DIRBROWSE_CADDY_SENSITIVE = 'DIRBROWSE_CADDY_SENSITIVE',
|
|
200
|
+
DIRBROWSE_WEBDAV = 'DIRBROWSE_WEBDAV',
|
|
201
|
+
DIRBROWSE_WEBDAV_SENSITIVE = 'DIRBROWSE_WEBDAV_SENSITIVE',
|
|
202
|
+
DIRBROWSE_S3 = 'DIRBROWSE_S3',
|
|
203
|
+
DIRBROWSE_S3_SENSITIVE = 'DIRBROWSE_S3_SENSITIVE',
|
|
204
|
+
DIRBROWSE_GCS = 'DIRBROWSE_GCS',
|
|
205
|
+
DIRBROWSE_GCS_SENSITIVE = 'DIRBROWSE_GCS_SENSITIVE',
|
|
206
|
+
DIRBROWSE_AZURE_BLOB = 'DIRBROWSE_AZURE_BLOB',
|
|
207
|
+
DIRBROWSE_AZURE_BLOB_SENSITIVE = 'DIRBROWSE_AZURE_BLOB_SENSITIVE',
|
|
208
|
+
DIRBROWSE_ENABLED = 'DIRBROWSE_ENABLED',
|
|
209
|
+
DIRBROWSE_SENSITIVE = 'DIRBROWSE_SENSITIVE',
|
|
190
210
|
|
|
191
211
|
// ========================================
|
|
192
212
|
// MASS ASSIGNMENT (MASSASSIGN_*)
|
package/src/index.js
CHANGED
|
@@ -1,48 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Vulnerability Registry - Main Entry Point
|
|
4
3
|
*
|
|
5
4
|
* Exports all vulnerability codes, definitions, and lookup utilities
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
exports.SENSITIVE_PATH_VULNERABILITIES = exports.CONFIG_VULNERABILITIES = exports.AUTH_VULNERABILITIES = exports.SSRF_VULNERABILITIES = exports.XSS_VULNERABILITIES = exports.INJECTION_VULNERABILITIES = exports.VulnerabilityCode = exports.VULNERABILITY_REGISTRY = void 0;
|
|
9
|
-
exports.getVulnerabilityDefinition = getVulnerabilityDefinition;
|
|
10
|
-
exports.getVulnerabilitiesByScanner = getVulnerabilitiesByScanner;
|
|
11
|
-
exports.getVulnerabilitiesByCategory = getVulnerabilitiesByCategory;
|
|
12
|
-
exports.getVulnerabilitiesBySeverity = getVulnerabilitiesBySeverity;
|
|
13
|
-
exports.getAllVulnerabilityCodes = getAllVulnerabilityCodes;
|
|
14
|
-
exports.getVulnerabilityCount = getVulnerabilityCount;
|
|
15
|
-
exports.createFinding = createFinding;
|
|
16
|
-
const error_codes_js_1 = require("./error-codes.js");
|
|
6
|
+
import { VulnerabilityCode } from './error-codes.js';
|
|
17
7
|
// Import all category definitions
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const authentication_js_1 = require("./categories/authentication.js");
|
|
25
|
-
Object.defineProperty(exports, "AUTH_VULNERABILITIES", { enumerable: true, get: function () { return authentication_js_1.AUTH_VULNERABILITIES; } });
|
|
26
|
-
const configuration_js_1 = require("./categories/configuration.js");
|
|
27
|
-
Object.defineProperty(exports, "CONFIG_VULNERABILITIES", { enumerable: true, get: function () { return configuration_js_1.CONFIG_VULNERABILITIES; } });
|
|
28
|
-
const sensitive_paths_js_1 = require("./categories/sensitive-paths.js");
|
|
29
|
-
Object.defineProperty(exports, "SENSITIVE_PATH_VULNERABILITIES", { enumerable: true, get: function () { return sensitive_paths_js_1.SENSITIVE_PATH_VULNERABILITIES; } });
|
|
8
|
+
import { INJECTION_VULNERABILITIES } from './categories/injection.js';
|
|
9
|
+
import { XSS_VULNERABILITIES } from './categories/xss.js';
|
|
10
|
+
import { SSRF_VULNERABILITIES } from './categories/ssrf.js';
|
|
11
|
+
import { AUTH_VULNERABILITIES } from './categories/authentication.js';
|
|
12
|
+
import { CONFIG_VULNERABILITIES } from './categories/configuration.js';
|
|
13
|
+
import { SENSITIVE_PATH_VULNERABILITIES } from './categories/sensitive-paths.js';
|
|
30
14
|
/**
|
|
31
15
|
* Complete vulnerability registry combining all categories
|
|
32
16
|
*/
|
|
33
|
-
|
|
34
|
-
...
|
|
35
|
-
...
|
|
36
|
-
...
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
17
|
+
export const VULNERABILITY_REGISTRY = {
|
|
18
|
+
...INJECTION_VULNERABILITIES,
|
|
19
|
+
...XSS_VULNERABILITIES,
|
|
20
|
+
...SSRF_VULNERABILITIES,
|
|
21
|
+
...AUTH_VULNERABILITIES,
|
|
22
|
+
...CONFIG_VULNERABILITIES,
|
|
23
|
+
...SENSITIVE_PATH_VULNERABILITIES,
|
|
40
24
|
};
|
|
41
25
|
/**
|
|
42
26
|
* Get vulnerability definition by code
|
|
43
27
|
*/
|
|
44
|
-
function getVulnerabilityDefinition(code) {
|
|
45
|
-
const definition =
|
|
28
|
+
export function getVulnerabilityDefinition(code) {
|
|
29
|
+
const definition = VULNERABILITY_REGISTRY[code];
|
|
46
30
|
if (definition) {
|
|
47
31
|
return { found: true, definition };
|
|
48
32
|
}
|
|
@@ -51,37 +35,37 @@ function getVulnerabilityDefinition(code) {
|
|
|
51
35
|
/**
|
|
52
36
|
* Get all vulnerabilities for a specific scanner
|
|
53
37
|
*/
|
|
54
|
-
function getVulnerabilitiesByScanner(scanner) {
|
|
55
|
-
return Object.values(
|
|
38
|
+
export function getVulnerabilitiesByScanner(scanner) {
|
|
39
|
+
return Object.values(VULNERABILITY_REGISTRY).filter(v => v.scanner === scanner);
|
|
56
40
|
}
|
|
57
41
|
/**
|
|
58
42
|
* Get all vulnerabilities for a specific category
|
|
59
43
|
*/
|
|
60
|
-
function getVulnerabilitiesByCategory(category) {
|
|
61
|
-
return Object.values(
|
|
44
|
+
export function getVulnerabilitiesByCategory(category) {
|
|
45
|
+
return Object.values(VULNERABILITY_REGISTRY).filter(v => v.category === category);
|
|
62
46
|
}
|
|
63
47
|
/**
|
|
64
48
|
* Get all vulnerabilities for a specific severity
|
|
65
49
|
*/
|
|
66
|
-
function getVulnerabilitiesBySeverity(severity) {
|
|
67
|
-
return Object.values(
|
|
50
|
+
export function getVulnerabilitiesBySeverity(severity) {
|
|
51
|
+
return Object.values(VULNERABILITY_REGISTRY).filter(v => v.severity === severity);
|
|
68
52
|
}
|
|
69
53
|
/**
|
|
70
54
|
* Get all vulnerability codes
|
|
71
55
|
*/
|
|
72
|
-
function getAllVulnerabilityCodes() {
|
|
73
|
-
return Object.values(
|
|
56
|
+
export function getAllVulnerabilityCodes() {
|
|
57
|
+
return Object.values(VulnerabilityCode);
|
|
74
58
|
}
|
|
75
59
|
/**
|
|
76
60
|
* Get total count of registered vulnerabilities
|
|
77
61
|
*/
|
|
78
|
-
function getVulnerabilityCount() {
|
|
79
|
-
return Object.keys(
|
|
62
|
+
export function getVulnerabilityCount() {
|
|
63
|
+
return Object.keys(VULNERABILITY_REGISTRY).length;
|
|
80
64
|
}
|
|
81
65
|
/**
|
|
82
66
|
* Create a finding with vulnerability definition
|
|
83
67
|
*/
|
|
84
|
-
function createFinding(code, overrides) {
|
|
68
|
+
export function createFinding(code, overrides) {
|
|
85
69
|
const lookup = getVulnerabilityDefinition(code);
|
|
86
70
|
if (!lookup.found || !lookup.definition) {
|
|
87
71
|
return null;
|
|
@@ -92,11 +76,12 @@ function createFinding(code, overrides) {
|
|
|
92
76
|
};
|
|
93
77
|
}
|
|
94
78
|
// Re-export all types and enums
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
export { VulnerabilityCode } from './error-codes.js';
|
|
80
|
+
// Export category definitions for direct access
|
|
81
|
+
export { INJECTION_VULNERABILITIES, XSS_VULNERABILITIES, SSRF_VULNERABILITIES, AUTH_VULNERABILITIES, CONFIG_VULNERABILITIES, SENSITIVE_PATH_VULNERABILITIES, };
|
|
82
|
+
export default {
|
|
83
|
+
VulnerabilityCode,
|
|
84
|
+
VULNERABILITY_REGISTRY,
|
|
100
85
|
getVulnerabilityDefinition,
|
|
101
86
|
getVulnerabilitiesByScanner,
|
|
102
87
|
getVulnerabilitiesByCategory,
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,9 @@ import { XSS_VULNERABILITIES } from './categories/xss.js';
|
|
|
13
13
|
import { SSRF_VULNERABILITIES } from './categories/ssrf.js';
|
|
14
14
|
import { AUTH_VULNERABILITIES } from './categories/authentication.js';
|
|
15
15
|
import { CONFIG_VULNERABILITIES } from './categories/configuration.js';
|
|
16
|
-
import { SENSITIVE_PATH_VULNERABILITIES } from './categories/sensitive-paths.js';
|
|
16
|
+
import { SENSITIVE_PATH_VULNERABILITIES } from './categories/sensitive-paths.js';
|
|
17
|
+
import { CATEGORY_REGISTRY } from './category.js';
|
|
18
|
+
import { SCANNER_REGISTRY } from './scanner.js';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Complete vulnerability registry combining all categories
|
|
@@ -104,14 +106,16 @@ export type {
|
|
|
104
106
|
} from './types.js';
|
|
105
107
|
|
|
106
108
|
// Export category definitions for direct access
|
|
107
|
-
export {
|
|
108
|
-
INJECTION_VULNERABILITIES,
|
|
109
|
-
XSS_VULNERABILITIES,
|
|
110
|
-
SSRF_VULNERABILITIES,
|
|
111
|
-
AUTH_VULNERABILITIES,
|
|
112
|
-
CONFIG_VULNERABILITIES,
|
|
113
|
-
SENSITIVE_PATH_VULNERABILITIES,
|
|
114
|
-
|
|
109
|
+
export {
|
|
110
|
+
INJECTION_VULNERABILITIES,
|
|
111
|
+
XSS_VULNERABILITIES,
|
|
112
|
+
SSRF_VULNERABILITIES,
|
|
113
|
+
AUTH_VULNERABILITIES,
|
|
114
|
+
CONFIG_VULNERABILITIES,
|
|
115
|
+
SENSITIVE_PATH_VULNERABILITIES,
|
|
116
|
+
CATEGORY_REGISTRY,
|
|
117
|
+
SCANNER_REGISTRY,
|
|
118
|
+
};
|
|
115
119
|
|
|
116
120
|
export default {
|
|
117
121
|
VulnerabilityCode,
|
|
@@ -119,8 +123,10 @@ export default {
|
|
|
119
123
|
getVulnerabilityDefinition,
|
|
120
124
|
getVulnerabilitiesByScanner,
|
|
121
125
|
getVulnerabilitiesByCategory,
|
|
122
|
-
getVulnerabilitiesBySeverity,
|
|
123
|
-
getAllVulnerabilityCodes,
|
|
124
|
-
getVulnerabilityCount,
|
|
125
|
-
createFinding,
|
|
126
|
-
|
|
126
|
+
getVulnerabilitiesBySeverity,
|
|
127
|
+
getAllVulnerabilityCodes,
|
|
128
|
+
getVulnerabilityCount,
|
|
129
|
+
createFinding,
|
|
130
|
+
CATEGORY_REGISTRY,
|
|
131
|
+
SCANNER_REGISTRY,
|
|
132
|
+
};
|
package/src/scanner.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scanner registry - human-friendly titles for scanners.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const SCANNER_REGISTRY: Record<string, { title: string }> = {
|
|
6
|
+
"broken-access": { title: "Broken Access" },
|
|
7
|
+
"command-injection": { title: "Command Injection" },
|
|
8
|
+
"deserialization": { title: "Deserialization" },
|
|
9
|
+
"directory-browsing": { title: "Directory Browsing" },
|
|
10
|
+
"host-header": { title: "Host Header" },
|
|
11
|
+
"jwt": { title: "JSON WEB TOKEN" },
|
|
12
|
+
"local-file-inclusion": { title: "Local File Inclusion" },
|
|
13
|
+
"model-state": { title: "Model State" },
|
|
14
|
+
"redirect-route": { title: "Redirect Route" },
|
|
15
|
+
"security-headers": { title: "Security Headers" },
|
|
16
|
+
"sensitive-path-scout": { title: "Sensitive Path Scout" },
|
|
17
|
+
"sql-injection": { title: "SQL Injection" },
|
|
18
|
+
"ssrf": { title: "SSRF" },
|
|
19
|
+
"ssti": { title: "SSTI" },
|
|
20
|
+
"xpath-injection": { title: "XPath Injection" },
|
|
21
|
+
"xss": { title: "XSS" },
|
|
22
|
+
"xxe": { title: "XXE" },
|
|
23
|
+
};
|
package/src/types.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export interface VulnerabilityDefinition {
|
|
|
62
62
|
description: string;
|
|
63
63
|
/** Severity level */
|
|
64
64
|
severity: Severity;
|
|
65
|
+
/** Severity level numeric mapping (1=critical, 2=high, 3=medium, 4=low, 5=info) */
|
|
66
|
+
levelId: 1 | 2 | 3 | 4 | 5;
|
|
65
67
|
/** Vulnerability category */
|
|
66
68
|
category: VulnerabilityCategory;
|
|
67
69
|
/** Scanner that detects this vulnerability */
|
package/src/types.js
CHANGED
package/src/types.ts
CHANGED
|
@@ -77,8 +77,10 @@ export interface VulnerabilityDefinition {
|
|
|
77
77
|
title: string;
|
|
78
78
|
/** Detailed description (100+ characters) */
|
|
79
79
|
description: string;
|
|
80
|
-
/** Severity level */
|
|
81
|
-
severity: Severity;
|
|
80
|
+
/** Severity level */
|
|
81
|
+
severity: Severity;
|
|
82
|
+
/** Severity level numeric mapping (1=critical, 2=high, 3=medium, 4=low, 5=info) */
|
|
83
|
+
levelId: 1 | 2 | 3 | 4 | 5;
|
|
82
84
|
/** Vulnerability category */
|
|
83
85
|
category: VulnerabilityCategory;
|
|
84
86
|
/** Scanner that detects this vulnerability */
|
|
Binary file
|