xploitscan-shared-rules 2.4.24 → 2.4.26
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 +2907 -443
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2899 -443
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -169,7 +169,7 @@ interface CustomRule {
|
|
|
169
169
|
* before a scan can be saved without enough provenance to explain a changed
|
|
170
170
|
* grade.
|
|
171
171
|
*/
|
|
172
|
-
declare const SCANNER_VERSION = "2.4.
|
|
172
|
+
declare const SCANNER_VERSION = "2.4.26";
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* Line-oriented helpers shared by every rule. Pure string manipulation — no fs
|
|
@@ -1262,20 +1262,20 @@ declare function runCustomRules(content: string, filePath: string, disabledRules
|
|
|
1262
1262
|
*/
|
|
1263
1263
|
project?: ProjectContext): Finding[];
|
|
1264
1264
|
|
|
1265
|
-
/**
|
|
1266
|
-
* Per-handler auth exemptions shared by VC003 and VC065.
|
|
1267
|
-
*
|
|
1268
|
-
* A guard name only counts when it is called before the first side effect, or
|
|
1269
|
-
* sits in that route's own argument list, or a `.use(guard)` on the same
|
|
1270
|
-
* receiver registered earlier covers the path. A local guard counts only when
|
|
1271
|
-
* its body rejects (throw, redirect, session check, 401/403). An empty body or
|
|
1272
|
-
* `next()` alone does not. Fail closed: no handler slice means no exemption.
|
|
1273
|
-
*/
|
|
1274
1265
|
declare function authPrefixCovers(prefix: string, path: string): boolean;
|
|
1275
1266
|
declare function isAnchoredPublicAuthPath(routePath: string): boolean;
|
|
1276
1267
|
declare function isOgRoutePath(routePath: string): boolean;
|
|
1277
1268
|
declare function routePathFromFile(filePath: string): string | null;
|
|
1278
|
-
declare function widenedAuthSuppresses(content: string, filePath: string, index: number, handler: string | null): boolean;
|
|
1269
|
+
declare function widenedAuthSuppresses(content: string, filePath: string, index: number, handler: string | null, rawContent?: string, capability?: boolean, strictApp?: boolean): boolean;
|
|
1270
|
+
|
|
1271
|
+
declare function setStructuralFaultForTest(name: string | null): void;
|
|
1272
|
+
declare function structuralParseCount(): number;
|
|
1273
|
+
declare function resetStructuralState(): void;
|
|
1274
|
+
declare function publicHttpsUrl(value: string): boolean;
|
|
1275
|
+
declare function publicReadOnlyHandler(content: string, filePath: string, index: number, strictApp?: boolean): boolean;
|
|
1276
|
+
declare function capabilityTokenHandler(content: string, filePath: string, index: number): boolean;
|
|
1277
|
+
declare function bearerProvenanceSafe(content: string, filePath: string, index: number): boolean;
|
|
1278
|
+
declare function refineDirectObjectFindings(content: string, filePath: string, legacyLines: number[]): number[] | null;
|
|
1279
1279
|
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Rule-set sizes as plain numbers, importable without dragging the rules in.
|
|
@@ -1849,4 +1849,4 @@ input: {
|
|
|
1849
1849
|
content: string;
|
|
1850
1850
|
}[] | QualityContext, rules?: QualityRule[]): Finding[];
|
|
1851
1851
|
|
|
1852
|
-
export { type AIFilterResult, type AiDegraded, AiReason, AiStatus, AiSurface, type AppRoute, BILLING_WEBHOOK_UNMATCHED_KEYS, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, GRADE_FINDINGS_PER_RULE, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, KEEP_SEVERITY_IN_TESTS, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PLAN_UNVERIFIED_NOTICE, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, PlanCause, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, SCANNER_VERSION, SCAN_AI_DEGRADED_KEYS, SCAN_TOKEN_NULL_KEYS, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, aiStatusLine, allRules, applyTestPathSeverity, assessHeaders, astMatch, authPrefixCovers, billingWebhookUnmatchedProps, bucketFiles, buildProjectContext, buildQualityContext, buildReviewPrompt, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, deduplicateFindings, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, gradeRuleFamily, hardcodedJWTSecret, hardcodedSecretValues, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isAnchoredPublicAuthPath, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isOgRoutePath, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, maskSecretValue, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, parseFile, parseScanTarget, parseSupabaseConfig, perCallTimeoutMs, planCause, qualityRules, replaceBlockComments, routeForFile, routePathFromFile, runCustomRules, scanAiDegradedProps, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, scanTokenNullProps, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, testPathHold, toAiDegraded, todoLeftInCode, tryParse, unknownAiStatus, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, widenedAuthSuppresses, xssVulnerability };
|
|
1852
|
+
export { type AIFilterResult, type AiDegraded, AiReason, AiStatus, AiSurface, type AppRoute, BILLING_WEBHOOK_UNMATCHED_KEYS, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, GRADE_FINDINGS_PER_RULE, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, KEEP_SEVERITY_IN_TESTS, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PLAN_UNVERIFIED_NOTICE, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, PlanCause, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, SCANNER_VERSION, SCAN_AI_DEGRADED_KEYS, SCAN_TOKEN_NULL_KEYS, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, aiStatusLine, allRules, applyTestPathSeverity, assessHeaders, astMatch, authPrefixCovers, bearerProvenanceSafe, billingWebhookUnmatchedProps, bucketFiles, buildProjectContext, buildQualityContext, buildReviewPrompt, buildTaintMap, calculateGrade, callSpreads, capabilityTokenHandler, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, deduplicateFindings, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, gradeRuleFamily, hardcodedJWTSecret, hardcodedSecretValues, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isAnchoredPublicAuthPath, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isOgRoutePath, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, maskSecretValue, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, parseFile, parseScanTarget, parseSupabaseConfig, perCallTimeoutMs, planCause, publicHttpsUrl, publicReadOnlyHandler, qualityRules, refineDirectObjectFindings, replaceBlockComments, resetStructuralState, routeForFile, routePathFromFile, runCustomRules, scanAiDegradedProps, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, scanTokenNullProps, setStructuralFaultForTest, sqlInjection, stripeWebhookUnprotected, structuralParseCount, supabaseFunctionName, supabaseNoRLS, testPathHold, toAiDegraded, todoLeftInCode, tryParse, unknownAiStatus, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, widenedAuthSuppresses, xssVulnerability };
|
package/dist/index.d.ts
CHANGED
|
@@ -169,7 +169,7 @@ interface CustomRule {
|
|
|
169
169
|
* before a scan can be saved without enough provenance to explain a changed
|
|
170
170
|
* grade.
|
|
171
171
|
*/
|
|
172
|
-
declare const SCANNER_VERSION = "2.4.
|
|
172
|
+
declare const SCANNER_VERSION = "2.4.26";
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* Line-oriented helpers shared by every rule. Pure string manipulation — no fs
|
|
@@ -1262,20 +1262,20 @@ declare function runCustomRules(content: string, filePath: string, disabledRules
|
|
|
1262
1262
|
*/
|
|
1263
1263
|
project?: ProjectContext): Finding[];
|
|
1264
1264
|
|
|
1265
|
-
/**
|
|
1266
|
-
* Per-handler auth exemptions shared by VC003 and VC065.
|
|
1267
|
-
*
|
|
1268
|
-
* A guard name only counts when it is called before the first side effect, or
|
|
1269
|
-
* sits in that route's own argument list, or a `.use(guard)` on the same
|
|
1270
|
-
* receiver registered earlier covers the path. A local guard counts only when
|
|
1271
|
-
* its body rejects (throw, redirect, session check, 401/403). An empty body or
|
|
1272
|
-
* `next()` alone does not. Fail closed: no handler slice means no exemption.
|
|
1273
|
-
*/
|
|
1274
1265
|
declare function authPrefixCovers(prefix: string, path: string): boolean;
|
|
1275
1266
|
declare function isAnchoredPublicAuthPath(routePath: string): boolean;
|
|
1276
1267
|
declare function isOgRoutePath(routePath: string): boolean;
|
|
1277
1268
|
declare function routePathFromFile(filePath: string): string | null;
|
|
1278
|
-
declare function widenedAuthSuppresses(content: string, filePath: string, index: number, handler: string | null): boolean;
|
|
1269
|
+
declare function widenedAuthSuppresses(content: string, filePath: string, index: number, handler: string | null, rawContent?: string, capability?: boolean, strictApp?: boolean): boolean;
|
|
1270
|
+
|
|
1271
|
+
declare function setStructuralFaultForTest(name: string | null): void;
|
|
1272
|
+
declare function structuralParseCount(): number;
|
|
1273
|
+
declare function resetStructuralState(): void;
|
|
1274
|
+
declare function publicHttpsUrl(value: string): boolean;
|
|
1275
|
+
declare function publicReadOnlyHandler(content: string, filePath: string, index: number, strictApp?: boolean): boolean;
|
|
1276
|
+
declare function capabilityTokenHandler(content: string, filePath: string, index: number): boolean;
|
|
1277
|
+
declare function bearerProvenanceSafe(content: string, filePath: string, index: number): boolean;
|
|
1278
|
+
declare function refineDirectObjectFindings(content: string, filePath: string, legacyLines: number[]): number[] | null;
|
|
1279
1279
|
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Rule-set sizes as plain numbers, importable without dragging the rules in.
|
|
@@ -1849,4 +1849,4 @@ input: {
|
|
|
1849
1849
|
content: string;
|
|
1850
1850
|
}[] | QualityContext, rules?: QualityRule[]): Finding[];
|
|
1851
1851
|
|
|
1852
|
-
export { type AIFilterResult, type AiDegraded, AiReason, AiStatus, AiSurface, type AppRoute, BILLING_WEBHOOK_UNMATCHED_KEYS, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, GRADE_FINDINGS_PER_RULE, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, KEEP_SEVERITY_IN_TESTS, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PLAN_UNVERIFIED_NOTICE, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, PlanCause, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, SCANNER_VERSION, SCAN_AI_DEGRADED_KEYS, SCAN_TOKEN_NULL_KEYS, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, aiStatusLine, allRules, applyTestPathSeverity, assessHeaders, astMatch, authPrefixCovers, billingWebhookUnmatchedProps, bucketFiles, buildProjectContext, buildQualityContext, buildReviewPrompt, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, deduplicateFindings, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, gradeRuleFamily, hardcodedJWTSecret, hardcodedSecretValues, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isAnchoredPublicAuthPath, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isOgRoutePath, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, maskSecretValue, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, parseFile, parseScanTarget, parseSupabaseConfig, perCallTimeoutMs, planCause, qualityRules, replaceBlockComments, routeForFile, routePathFromFile, runCustomRules, scanAiDegradedProps, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, scanTokenNullProps, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, testPathHold, toAiDegraded, todoLeftInCode, tryParse, unknownAiStatus, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, widenedAuthSuppresses, xssVulnerability };
|
|
1852
|
+
export { type AIFilterResult, type AiDegraded, AiReason, AiStatus, AiSurface, type AppRoute, BILLING_WEBHOOK_UNMATCHED_KEYS, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, GRADE_FINDINGS_PER_RULE, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, KEEP_SEVERITY_IN_TESTS, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PLAN_UNVERIFIED_NOTICE, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, PlanCause, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, SCANNER_VERSION, SCAN_AI_DEGRADED_KEYS, SCAN_TOKEN_NULL_KEYS, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, aiStatusLine, allRules, applyTestPathSeverity, assessHeaders, astMatch, authPrefixCovers, bearerProvenanceSafe, billingWebhookUnmatchedProps, bucketFiles, buildProjectContext, buildQualityContext, buildReviewPrompt, buildTaintMap, calculateGrade, callSpreads, capabilityTokenHandler, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, deduplicateFindings, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, gradeRuleFamily, hardcodedJWTSecret, hardcodedSecretValues, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isAnchoredPublicAuthPath, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isOgRoutePath, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, maskSecretValue, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, parseFile, parseScanTarget, parseSupabaseConfig, perCallTimeoutMs, planCause, publicHttpsUrl, publicReadOnlyHandler, qualityRules, refineDirectObjectFindings, replaceBlockComments, resetStructuralState, routeForFile, routePathFromFile, runCustomRules, scanAiDegradedProps, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, scanTokenNullProps, setStructuralFaultForTest, sqlInjection, stripeWebhookUnprotected, structuralParseCount, supabaseFunctionName, supabaseNoRLS, testPathHold, toAiDegraded, todoLeftInCode, tryParse, unknownAiStatus, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, widenedAuthSuppresses, xssVulnerability };
|