xploitscan-shared-rules 1.22.0 → 1.24.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 +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
FREE_RULE_COUNT: () => FREE_RULE_COUNT,
|
|
34
|
+
MODEL_ANALYSIS: () => MODEL_ANALYSIS,
|
|
35
|
+
MODEL_POLICY_REVIEWED: () => MODEL_POLICY_REVIEWED,
|
|
36
|
+
MODEL_REVIEW_INTERVAL_DAYS: () => MODEL_REVIEW_INTERVAL_DAYS,
|
|
37
|
+
MODEL_TEMPERATURE: () => MODEL_TEMPERATURE,
|
|
38
|
+
MODEL_TRIAGE: () => MODEL_TRIAGE,
|
|
34
39
|
NON_APP_PATH_PATTERNS: () => NON_APP_PATH_PATTERNS,
|
|
35
40
|
PRO_RULE_COUNT: () => PRO_RULE_COUNT,
|
|
36
41
|
RULE_IMPACTS: () => RULE_IMPACTS,
|
|
@@ -222,6 +227,7 @@ __export(index_exports, {
|
|
|
222
227
|
pathTraversal: () => pathTraversal,
|
|
223
228
|
pickleDeserialization: () => pickleDeserialization,
|
|
224
229
|
piiInLogs: () => piiInLogs,
|
|
230
|
+
proOnlyRules: () => proOnlyRules,
|
|
225
231
|
prototypePollution: () => prototypePollution,
|
|
226
232
|
pyDjangoAllowedHostsWildcard: () => pyDjangoAllowedHostsWildcard,
|
|
227
233
|
pyDjangoMarkSafe: () => pyDjangoMarkSafe,
|
|
@@ -335,6 +341,13 @@ function getSnippet(content, line, contextLines = 2) {
|
|
|
335
341
|
return out.join("\n");
|
|
336
342
|
}
|
|
337
343
|
|
|
344
|
+
// src/models.ts
|
|
345
|
+
var MODEL_ANALYSIS = "claude-sonnet-5";
|
|
346
|
+
var MODEL_TRIAGE = "claude-haiku-4-5-20251001";
|
|
347
|
+
var MODEL_POLICY_REVIEWED = "2026-09-15";
|
|
348
|
+
var MODEL_REVIEW_INTERVAL_DAYS = 180;
|
|
349
|
+
var MODEL_TEMPERATURE = 0;
|
|
350
|
+
|
|
338
351
|
// src/rule-impacts.ts
|
|
339
352
|
var RULE_IMPACTS = {
|
|
340
353
|
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.",
|
|
@@ -9225,6 +9238,10 @@ var allCustomRules = [
|
|
|
9225
9238
|
entitlementFromWebStorage,
|
|
9226
9239
|
accountStateFromWebStorage
|
|
9227
9240
|
];
|
|
9241
|
+
var proOnlyRules = (() => {
|
|
9242
|
+
const freeIds = new Set(freeRules.map((r) => r.id));
|
|
9243
|
+
return allCustomRules.filter((r) => !freeIds.has(r.id));
|
|
9244
|
+
})();
|
|
9228
9245
|
function runCustomRules(content, filePath, disabledRules = [], tier = "free", extraRules = [], project) {
|
|
9229
9246
|
const findings = [];
|
|
9230
9247
|
if (/function runScan\(files\)|export function runCustomRules/.test(content) && /const (?:rules|allRules)\s*[:=]/.test(content) && /findMatches/.test(content)) {
|
|
@@ -9410,7 +9427,7 @@ async function filterFalsePositives(findings, fileContents) {
|
|
|
9410
9427
|
const prompt = buildReviewPrompt(batch, content);
|
|
9411
9428
|
const response = await client.messages.create(
|
|
9412
9429
|
{
|
|
9413
|
-
model:
|
|
9430
|
+
model: MODEL_TRIAGE,
|
|
9414
9431
|
max_tokens: 1024,
|
|
9415
9432
|
// Pinned, NOT left to the API default of 1.0. This is a binary
|
|
9416
9433
|
// classification (real vs. false positive), not generation — there
|
|
@@ -9422,7 +9439,7 @@ async function filterFalsePositives(findings, fileContents) {
|
|
|
9422
9439
|
// variance source that was ours to control. See
|
|
9423
9440
|
// scripts/fp-filter-repeatability.cjs for the measured flip rate,
|
|
9424
9441
|
// and the assertion in ai-fp-filter.test.ts that keeps it pinned.
|
|
9425
|
-
temperature:
|
|
9442
|
+
temperature: MODEL_TEMPERATURE,
|
|
9426
9443
|
system: REVIEW_SYSTEM_PROMPT,
|
|
9427
9444
|
messages: [{ role: "user", content: prompt }]
|
|
9428
9445
|
},
|
|
@@ -9939,6 +9956,11 @@ function extractScriptUrls(html, pageUrl, limit = 12) {
|
|
|
9939
9956
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9940
9957
|
0 && (module.exports = {
|
|
9941
9958
|
FREE_RULE_COUNT,
|
|
9959
|
+
MODEL_ANALYSIS,
|
|
9960
|
+
MODEL_POLICY_REVIEWED,
|
|
9961
|
+
MODEL_REVIEW_INTERVAL_DAYS,
|
|
9962
|
+
MODEL_TEMPERATURE,
|
|
9963
|
+
MODEL_TRIAGE,
|
|
9942
9964
|
NON_APP_PATH_PATTERNS,
|
|
9943
9965
|
PRO_RULE_COUNT,
|
|
9944
9966
|
RULE_IMPACTS,
|
|
@@ -10130,6 +10152,7 @@ function extractScriptUrls(html, pageUrl, limit = 12) {
|
|
|
10130
10152
|
pathTraversal,
|
|
10131
10153
|
pickleDeserialization,
|
|
10132
10154
|
piiInLogs,
|
|
10155
|
+
proOnlyRules,
|
|
10133
10156
|
prototypePollution,
|
|
10134
10157
|
pyDjangoAllowedHostsWildcard,
|
|
10135
10158
|
pyDjangoMarkSafe,
|