xploitscan-shared-rules 1.27.4 → 1.28.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
@@ -625,6 +625,23 @@ declare function checkIntent(files: Array<{
625
625
  content: string;
626
626
  }>, findings: Finding[]): IntentReport;
627
627
 
628
+ declare const TEST_FILE_PATTERN: RegExp;
629
+ /**
630
+ * Blank out comments while preserving every byte offset and newline.
631
+ *
632
+ * The usual `codeOnly` idiom in this file DELETES comments, which shifts every
633
+ * index after the first one — fine for rules that only ask "does this token
634
+ * appear?", useless for anything that reports a line number or slices a scope
635
+ * by index.
636
+ *
637
+ * Needed because prose is indistinguishable from code to a regex. A clean
638
+ * fixture written as `// Sequelize .find({ where }) scoped by the owner` had
639
+ * its COMMENT matched as the record lookup, so the query scope resolved to
640
+ * `({ where })` — no ownership token, and a correctly-scoped query was
641
+ * reported as an IDOR. Real code is full of comments that quote the code
642
+ * beneath them, so this is not a fixture artefact.
643
+ */
644
+ declare function maskComments(content: string): string;
628
645
  declare const hardcodedSecrets: CustomRule;
629
646
  declare const exposedEnvFile: CustomRule;
630
647
  declare const missingAuthMiddleware: CustomRule;
@@ -1237,4 +1254,106 @@ declare function getObjectProperty(node: ObjectExpression, key: string): {
1237
1254
  /** Does this CallExpression spread an expression `matcher` returns true for? */
1238
1255
  declare function callSpreads(call: CallExpression, matcher: (node: Node) => boolean): boolean;
1239
1256
 
1240
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, 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, type ParsedFile, type ProjectContext, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, accountStateFromWebStorage, allCustomRules, allRules, androidDebuggable, assessHeaders, blockingMainThread, buildProjectContext, buildTaintMap, calculateGrade, callSpreads, callbackHell, checkIntent, classifyExposure, classifyStatement, clickjacking, clientComponentSecret, clientSideAuth, commandInjection, complianceMap, consoleLogProduction, corsLocalhost, corsServerless, corsWildcard, dangerousInnerHTML, deprecatedTLS, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, djangoDebug, dockerCopySensitive, dockerLatestTag, dockerRunAsRoot, dockerTooManyPorts, dockerfileADDInsteadOfCOPY, dockerfileMissingHealthcheck, dockerfileUnverifiedShellPipe, ecbModeEncryption, electronNavigationUnrestricted, emptyCatchBlock, entitlementFromWebStorage, envNotGitignored, evalUsage, eventListenerLeak, exposedAdminRoutes, exposedAuthSecret, exposedDBCredentials, exposedDatabaseStudio, exposedDebugMode, exposedDockerPorts, exposedEnvFile, exposedGitDir, exposedServerActions, exposedSourceMaps, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, findSourceMapRefs, firebaseClientConfig, flaskSecretKey, freeRules, getObjectProperty, getSnippet, ghaExpressionInjection, ghaPermissionsWriteAll, ghaPullRequestTargetCheckout, ghaThirdPartyActionWithSecrets, githubActionsInjection, graphqlCSRFDisabled, graphqlIntrospection, graphqlNoComplexityLimit, graphqlNoDepthLimit, hardcodedAlgoliaAdminKey, hardcodedAnthropicKey, hardcodedCloudflareToken, hardcodedCohereKey, hardcodedCreditCard, hardcodedDatadogKey, hardcodedDiscordToken, hardcodedEncryptionKey, hardcodedFastlyToken, hardcodedFireworksKey, hardcodedFlyToken, hardcodedGCPServiceAccount, hardcodedGitHubPAT, hardcodedGitLabToken, hardcodedGroqKey, hardcodedHighlightKey, hardcodedIPAllowlist, hardcodedIntercomToken, hardcodedJWTSecret, hardcodedLinearKey, hardcodedLogtailToken, hardcodedLoopsKey, hardcodedMailgunKey, hardcodedMistralKey, hardcodedNetlifyToken, hardcodedNotionKey, hardcodedOAuthSecret, hardcodedPineconeKey, hardcodedPlivoToken, hardcodedPostmarkKey, hardcodedQdrantKey, hardcodedRailwayToken, hardcodedReplicateKey, hardcodedResendKey, hardcodedSSN, hardcodedSecrets, hardcodedSendGridKey, hardcodedSentryAuthToken, hardcodedShopifyToken, hardcodedSlackToken, hardcodedSupabaseServiceRole, hardcodedTogetherKey, hardcodedTwilioKey, hardcodedVaultToken, hardcodedVercelToken, hardcodedWeaviateKey, harvestIntent, hostHeaderRedirect, httpRequestSmuggling, insecureCookies, insecureDeepLink, insecureDeserialization, insecureDirectObjectReference, insecureElectronWindow, insecureFileUpload, insecureGRPC, insecureHTTPMethods, insecurePasswordReset, insecureRandomness, insecureWebSocket, ipcPathTraversal, isCalleeNamed, isMethodCall, isPrivateAddress, isVendoredFinding, isVendoredPath, javaDeserialization, jwtAlgConfusion, k8sNoResourceLimits, k8sPrivileged, k8sSecretNotEncrypted, lambdaWithoutVPC, largeBundleImport, llmCallNoMaxTokens, llmOutputAsHTML, llmOutputToSink, llmPromptInjection, llmSystemPromptInjection, logInjection, magicNumbers, massAssignment, middlewareMatcherExcludesApi, missingAIRateLimit, missingAuthMiddleware, missingAuthRateLimit, missingBruteForce, missingCSP, missingCSRF, missingCertPinning, missingCloudTrail, missingContentDisposition, missingDBEncryption, missingErrorBoundary, missingFileSizeLimits, missingHSTS, missingHTTPS, missingLockFile, missingOAuthState, missingPagination, missingRequestSizeLimit, missingRequestValidation, missingSRI, missingSecurityMeta, nPlusOneQuery, nextPublicSecret, noRateLimiting, normalizeScanPath, nosqlInjection, openRedirectParams, overlyPermissiveIAM, parseFile, parseScanTarget, parseSupabaseConfig, pathTraversal, pickleDeserialization, piiInLogs, proOnlyRules, prototypePollution, pyDjangoAllowedHostsWildcard, pyDjangoMarkSafe, pyJWTDecodeWeakConfig, pyJinja2AutoescapeOff, pyParamikoAutoAdd, pyRequestsVerifyFalse, pyTempfileMktemp, raceCondition, rdsPubliclyAccessible, reflectedCORSOrigin, regexDos, routeForFile, runCustomRules, s3BucketNoEncryption, scanEntropy, secretInBundleConfig, secretInCLIArgument, secretInErrorResponse, secretInHTMLAttribute, secretInLLMPrompt, secretInURLParam, secretLoggedToConsole, secretsInCI, securityGroupAllInbound, sensitiveAsyncStorage, sensitiveLocalStorage, sensitiveURLParams, sessionFixation, sqlInjection, ssrfVulnerability, ssti, stripeWebhookUnprotected, supabaseAnonAdmin, supabaseFunctionName, supabaseNoRLS, syncFileOps, terraformStateExposed, timingAttack, todoLeftInCode, unencryptedPII, unpinnedGitHubAction, unprotectedAPIRoutes, unprotectedDownload, unsafeObjectAssign, unsanitizedFilenames, unsanitizedHTMLExport, unvalidatedAPIParams, unvalidatedEventData, unvalidatedRedirect, vectorStoreQueryNoUserFilter, vectorStoreUpsertNoMetadata, vendoredReason, visitBinary, visitCalls, vulnerableDependencies, weakHashing, weakPasswordRequirements, weakRSAKeySize, webhookMissingIdempotency, webhookSignatureVerification, xssVulnerability, xxeVulnerability };
1257
+ /**
1258
+ * Quality rules — a separate catalogue from the VC security rules.
1259
+ *
1260
+ * The VC rules answer "can someone attack this?". These answer a different
1261
+ * question: "is this app telling its owner and its users the truth?" A
1262
+ * checklist that saves over itself, a page that reports "no activity" when the
1263
+ * database was unreachable, a dashboard showing a credit that never moved —
1264
+ * none of those are security findings, and no SAST tool looks for them.
1265
+ *
1266
+ * They are deliberately NOT in `allCustomRules`. That catalogue's size is
1267
+ * quoted in pricing copy, the README, the Docker image and the freshness
1268
+ * ledger, and it means "security rules". Mixing these in would silently change
1269
+ * a number that eleven surfaces assert.
1270
+ *
1271
+ * WHY A SEPARATE ENGINE AND NOT A RULE. Six of these eight need to see more
1272
+ * than one file, or need the enclosing function rather than a character
1273
+ * window. `types.ts` fixes the rule contract as single-file on purpose, and
1274
+ * project-context.ts rules out growing it into a cross-file analyser. So this
1275
+ * is an engine over the whole file set, like scanEntropy and scanDependencies,
1276
+ * rather than an entry in a catalogue that cannot express it.
1277
+ *
1278
+ * EVERY RULE HERE EARNED ITS PLACE BY SURVIVING AN ATTACK. Each began as a
1279
+ * real defect found in this product, was then handed to an adversarial review
1280
+ * whose only job was to find legitimate code that would trip it, and ships
1281
+ * only with the narrowing that survived. Four candidates did not survive and
1282
+ * are not here. The precision bar is the product: a noisy rule trains people
1283
+ * to ignore the tool, which is worse than having no rule at all.
1284
+ */
1285
+ interface QualityRule {
1286
+ /** QA-namespaced, so it can never be mistaken for a security rule. */
1287
+ id: string;
1288
+ title: string;
1289
+ severity: Severity;
1290
+ category: string;
1291
+ /** What the defect costs the person running the app, in one sentence. */
1292
+ description: string;
1293
+ /** What to do about it. */
1294
+ fix: string;
1295
+ /**
1296
+ * The narrowing this rule shipped with, in prose.
1297
+ *
1298
+ * Recorded on the rule because every one of these was dangerous before it
1299
+ * was narrowed, and the next person to "simplify" the conditions needs to
1300
+ * know which legitimate pattern each clause was protecting.
1301
+ */
1302
+ precisionNotes: string;
1303
+ check(ctx: QualityContext): QualityHit[];
1304
+ }
1305
+ /** A hit, before it is decorated into a Finding. */
1306
+ interface QualityHit {
1307
+ file: string;
1308
+ line: number;
1309
+ /** Optional override when one rule reports distinguishable variants. */
1310
+ detail?: string;
1311
+ }
1312
+ /**
1313
+ * Everything a quality rule is allowed to look at.
1314
+ *
1315
+ * Handed the whole file set, because that is the point of this engine — but
1316
+ * with the per-file work (parsing, comment masking, classification) done once
1317
+ * and shared, so eight rules over a 10k-file repo do not parse it eight times.
1318
+ */
1319
+ interface QualityContext {
1320
+ files: QualityFile[];
1321
+ /** Lookup by exact path, for rules that follow an import. */
1322
+ byPath: Map<string, QualityFile>;
1323
+ }
1324
+ interface QualityFile {
1325
+ path: string;
1326
+ content: string;
1327
+ /** Comments blanked, byte offsets and line numbers preserved. */
1328
+ code: string;
1329
+ /** Null when the file is not JS/TS or failed to parse — rules must handle it. */
1330
+ parsed: ParsedFile | null;
1331
+ /** True for anything a rule should never report: tests, stories, fixtures, mocks, vendored code. */
1332
+ excluded: boolean;
1333
+ /** React client code: a "use client" directive or React state hooks. */
1334
+ isClient: boolean;
1335
+ /** Server code: a route handler, server action, middleware or edge function. */
1336
+ isServer: boolean;
1337
+ }
1338
+
1339
+ /**
1340
+ * The quality catalogue.
1341
+ *
1342
+ * Deliberately NOT merged into `allCustomRules`: that number is quoted in
1343
+ * pricing copy, the README, the Docker image and the freshness ledger, and it
1344
+ * means "security rules". These answer a different question and are counted
1345
+ * separately.
1346
+ */
1347
+ declare const qualityRules: QualityRule[];
1348
+ /**
1349
+ * Run the quality catalogue over a whole file set.
1350
+ *
1351
+ * Parallel to scanEntropy and scanDependencies: an engine, not a rule, because
1352
+ * most of these need more than the single file the rule contract allows.
1353
+ */
1354
+ declare function scanQuality(files: {
1355
+ path: string;
1356
+ content: string;
1357
+ }[], rules?: QualityRule[]): Finding[];
1358
+
1359
+ export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, 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, type ParsedFile, type ProjectContext, type QualityContext, 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, accountStateFromWebStorage, allCustomRules, allRules, androidDebuggable, assessHeaders, blockingMainThread, buildProjectContext, buildTaintMap, calculateGrade, callSpreads, callbackHell, checkIntent, classifyExposure, classifyStatement, clickjacking, clientComponentSecret, clientSideAuth, commandInjection, complianceMap, consoleLogProduction, corsLocalhost, corsServerless, corsWildcard, dangerousInnerHTML, deprecatedTLS, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, djangoDebug, dockerCopySensitive, dockerLatestTag, dockerRunAsRoot, dockerTooManyPorts, dockerfileADDInsteadOfCOPY, dockerfileMissingHealthcheck, dockerfileUnverifiedShellPipe, ecbModeEncryption, electronNavigationUnrestricted, emptyCatchBlock, entitlementFromWebStorage, envNotGitignored, evalUsage, eventListenerLeak, exposedAdminRoutes, exposedAuthSecret, exposedDBCredentials, exposedDatabaseStudio, exposedDebugMode, exposedDockerPorts, exposedEnvFile, exposedGitDir, exposedServerActions, exposedSourceMaps, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, findSourceMapRefs, firebaseClientConfig, flaskSecretKey, freeRules, getObjectProperty, getSnippet, ghaExpressionInjection, ghaPermissionsWriteAll, ghaPullRequestTargetCheckout, ghaThirdPartyActionWithSecrets, githubActionsInjection, graphqlCSRFDisabled, graphqlIntrospection, graphqlNoComplexityLimit, graphqlNoDepthLimit, hardcodedAlgoliaAdminKey, hardcodedAnthropicKey, hardcodedCloudflareToken, hardcodedCohereKey, hardcodedCreditCard, hardcodedDatadogKey, hardcodedDiscordToken, hardcodedEncryptionKey, hardcodedFastlyToken, hardcodedFireworksKey, hardcodedFlyToken, hardcodedGCPServiceAccount, hardcodedGitHubPAT, hardcodedGitLabToken, hardcodedGroqKey, hardcodedHighlightKey, hardcodedIPAllowlist, hardcodedIntercomToken, hardcodedJWTSecret, hardcodedLinearKey, hardcodedLogtailToken, hardcodedLoopsKey, hardcodedMailgunKey, hardcodedMistralKey, hardcodedNetlifyToken, hardcodedNotionKey, hardcodedOAuthSecret, hardcodedPineconeKey, hardcodedPlivoToken, hardcodedPostmarkKey, hardcodedQdrantKey, hardcodedRailwayToken, hardcodedReplicateKey, hardcodedResendKey, hardcodedSSN, hardcodedSecrets, hardcodedSendGridKey, hardcodedSentryAuthToken, hardcodedShopifyToken, hardcodedSlackToken, hardcodedSupabaseServiceRole, hardcodedTogetherKey, hardcodedTwilioKey, hardcodedVaultToken, hardcodedVercelToken, hardcodedWeaviateKey, harvestIntent, hostHeaderRedirect, httpRequestSmuggling, insecureCookies, insecureDeepLink, insecureDeserialization, insecureDirectObjectReference, insecureElectronWindow, insecureFileUpload, insecureGRPC, insecureHTTPMethods, insecurePasswordReset, insecureRandomness, insecureWebSocket, ipcPathTraversal, isCalleeNamed, isMethodCall, isPrivateAddress, isVendoredFinding, isVendoredPath, javaDeserialization, jwtAlgConfusion, k8sNoResourceLimits, k8sPrivileged, k8sSecretNotEncrypted, lambdaWithoutVPC, largeBundleImport, llmCallNoMaxTokens, llmOutputAsHTML, llmOutputToSink, llmPromptInjection, llmSystemPromptInjection, logInjection, magicNumbers, maskComments, massAssignment, middlewareMatcherExcludesApi, missingAIRateLimit, missingAuthMiddleware, missingAuthRateLimit, missingBruteForce, missingCSP, missingCSRF, missingCertPinning, missingCloudTrail, missingContentDisposition, missingDBEncryption, missingErrorBoundary, missingFileSizeLimits, missingHSTS, missingHTTPS, missingLockFile, missingOAuthState, missingPagination, missingRequestSizeLimit, missingRequestValidation, missingSRI, missingSecurityMeta, nPlusOneQuery, nextPublicSecret, noRateLimiting, normalizeScanPath, nosqlInjection, openRedirectParams, overlyPermissiveIAM, parseFile, parseScanTarget, parseSupabaseConfig, pathTraversal, pickleDeserialization, piiInLogs, proOnlyRules, prototypePollution, pyDjangoAllowedHostsWildcard, pyDjangoMarkSafe, pyJWTDecodeWeakConfig, pyJinja2AutoescapeOff, pyParamikoAutoAdd, pyRequestsVerifyFalse, pyTempfileMktemp, qualityRules, raceCondition, rdsPubliclyAccessible, reflectedCORSOrigin, regexDos, routeForFile, runCustomRules, s3BucketNoEncryption, scanEntropy, scanQuality, secretInBundleConfig, secretInCLIArgument, secretInErrorResponse, secretInHTMLAttribute, secretInLLMPrompt, secretInURLParam, secretLoggedToConsole, secretsInCI, securityGroupAllInbound, sensitiveAsyncStorage, sensitiveLocalStorage, sensitiveURLParams, sessionFixation, sqlInjection, ssrfVulnerability, ssti, stripeWebhookUnprotected, supabaseAnonAdmin, supabaseFunctionName, supabaseNoRLS, syncFileOps, terraformStateExposed, timingAttack, todoLeftInCode, unencryptedPII, unpinnedGitHubAction, unprotectedAPIRoutes, unprotectedDownload, unsafeObjectAssign, unsanitizedFilenames, unsanitizedHTMLExport, unvalidatedAPIParams, unvalidatedEventData, unvalidatedRedirect, vectorStoreQueryNoUserFilter, vectorStoreUpsertNoMetadata, vendoredReason, visitBinary, visitCalls, vulnerableDependencies, weakHashing, weakPasswordRequirements, weakRSAKeySize, webhookMissingIdempotency, webhookSignatureVerification, xssVulnerability, xxeVulnerability };
package/dist/index.d.ts CHANGED
@@ -625,6 +625,23 @@ declare function checkIntent(files: Array<{
625
625
  content: string;
626
626
  }>, findings: Finding[]): IntentReport;
627
627
 
628
+ declare const TEST_FILE_PATTERN: RegExp;
629
+ /**
630
+ * Blank out comments while preserving every byte offset and newline.
631
+ *
632
+ * The usual `codeOnly` idiom in this file DELETES comments, which shifts every
633
+ * index after the first one — fine for rules that only ask "does this token
634
+ * appear?", useless for anything that reports a line number or slices a scope
635
+ * by index.
636
+ *
637
+ * Needed because prose is indistinguishable from code to a regex. A clean
638
+ * fixture written as `// Sequelize .find({ where }) scoped by the owner` had
639
+ * its COMMENT matched as the record lookup, so the query scope resolved to
640
+ * `({ where })` — no ownership token, and a correctly-scoped query was
641
+ * reported as an IDOR. Real code is full of comments that quote the code
642
+ * beneath them, so this is not a fixture artefact.
643
+ */
644
+ declare function maskComments(content: string): string;
628
645
  declare const hardcodedSecrets: CustomRule;
629
646
  declare const exposedEnvFile: CustomRule;
630
647
  declare const missingAuthMiddleware: CustomRule;
@@ -1237,4 +1254,106 @@ declare function getObjectProperty(node: ObjectExpression, key: string): {
1237
1254
  /** Does this CallExpression spread an expression `matcher` returns true for? */
1238
1255
  declare function callSpreads(call: CallExpression, matcher: (node: Node) => boolean): boolean;
1239
1256
 
1240
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, 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, type ParsedFile, type ProjectContext, RULE_IMPACTS, type RouteFramework, type RouteTable, type RuleMatch, type SecurityGrade, type Severity, TOTAL_RULE_COUNT, type TaintMap, type TargetCheck, type VibePlatform, accountStateFromWebStorage, allCustomRules, allRules, androidDebuggable, assessHeaders, blockingMainThread, buildProjectContext, buildTaintMap, calculateGrade, callSpreads, callbackHell, checkIntent, classifyExposure, classifyStatement, clickjacking, clientComponentSecret, clientSideAuth, commandInjection, complianceMap, consoleLogProduction, corsLocalhost, corsServerless, corsWildcard, dangerousInnerHTML, deprecatedTLS, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, djangoDebug, dockerCopySensitive, dockerLatestTag, dockerRunAsRoot, dockerTooManyPorts, dockerfileADDInsteadOfCOPY, dockerfileMissingHealthcheck, dockerfileUnverifiedShellPipe, ecbModeEncryption, electronNavigationUnrestricted, emptyCatchBlock, entitlementFromWebStorage, envNotGitignored, evalUsage, eventListenerLeak, exposedAdminRoutes, exposedAuthSecret, exposedDBCredentials, exposedDatabaseStudio, exposedDebugMode, exposedDockerPorts, exposedEnvFile, exposedGitDir, exposedServerActions, exposedSourceMaps, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, findSourceMapRefs, firebaseClientConfig, flaskSecretKey, freeRules, getObjectProperty, getSnippet, ghaExpressionInjection, ghaPermissionsWriteAll, ghaPullRequestTargetCheckout, ghaThirdPartyActionWithSecrets, githubActionsInjection, graphqlCSRFDisabled, graphqlIntrospection, graphqlNoComplexityLimit, graphqlNoDepthLimit, hardcodedAlgoliaAdminKey, hardcodedAnthropicKey, hardcodedCloudflareToken, hardcodedCohereKey, hardcodedCreditCard, hardcodedDatadogKey, hardcodedDiscordToken, hardcodedEncryptionKey, hardcodedFastlyToken, hardcodedFireworksKey, hardcodedFlyToken, hardcodedGCPServiceAccount, hardcodedGitHubPAT, hardcodedGitLabToken, hardcodedGroqKey, hardcodedHighlightKey, hardcodedIPAllowlist, hardcodedIntercomToken, hardcodedJWTSecret, hardcodedLinearKey, hardcodedLogtailToken, hardcodedLoopsKey, hardcodedMailgunKey, hardcodedMistralKey, hardcodedNetlifyToken, hardcodedNotionKey, hardcodedOAuthSecret, hardcodedPineconeKey, hardcodedPlivoToken, hardcodedPostmarkKey, hardcodedQdrantKey, hardcodedRailwayToken, hardcodedReplicateKey, hardcodedResendKey, hardcodedSSN, hardcodedSecrets, hardcodedSendGridKey, hardcodedSentryAuthToken, hardcodedShopifyToken, hardcodedSlackToken, hardcodedSupabaseServiceRole, hardcodedTogetherKey, hardcodedTwilioKey, hardcodedVaultToken, hardcodedVercelToken, hardcodedWeaviateKey, harvestIntent, hostHeaderRedirect, httpRequestSmuggling, insecureCookies, insecureDeepLink, insecureDeserialization, insecureDirectObjectReference, insecureElectronWindow, insecureFileUpload, insecureGRPC, insecureHTTPMethods, insecurePasswordReset, insecureRandomness, insecureWebSocket, ipcPathTraversal, isCalleeNamed, isMethodCall, isPrivateAddress, isVendoredFinding, isVendoredPath, javaDeserialization, jwtAlgConfusion, k8sNoResourceLimits, k8sPrivileged, k8sSecretNotEncrypted, lambdaWithoutVPC, largeBundleImport, llmCallNoMaxTokens, llmOutputAsHTML, llmOutputToSink, llmPromptInjection, llmSystemPromptInjection, logInjection, magicNumbers, massAssignment, middlewareMatcherExcludesApi, missingAIRateLimit, missingAuthMiddleware, missingAuthRateLimit, missingBruteForce, missingCSP, missingCSRF, missingCertPinning, missingCloudTrail, missingContentDisposition, missingDBEncryption, missingErrorBoundary, missingFileSizeLimits, missingHSTS, missingHTTPS, missingLockFile, missingOAuthState, missingPagination, missingRequestSizeLimit, missingRequestValidation, missingSRI, missingSecurityMeta, nPlusOneQuery, nextPublicSecret, noRateLimiting, normalizeScanPath, nosqlInjection, openRedirectParams, overlyPermissiveIAM, parseFile, parseScanTarget, parseSupabaseConfig, pathTraversal, pickleDeserialization, piiInLogs, proOnlyRules, prototypePollution, pyDjangoAllowedHostsWildcard, pyDjangoMarkSafe, pyJWTDecodeWeakConfig, pyJinja2AutoescapeOff, pyParamikoAutoAdd, pyRequestsVerifyFalse, pyTempfileMktemp, raceCondition, rdsPubliclyAccessible, reflectedCORSOrigin, regexDos, routeForFile, runCustomRules, s3BucketNoEncryption, scanEntropy, secretInBundleConfig, secretInCLIArgument, secretInErrorResponse, secretInHTMLAttribute, secretInLLMPrompt, secretInURLParam, secretLoggedToConsole, secretsInCI, securityGroupAllInbound, sensitiveAsyncStorage, sensitiveLocalStorage, sensitiveURLParams, sessionFixation, sqlInjection, ssrfVulnerability, ssti, stripeWebhookUnprotected, supabaseAnonAdmin, supabaseFunctionName, supabaseNoRLS, syncFileOps, terraformStateExposed, timingAttack, todoLeftInCode, unencryptedPII, unpinnedGitHubAction, unprotectedAPIRoutes, unprotectedDownload, unsafeObjectAssign, unsanitizedFilenames, unsanitizedHTMLExport, unvalidatedAPIParams, unvalidatedEventData, unvalidatedRedirect, vectorStoreQueryNoUserFilter, vectorStoreUpsertNoMetadata, vendoredReason, visitBinary, visitCalls, vulnerableDependencies, weakHashing, weakPasswordRequirements, weakRSAKeySize, webhookMissingIdempotency, webhookSignatureVerification, xssVulnerability, xxeVulnerability };
1257
+ /**
1258
+ * Quality rules — a separate catalogue from the VC security rules.
1259
+ *
1260
+ * The VC rules answer "can someone attack this?". These answer a different
1261
+ * question: "is this app telling its owner and its users the truth?" A
1262
+ * checklist that saves over itself, a page that reports "no activity" when the
1263
+ * database was unreachable, a dashboard showing a credit that never moved —
1264
+ * none of those are security findings, and no SAST tool looks for them.
1265
+ *
1266
+ * They are deliberately NOT in `allCustomRules`. That catalogue's size is
1267
+ * quoted in pricing copy, the README, the Docker image and the freshness
1268
+ * ledger, and it means "security rules". Mixing these in would silently change
1269
+ * a number that eleven surfaces assert.
1270
+ *
1271
+ * WHY A SEPARATE ENGINE AND NOT A RULE. Six of these eight need to see more
1272
+ * than one file, or need the enclosing function rather than a character
1273
+ * window. `types.ts` fixes the rule contract as single-file on purpose, and
1274
+ * project-context.ts rules out growing it into a cross-file analyser. So this
1275
+ * is an engine over the whole file set, like scanEntropy and scanDependencies,
1276
+ * rather than an entry in a catalogue that cannot express it.
1277
+ *
1278
+ * EVERY RULE HERE EARNED ITS PLACE BY SURVIVING AN ATTACK. Each began as a
1279
+ * real defect found in this product, was then handed to an adversarial review
1280
+ * whose only job was to find legitimate code that would trip it, and ships
1281
+ * only with the narrowing that survived. Four candidates did not survive and
1282
+ * are not here. The precision bar is the product: a noisy rule trains people
1283
+ * to ignore the tool, which is worse than having no rule at all.
1284
+ */
1285
+ interface QualityRule {
1286
+ /** QA-namespaced, so it can never be mistaken for a security rule. */
1287
+ id: string;
1288
+ title: string;
1289
+ severity: Severity;
1290
+ category: string;
1291
+ /** What the defect costs the person running the app, in one sentence. */
1292
+ description: string;
1293
+ /** What to do about it. */
1294
+ fix: string;
1295
+ /**
1296
+ * The narrowing this rule shipped with, in prose.
1297
+ *
1298
+ * Recorded on the rule because every one of these was dangerous before it
1299
+ * was narrowed, and the next person to "simplify" the conditions needs to
1300
+ * know which legitimate pattern each clause was protecting.
1301
+ */
1302
+ precisionNotes: string;
1303
+ check(ctx: QualityContext): QualityHit[];
1304
+ }
1305
+ /** A hit, before it is decorated into a Finding. */
1306
+ interface QualityHit {
1307
+ file: string;
1308
+ line: number;
1309
+ /** Optional override when one rule reports distinguishable variants. */
1310
+ detail?: string;
1311
+ }
1312
+ /**
1313
+ * Everything a quality rule is allowed to look at.
1314
+ *
1315
+ * Handed the whole file set, because that is the point of this engine — but
1316
+ * with the per-file work (parsing, comment masking, classification) done once
1317
+ * and shared, so eight rules over a 10k-file repo do not parse it eight times.
1318
+ */
1319
+ interface QualityContext {
1320
+ files: QualityFile[];
1321
+ /** Lookup by exact path, for rules that follow an import. */
1322
+ byPath: Map<string, QualityFile>;
1323
+ }
1324
+ interface QualityFile {
1325
+ path: string;
1326
+ content: string;
1327
+ /** Comments blanked, byte offsets and line numbers preserved. */
1328
+ code: string;
1329
+ /** Null when the file is not JS/TS or failed to parse — rules must handle it. */
1330
+ parsed: ParsedFile | null;
1331
+ /** True for anything a rule should never report: tests, stories, fixtures, mocks, vendored code. */
1332
+ excluded: boolean;
1333
+ /** React client code: a "use client" directive or React state hooks. */
1334
+ isClient: boolean;
1335
+ /** Server code: a route handler, server action, middleware or edge function. */
1336
+ isServer: boolean;
1337
+ }
1338
+
1339
+ /**
1340
+ * The quality catalogue.
1341
+ *
1342
+ * Deliberately NOT merged into `allCustomRules`: that number is quoted in
1343
+ * pricing copy, the README, the Docker image and the freshness ledger, and it
1344
+ * means "security rules". These answer a different question and are counted
1345
+ * separately.
1346
+ */
1347
+ declare const qualityRules: QualityRule[];
1348
+ /**
1349
+ * Run the quality catalogue over a whole file set.
1350
+ *
1351
+ * Parallel to scanEntropy and scanDependencies: an engine, not a rule, because
1352
+ * most of these need more than the single file the rule contract allows.
1353
+ */
1354
+ declare function scanQuality(files: {
1355
+ path: string;
1356
+ content: string;
1357
+ }[], rules?: QualityRule[]): Finding[];
1358
+
1359
+ export { type AIFilterResult, type AppRoute, type BuilderFingerprint, CHECKABLE_CLAIMS, type Confidence, type CustomRule, 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, type ParsedFile, type ProjectContext, type QualityContext, 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, accountStateFromWebStorage, allCustomRules, allRules, androidDebuggable, assessHeaders, blockingMainThread, buildProjectContext, buildTaintMap, calculateGrade, callSpreads, callbackHell, checkIntent, classifyExposure, classifyStatement, clickjacking, clientComponentSecret, clientSideAuth, commandInjection, complianceMap, consoleLogProduction, corsLocalhost, corsServerless, corsWildcard, dangerousInnerHTML, deprecatedTLS, detectBuilder, detectExposedConfig, detectFramework, detectPlatform, disabledTLSVerification, djangoDebug, dockerCopySensitive, dockerLatestTag, dockerRunAsRoot, dockerTooManyPorts, dockerfileADDInsteadOfCOPY, dockerfileMissingHealthcheck, dockerfileUnverifiedShellPipe, ecbModeEncryption, electronNavigationUnrestricted, emptyCatchBlock, entitlementFromWebStorage, envNotGitignored, evalUsage, eventListenerLeak, exposedAdminRoutes, exposedAuthSecret, exposedDBCredentials, exposedDatabaseStudio, exposedDebugMode, exposedDockerPorts, exposedEnvFile, exposedGitDir, exposedServerActions, exposedSourceMaps, exposedStackTraces, extractRoutes, extractScriptUrls, filterFalsePositives, findSourceMapRefs, firebaseClientConfig, flaskSecretKey, freeRules, getObjectProperty, getSnippet, ghaExpressionInjection, ghaPermissionsWriteAll, ghaPullRequestTargetCheckout, ghaThirdPartyActionWithSecrets, githubActionsInjection, graphqlCSRFDisabled, graphqlIntrospection, graphqlNoComplexityLimit, graphqlNoDepthLimit, hardcodedAlgoliaAdminKey, hardcodedAnthropicKey, hardcodedCloudflareToken, hardcodedCohereKey, hardcodedCreditCard, hardcodedDatadogKey, hardcodedDiscordToken, hardcodedEncryptionKey, hardcodedFastlyToken, hardcodedFireworksKey, hardcodedFlyToken, hardcodedGCPServiceAccount, hardcodedGitHubPAT, hardcodedGitLabToken, hardcodedGroqKey, hardcodedHighlightKey, hardcodedIPAllowlist, hardcodedIntercomToken, hardcodedJWTSecret, hardcodedLinearKey, hardcodedLogtailToken, hardcodedLoopsKey, hardcodedMailgunKey, hardcodedMistralKey, hardcodedNetlifyToken, hardcodedNotionKey, hardcodedOAuthSecret, hardcodedPineconeKey, hardcodedPlivoToken, hardcodedPostmarkKey, hardcodedQdrantKey, hardcodedRailwayToken, hardcodedReplicateKey, hardcodedResendKey, hardcodedSSN, hardcodedSecrets, hardcodedSendGridKey, hardcodedSentryAuthToken, hardcodedShopifyToken, hardcodedSlackToken, hardcodedSupabaseServiceRole, hardcodedTogetherKey, hardcodedTwilioKey, hardcodedVaultToken, hardcodedVercelToken, hardcodedWeaviateKey, harvestIntent, hostHeaderRedirect, httpRequestSmuggling, insecureCookies, insecureDeepLink, insecureDeserialization, insecureDirectObjectReference, insecureElectronWindow, insecureFileUpload, insecureGRPC, insecureHTTPMethods, insecurePasswordReset, insecureRandomness, insecureWebSocket, ipcPathTraversal, isCalleeNamed, isMethodCall, isPrivateAddress, isVendoredFinding, isVendoredPath, javaDeserialization, jwtAlgConfusion, k8sNoResourceLimits, k8sPrivileged, k8sSecretNotEncrypted, lambdaWithoutVPC, largeBundleImport, llmCallNoMaxTokens, llmOutputAsHTML, llmOutputToSink, llmPromptInjection, llmSystemPromptInjection, logInjection, magicNumbers, maskComments, massAssignment, middlewareMatcherExcludesApi, missingAIRateLimit, missingAuthMiddleware, missingAuthRateLimit, missingBruteForce, missingCSP, missingCSRF, missingCertPinning, missingCloudTrail, missingContentDisposition, missingDBEncryption, missingErrorBoundary, missingFileSizeLimits, missingHSTS, missingHTTPS, missingLockFile, missingOAuthState, missingPagination, missingRequestSizeLimit, missingRequestValidation, missingSRI, missingSecurityMeta, nPlusOneQuery, nextPublicSecret, noRateLimiting, normalizeScanPath, nosqlInjection, openRedirectParams, overlyPermissiveIAM, parseFile, parseScanTarget, parseSupabaseConfig, pathTraversal, pickleDeserialization, piiInLogs, proOnlyRules, prototypePollution, pyDjangoAllowedHostsWildcard, pyDjangoMarkSafe, pyJWTDecodeWeakConfig, pyJinja2AutoescapeOff, pyParamikoAutoAdd, pyRequestsVerifyFalse, pyTempfileMktemp, qualityRules, raceCondition, rdsPubliclyAccessible, reflectedCORSOrigin, regexDos, routeForFile, runCustomRules, s3BucketNoEncryption, scanEntropy, scanQuality, secretInBundleConfig, secretInCLIArgument, secretInErrorResponse, secretInHTMLAttribute, secretInLLMPrompt, secretInURLParam, secretLoggedToConsole, secretsInCI, securityGroupAllInbound, sensitiveAsyncStorage, sensitiveLocalStorage, sensitiveURLParams, sessionFixation, sqlInjection, ssrfVulnerability, ssti, stripeWebhookUnprotected, supabaseAnonAdmin, supabaseFunctionName, supabaseNoRLS, syncFileOps, terraformStateExposed, timingAttack, todoLeftInCode, unencryptedPII, unpinnedGitHubAction, unprotectedAPIRoutes, unprotectedDownload, unsafeObjectAssign, unsanitizedFilenames, unsanitizedHTMLExport, unvalidatedAPIParams, unvalidatedEventData, unvalidatedRedirect, vectorStoreQueryNoUserFilter, vectorStoreUpsertNoMetadata, vendoredReason, visitBinary, visitCalls, vulnerableDependencies, weakHashing, weakPasswordRequirements, weakRSAKeySize, webhookMissingIdempotency, webhookSignatureVerification, xssVulnerability, xxeVulnerability };