xploitscan-shared-rules 2.4.12 → 2.4.14

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
@@ -165,7 +165,7 @@ interface CustomRule {
165
165
  * before a scan can be saved without enough provenance to explain a changed
166
166
  * grade.
167
167
  */
168
- declare const SCANNER_VERSION = "2.4.12";
168
+ declare const SCANNER_VERSION = "2.4.14";
169
169
 
170
170
  /**
171
171
  * Line-oriented helpers shared by every rule. Pure string manipulation — no fs
@@ -1097,6 +1097,11 @@ declare function tryParse(content: string, filePath: string): {
1097
1097
  taint: TaintMap;
1098
1098
  } | null;
1099
1099
  declare const hardcodedSecrets: CustomRule;
1100
+ /**
1101
+ * Secret strings VC001 would report for this text. Same patterns and the same
1102
+ * filters as `hardcodedSecrets.check` — no second copy of the regexes.
1103
+ */
1104
+ declare function hardcodedSecretValues(content: string, filePath: string): string[];
1100
1105
  declare const exposedEnvFile: CustomRule;
1101
1106
  /**
1102
1107
  * Blank the parts of a file that LOOK like caller authentication but are the
@@ -1276,6 +1281,22 @@ interface FilteredFinding {
1276
1281
  finding: Finding;
1277
1282
  reason: string;
1278
1283
  }
1284
+ /**
1285
+ * Counts-only proof that #945 masking held on what was actually sent. Integers
1286
+ * and one boolean. Never prompt text, secrets, hashes, excerpts, paths, or reasons.
1287
+ */
1288
+ interface MaskStats {
1289
+ /** Model calls attempted (one prompt each). */
1290
+ prompt_batches: number;
1291
+ /** Sum of outbound prompt lengths. */
1292
+ prompt_chars: number;
1293
+ /** Distinct detected values per batch (max 512 each) absent from the sent prompt. */
1294
+ masked_count: number;
1295
+ /** True when any batch had at least one detected value. */
1296
+ had_secret_pattern: boolean;
1297
+ /** Distinct detected values per batch (max 512 each) still present raw. Must be 0. */
1298
+ raw_after_mask: number;
1299
+ }
1279
1300
  interface AIFilterResult {
1280
1301
  findings: Finding[];
1281
1302
  filteredFindings: FilteredFinding[];
@@ -1295,6 +1316,8 @@ interface AIFilterResult {
1295
1316
  missingContentCount: number;
1296
1317
  /** True only when the deadline or an individual model-call timeout elapsed. */
1297
1318
  timedOut: boolean;
1319
+ /** #945 proof. Logged by the API as the fixed-shape ai_fp_mask line only. */
1320
+ maskStats: MaskStats;
1298
1321
  }
1299
1322
  /**
1300
1323
  * Findings the AI must never delete. Criticals and live/Secrets stay reported
@@ -1367,6 +1390,16 @@ declare function scanEntropy(files: {
1367
1390
  content: string;
1368
1391
  }[]): Finding[];
1369
1392
 
1393
+ /**
1394
+ * Redact one secret value before it can leave the process.
1395
+ *
1396
+ * First 6 characters, three ASCII dots, last 4. Shorter values are replaced
1397
+ * entirely: the published privacy text allows no more than the first 6 and
1398
+ * last 4, and a value under 12 characters cannot show both without overlap
1399
+ * that reveals the whole string.
1400
+ */
1401
+ declare function maskSecretValue(v: string): string;
1402
+
1370
1403
  /**
1371
1404
  * Dependency Vulnerability Scanner
1372
1405
  * Parses package.json, requirements.txt, Gemfile, etc. and checks
@@ -1695,4 +1728,4 @@ input: {
1695
1728
  content: string;
1696
1729
  }[] | QualityContext, rules?: QualityRule[]): Finding[];
1697
1730
 
1698
- 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, GRADE_FINDINGS_PER_RULE, 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, SCANNER_VERSION, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, 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, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, 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 };
1731
+ 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, GRADE_FINDINGS_PER_RULE, 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, SCANNER_VERSION, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, 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, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, 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, 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
@@ -165,7 +165,7 @@ interface CustomRule {
165
165
  * before a scan can be saved without enough provenance to explain a changed
166
166
  * grade.
167
167
  */
168
- declare const SCANNER_VERSION = "2.4.12";
168
+ declare const SCANNER_VERSION = "2.4.14";
169
169
 
170
170
  /**
171
171
  * Line-oriented helpers shared by every rule. Pure string manipulation — no fs
@@ -1097,6 +1097,11 @@ declare function tryParse(content: string, filePath: string): {
1097
1097
  taint: TaintMap;
1098
1098
  } | null;
1099
1099
  declare const hardcodedSecrets: CustomRule;
1100
+ /**
1101
+ * Secret strings VC001 would report for this text. Same patterns and the same
1102
+ * filters as `hardcodedSecrets.check` — no second copy of the regexes.
1103
+ */
1104
+ declare function hardcodedSecretValues(content: string, filePath: string): string[];
1100
1105
  declare const exposedEnvFile: CustomRule;
1101
1106
  /**
1102
1107
  * Blank the parts of a file that LOOK like caller authentication but are the
@@ -1276,6 +1281,22 @@ interface FilteredFinding {
1276
1281
  finding: Finding;
1277
1282
  reason: string;
1278
1283
  }
1284
+ /**
1285
+ * Counts-only proof that #945 masking held on what was actually sent. Integers
1286
+ * and one boolean. Never prompt text, secrets, hashes, excerpts, paths, or reasons.
1287
+ */
1288
+ interface MaskStats {
1289
+ /** Model calls attempted (one prompt each). */
1290
+ prompt_batches: number;
1291
+ /** Sum of outbound prompt lengths. */
1292
+ prompt_chars: number;
1293
+ /** Distinct detected values per batch (max 512 each) absent from the sent prompt. */
1294
+ masked_count: number;
1295
+ /** True when any batch had at least one detected value. */
1296
+ had_secret_pattern: boolean;
1297
+ /** Distinct detected values per batch (max 512 each) still present raw. Must be 0. */
1298
+ raw_after_mask: number;
1299
+ }
1279
1300
  interface AIFilterResult {
1280
1301
  findings: Finding[];
1281
1302
  filteredFindings: FilteredFinding[];
@@ -1295,6 +1316,8 @@ interface AIFilterResult {
1295
1316
  missingContentCount: number;
1296
1317
  /** True only when the deadline or an individual model-call timeout elapsed. */
1297
1318
  timedOut: boolean;
1319
+ /** #945 proof. Logged by the API as the fixed-shape ai_fp_mask line only. */
1320
+ maskStats: MaskStats;
1298
1321
  }
1299
1322
  /**
1300
1323
  * Findings the AI must never delete. Criticals and live/Secrets stay reported
@@ -1367,6 +1390,16 @@ declare function scanEntropy(files: {
1367
1390
  content: string;
1368
1391
  }[]): Finding[];
1369
1392
 
1393
+ /**
1394
+ * Redact one secret value before it can leave the process.
1395
+ *
1396
+ * First 6 characters, three ASCII dots, last 4. Shorter values are replaced
1397
+ * entirely: the published privacy text allows no more than the first 6 and
1398
+ * last 4, and a value under 12 characters cannot show both without overlap
1399
+ * that reveals the whole string.
1400
+ */
1401
+ declare function maskSecretValue(v: string): string;
1402
+
1370
1403
  /**
1371
1404
  * Dependency Vulnerability Scanner
1372
1405
  * Parses package.json, requirements.txt, Gemfile, etc. and checks
@@ -1695,4 +1728,4 @@ input: {
1695
1728
  content: string;
1696
1729
  }[] | QualityContext, rules?: QualityRule[]): Finding[];
1697
1730
 
1698
- 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, GRADE_FINDINGS_PER_RULE, 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, SCANNER_VERSION, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, 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, hardcodedSecrets, harvestIntent, insecureCookies, insecureRandomness, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, isPrivateAddress, isProtectedFromAiRemoval, isSbomPath, isServerSideFile, isServerTarget, isTestFile, isTestPath, isUngradedFinding, isVendoredFinding, isVendoredPath, lineNumberAt, lineTextAt, maskComments, maskOutboundAuthNoise, missingAuthMiddleware, missingCSP, missingErrorBoundary, missingHTTPS, missingLockFile, newDataFence, nextPublicSecret, noRateLimiting, normalizeScanPath, packReviewBatches, 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 };
1731
+ 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, GRADE_FINDINGS_PER_RULE, 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, SCANNER_VERSION, SERVER_ACTION_WRITE_RE, type SecurityGrade, type Severity, TEST_FILE_PATTERN, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, allRules, assessHeaders, astMatch, 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, isCalleeNamed, isClientTarget, isCommentLine, isDotenvPath, isInlineSilenced, isInsideFixMessage, isLineSilenced, isLive, isMethodCall, 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, qualityRules, replaceBlockComments, routeForFile, runCustomRules, scanConfigs, scanDependencies, scanEntropy, scanMultiFile, scanQuality, sqlInjection, stripeWebhookUnprotected, supabaseFunctionName, supabaseNoRLS, todoLeftInCode, tryParse, unmeasuredQualityRules, unvalidatedRedirect, vendoredReason, visitBinary, visitCalls, weakHashing, xssVulnerability };