xploitscan-shared-rules 2.1.0 → 2.2.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.d.cts CHANGED
@@ -956,6 +956,16 @@ declare function isInsideFixMessage(content: string, matchIndex: number): boolea
956
956
  */
957
957
  declare function filterSilenced(matches: RuleMatch[], content: string, ruleId: string): RuleMatch[];
958
958
  declare function findMatches(content: string, pattern: RegExp, rule: Omit<CustomRule, "check">, filePath: string, fixTemplate?: (match: RegExpExecArray) => string): RuleMatch[];
959
+ /**
960
+ * findMatches for a matcher that is not a single RegExp — one a regex can
961
+ * only express with super-linear backtracking. `found` yields the matches'
962
+ * start indices in increasing order, as RegExp#exec would; the comment and
963
+ * fix-message skips, line numbers and the per-file cap are findMatches' own,
964
+ * so a rule moved off a regex reports exactly what the regex reported.
965
+ */
966
+ declare function findMatchesAt<M extends {
967
+ index: number;
968
+ }>(content: string, found: Iterable<M>, rule: Omit<CustomRule, "check">, filePath: string, fixTemplate?: (match: M) => string): RuleMatch[];
959
969
  /**
960
970
  * Build a RuleMatch from an AST-derived location. Mirrors findMatches' output
961
971
  * shape so AST-based rules can be mixed into the same Finding stream. `line`
@@ -1193,6 +1203,40 @@ declare function scanEntropy(files: {
1193
1203
  content: string;
1194
1204
  }[]): Finding[];
1195
1205
 
1206
+ /**
1207
+ * Dependency Vulnerability Scanner
1208
+ * Parses package.json, requirements.txt, Gemfile, etc. and checks
1209
+ * for known vulnerable packages and risky dependency patterns.
1210
+ */
1211
+
1212
+ declare function scanDependencies(files: {
1213
+ path: string;
1214
+ content: string;
1215
+ }[]): Finding[];
1216
+
1217
+ /**
1218
+ * Configuration File Deep Analyzer
1219
+ * Analyzes tsconfig, next.config, Dockerfile, GitHub Actions,
1220
+ * and other config files for security misconfigurations.
1221
+ */
1222
+
1223
+ declare function scanConfigs(files: {
1224
+ path: string;
1225
+ content: string;
1226
+ }[]): Finding[];
1227
+
1228
+ /**
1229
+ * Multi-File Analysis Scanner
1230
+ * Analyzes relationships between files to detect cross-file vulnerabilities
1231
+ * that single-file scanners miss.
1232
+ */
1233
+
1234
+ interface FileInfo {
1235
+ path: string;
1236
+ content: string;
1237
+ }
1238
+ declare function scanMultiFile(files: FileInfo[]): Finding[];
1239
+
1196
1240
  /**
1197
1241
  * URL recon — what can be learned about a deployed app from what it already
1198
1242
  * serves the public.
@@ -1487,4 +1531,4 @@ input: {
1487
1531
  content: string;
1488
1532
  }[] | QualityContext, rules?: QualityRule[]): Finding[];
1489
1533
 
1490
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, buildProjectContext, buildQualityContext, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, hardcodedJWTSecret, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isMethodCall, isPrivateAddress, isServerSideFile, isServerTarget, isTestFile, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, nextPublicSecret, noRateLimiting, normalizeScanPath, parseFile, parseScanTarget, parseSupabaseConfig, qualityRules, replaceBlockComments, routeForFile, runCustomRules, scanEntropy, scanQuality, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, todoLeftInCode, tryParse, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, xssVulnerability };
1534
+ export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, buildProjectContext, buildQualityContext, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, hardcodedJWTSecret, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isMethodCall, isPrivateAddress, isServerSideFile, isServerTarget, isTestFile, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, nextPublicSecret, noRateLimiting, normalizeScanPath, parseFile, parseScanTarget, parseSupabaseConfig, qualityRules, replaceBlockComments, routeForFile, runCustomRules, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, todoLeftInCode, tryParse, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, xssVulnerability };
package/dist/index.d.ts CHANGED
@@ -956,6 +956,16 @@ declare function isInsideFixMessage(content: string, matchIndex: number): boolea
956
956
  */
957
957
  declare function filterSilenced(matches: RuleMatch[], content: string, ruleId: string): RuleMatch[];
958
958
  declare function findMatches(content: string, pattern: RegExp, rule: Omit<CustomRule, "check">, filePath: string, fixTemplate?: (match: RegExpExecArray) => string): RuleMatch[];
959
+ /**
960
+ * findMatches for a matcher that is not a single RegExp — one a regex can
961
+ * only express with super-linear backtracking. `found` yields the matches'
962
+ * start indices in increasing order, as RegExp#exec would; the comment and
963
+ * fix-message skips, line numbers and the per-file cap are findMatches' own,
964
+ * so a rule moved off a regex reports exactly what the regex reported.
965
+ */
966
+ declare function findMatchesAt<M extends {
967
+ index: number;
968
+ }>(content: string, found: Iterable<M>, rule: Omit<CustomRule, "check">, filePath: string, fixTemplate?: (match: M) => string): RuleMatch[];
959
969
  /**
960
970
  * Build a RuleMatch from an AST-derived location. Mirrors findMatches' output
961
971
  * shape so AST-based rules can be mixed into the same Finding stream. `line`
@@ -1193,6 +1203,40 @@ declare function scanEntropy(files: {
1193
1203
  content: string;
1194
1204
  }[]): Finding[];
1195
1205
 
1206
+ /**
1207
+ * Dependency Vulnerability Scanner
1208
+ * Parses package.json, requirements.txt, Gemfile, etc. and checks
1209
+ * for known vulnerable packages and risky dependency patterns.
1210
+ */
1211
+
1212
+ declare function scanDependencies(files: {
1213
+ path: string;
1214
+ content: string;
1215
+ }[]): Finding[];
1216
+
1217
+ /**
1218
+ * Configuration File Deep Analyzer
1219
+ * Analyzes tsconfig, next.config, Dockerfile, GitHub Actions,
1220
+ * and other config files for security misconfigurations.
1221
+ */
1222
+
1223
+ declare function scanConfigs(files: {
1224
+ path: string;
1225
+ content: string;
1226
+ }[]): Finding[];
1227
+
1228
+ /**
1229
+ * Multi-File Analysis Scanner
1230
+ * Analyzes relationships between files to detect cross-file vulnerabilities
1231
+ * that single-file scanners miss.
1232
+ */
1233
+
1234
+ interface FileInfo {
1235
+ path: string;
1236
+ content: string;
1237
+ }
1238
+ declare function scanMultiFile(files: FileInfo[]): Finding[];
1239
+
1196
1240
  /**
1197
1241
  * URL recon — what can be learned about a deployed app from what it already
1198
1242
  * serves the public.
@@ -1487,4 +1531,4 @@ input: {
1487
1531
  content: string;
1488
1532
  }[] | QualityContext, rules?: QualityRule[]): Finding[];
1489
1533
 
1490
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, buildProjectContext, buildQualityContext, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, hardcodedJWTSecret, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isMethodCall, isPrivateAddress, isServerSideFile, isServerTarget, isTestFile, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, nextPublicSecret, noRateLimiting, normalizeScanPath, parseFile, parseScanTarget, parseSupabaseConfig, qualityRules, replaceBlockComments, routeForFile, runCustomRules, scanEntropy, scanQuality, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, todoLeftInCode, tryParse, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, xssVulnerability };
1534
+ export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, DOTENV_ASSIGN_RE, type DetectedFramework, type ExposedConfig, type Exposure, FREE_RULE_COUNT, type FilteredFinding, type Finding, type GradeOptions, type GradeResult, type HeaderFinding, INTENT_EXPECTATIONS, type IntentExpectation, type IntentMismatch, type IntentOrigin, type IntentReport, type IntentStatement, MODEL_ANALYSIS, MODEL_POLICY_REVIEWED, MODEL_REVIEW_INTERVAL_DAYS, MODEL_TEMPERATURE, MODEL_TRIAGE, NON_APP_PATH_PATTERNS, PRO_RULE_COUNT, PUBLIC_ENV_PREFIX_RE, type ParsedFile, type ProjectContext, QUALITY_EXAMPLES, type QualityContext, type QualityExample, type QualityFile, type QualityHit, type QualityRule, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, buildProjectContext, buildQualityContext, buildTaintMap, calculateGrade, callSpreads, checkIntent, classifyExposure, classifyPublicEnvVar, classifyStatement, clientSideAuth, complianceMap, consoleLogProduction, corsWildcard, dangerousInnerHTML, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, dotenvValue, emptyCatchBlock, enclosingHandler, envNotGitignored, evalUsage, exposedAuthSecret, exposedDebugMode, exposedEnvFile, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, filterSilenced, findMatches, findMatchesAt, findSourceMapRefs, freeRules, getObjectProperty, getSnippet, hardcodedJWTSecret, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isMethodCall, isPrivateAddress, isServerSideFile, isServerTarget, isTestFile, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, nextPublicSecret, noRateLimiting, normalizeScanPath, parseFile, parseScanTarget, parseSupabaseConfig, qualityRules, replaceBlockComments, routeForFile, runCustomRules, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, todoLeftInCode, tryParse, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, xssVulnerability };