xploitscan-shared-rules 1.3.0 → 1.5.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/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -1
- package/dist/index.d.ts +56 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
RULE_IMPACTS: () => RULE_IMPACTS,
|
|
33
34
|
allCustomRules: () => allCustomRules,
|
|
34
35
|
allRules: () => allRules,
|
|
35
36
|
androidDebuggable: () => androidDebuggable,
|
|
@@ -38,6 +39,7 @@ __export(index_exports, {
|
|
|
38
39
|
calculateGrade: () => calculateGrade,
|
|
39
40
|
callSpreads: () => callSpreads,
|
|
40
41
|
callbackHell: () => callbackHell,
|
|
42
|
+
classifyExposure: () => classifyExposure,
|
|
41
43
|
clickjacking: () => clickjacking,
|
|
42
44
|
clientComponentSecret: () => clientComponentSecret,
|
|
43
45
|
clientSideAuth: () => clientSideAuth,
|
|
@@ -269,6 +271,42 @@ function getSnippet(content, line, contextLines = 2) {
|
|
|
269
271
|
}).join("\n");
|
|
270
272
|
}
|
|
271
273
|
|
|
274
|
+
// src/rule-impacts.ts
|
|
275
|
+
var RULE_IMPACTS = {
|
|
276
|
+
VC001: "An attacker who finds this key in your source code or client bundle can use your API with your credentials, potentially reading or modifying user data and racking up usage charges.",
|
|
277
|
+
VC002: "If this .env file is committed to git, anyone with repo access (including public repos) can extract your database passwords, API keys, and other secrets.",
|
|
278
|
+
VC003: "This API endpoint has no authentication check. Anyone on the internet can call it directly, potentially accessing or modifying data without permission.",
|
|
279
|
+
VC004: "The service_role key bypasses all Row Level Security policies. If exposed client-side, any user can read, modify, or delete any row in your database.",
|
|
280
|
+
VC005: "Without webhook signature verification, an attacker can send fake payment events to your endpoint \u2014 granting free access, duplicating orders, or corrupting billing data.",
|
|
281
|
+
VC006: "An attacker can inject malicious SQL through user input, potentially dumping your entire database, modifying records, or deleting tables.",
|
|
282
|
+
VC007: "An attacker can inject JavaScript that runs in other users' browsers, stealing session cookies, redirecting to phishing pages, or performing actions as the victim.",
|
|
283
|
+
VC008: "Without rate limiting, an attacker can flood your API with requests causing denial of service, brute-force attacks, or excessive cloud billing.",
|
|
284
|
+
VC009: "With CORS set to allow all origins, any website can make authenticated requests to your API from a user's browser, enabling cross-site data theft.",
|
|
285
|
+
VC010: "Hiding UI elements without server-side checks means an attacker can call your API directly and bypass the restriction entirely.",
|
|
286
|
+
VC011: "The NEXT_PUBLIC_ prefix exposes this value in the browser bundle. If it's a secret, anyone viewing your site's JavaScript can extract it."
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// src/exposure.ts
|
|
290
|
+
function classifyExposure(filePath) {
|
|
291
|
+
if (/(?:\/api\/|pages\/api\/|routes?\/|controllers?\/|endpoints?\/|server\.|app\/.*route\.)/.test(
|
|
292
|
+
filePath
|
|
293
|
+
)) {
|
|
294
|
+
return "public";
|
|
295
|
+
}
|
|
296
|
+
if (/(?:app\/.*page\.|pages\/(?!api\/)|views?\/|templates?\/)/.test(filePath)) {
|
|
297
|
+
return "public";
|
|
298
|
+
}
|
|
299
|
+
if (/(?:lib\/|utils?\/|helpers?\/|services?\/|models?\/|hooks?\/)/.test(
|
|
300
|
+
filePath
|
|
301
|
+
)) {
|
|
302
|
+
return "internal";
|
|
303
|
+
}
|
|
304
|
+
if (/(?:middleware|config|constants?)/.test(filePath)) {
|
|
305
|
+
return "internal";
|
|
306
|
+
}
|
|
307
|
+
return "unknown";
|
|
308
|
+
}
|
|
309
|
+
|
|
272
310
|
// src/ast/parse.ts
|
|
273
311
|
var import_parser = require("@babel/parser");
|
|
274
312
|
var MAX_CACHE = 256;
|
|
@@ -8077,6 +8115,7 @@ function scanEntropy(files) {
|
|
|
8077
8115
|
}
|
|
8078
8116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8079
8117
|
0 && (module.exports = {
|
|
8118
|
+
RULE_IMPACTS,
|
|
8080
8119
|
allCustomRules,
|
|
8081
8120
|
allRules,
|
|
8082
8121
|
androidDebuggable,
|
|
@@ -8085,6 +8124,7 @@ function scanEntropy(files) {
|
|
|
8085
8124
|
calculateGrade,
|
|
8086
8125
|
callSpreads,
|
|
8087
8126
|
callbackHell,
|
|
8127
|
+
classifyExposure,
|
|
8088
8128
|
clickjacking,
|
|
8089
8129
|
clientComponentSecret,
|
|
8090
8130
|
clientSideAuth,
|