xploitscan-shared-rules 1.26.2 → 1.27.1

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
@@ -546,6 +546,34 @@ interface IntentExpectation {
546
546
  writesOnly?: boolean;
547
547
  }
548
548
  declare const INTENT_EXPECTATIONS: IntentExpectation[];
549
+ /**
550
+ * Does this sentence make ANY claim the six expectations can test?
551
+ *
552
+ * Needed because "no mismatch" has two completely different meanings and we
553
+ * were printing the same reassuring line for both:
554
+ *
555
+ * - the sentence made a checkable claim and no finding disputes it
556
+ * - the sentence made no checkable claim at all
557
+ *
558
+ * A user typed "Find cheese" and was told "nothing in this scan contradicts
559
+ * that". True, useless, and it makes the whole feature look broken. The
560
+ * honest answer is "I could not find a claim I know how to check, and here
561
+ * is what I can check."
562
+ */
563
+ declare function classifyStatement(text: string): {
564
+ checkable: boolean;
565
+ matched: string[];
566
+ };
567
+ /**
568
+ * What the checker understands, in the words a user would type. Exported so
569
+ * the CLI and the web show the SAME list — a user told "I can check X" by one
570
+ * surface and something else by another has been lied to by one of them.
571
+ */
572
+ declare const CHECKABLE_CLAIMS: Array<{
573
+ id: string;
574
+ label: string;
575
+ example: string;
576
+ }>;
549
577
  interface IntentMismatch {
550
578
  /** Stable id for the pairing, so the same mismatch dedupes across runs. */
551
579
  id: string;
@@ -568,6 +596,12 @@ interface IntentMismatch {
568
596
  interface IntentReport {
569
597
  statements: IntentStatement[];
570
598
  mismatches: IntentMismatch[];
599
+ /**
600
+ * Statements that made no claim any expectation understands. Distinguishing
601
+ * these from "checked and clean" is the difference between a useful answer
602
+ * and a reassuring non-answer.
603
+ */
604
+ uncheckable: IntentStatement[];
571
605
  /** Sources that were read, so a user can tell whether we found their spec. */
572
606
  sources: string[];
573
607
  /**
@@ -1203,4 +1237,4 @@ declare function getObjectProperty(node: ObjectExpression, key: string): {
1203
1237
  /** Does this CallExpression spread an expression `matcher` returns true for? */
1204
1238
  declare function callSpreads(call: CallExpression, matcher: (node: Node) => boolean): boolean;
1205
1239
 
1206
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -546,6 +546,34 @@ interface IntentExpectation {
546
546
  writesOnly?: boolean;
547
547
  }
548
548
  declare const INTENT_EXPECTATIONS: IntentExpectation[];
549
+ /**
550
+ * Does this sentence make ANY claim the six expectations can test?
551
+ *
552
+ * Needed because "no mismatch" has two completely different meanings and we
553
+ * were printing the same reassuring line for both:
554
+ *
555
+ * - the sentence made a checkable claim and no finding disputes it
556
+ * - the sentence made no checkable claim at all
557
+ *
558
+ * A user typed "Find cheese" and was told "nothing in this scan contradicts
559
+ * that". True, useless, and it makes the whole feature look broken. The
560
+ * honest answer is "I could not find a claim I know how to check, and here
561
+ * is what I can check."
562
+ */
563
+ declare function classifyStatement(text: string): {
564
+ checkable: boolean;
565
+ matched: string[];
566
+ };
567
+ /**
568
+ * What the checker understands, in the words a user would type. Exported so
569
+ * the CLI and the web show the SAME list — a user told "I can check X" by one
570
+ * surface and something else by another has been lied to by one of them.
571
+ */
572
+ declare const CHECKABLE_CLAIMS: Array<{
573
+ id: string;
574
+ label: string;
575
+ example: string;
576
+ }>;
549
577
  interface IntentMismatch {
550
578
  /** Stable id for the pairing, so the same mismatch dedupes across runs. */
551
579
  id: string;
@@ -568,6 +596,12 @@ interface IntentMismatch {
568
596
  interface IntentReport {
569
597
  statements: IntentStatement[];
570
598
  mismatches: IntentMismatch[];
599
+ /**
600
+ * Statements that made no claim any expectation understands. Distinguishing
601
+ * these from "checked and clean" is the difference between a useful answer
602
+ * and a reassuring non-answer.
603
+ */
604
+ uncheckable: IntentStatement[];
571
605
  /** Sources that were read, so a user can tell whether we found their spec. */
572
606
  sources: string[];
573
607
  /**
@@ -1203,4 +1237,4 @@ declare function getObjectProperty(node: ObjectExpression, key: string): {
1203
1237
  /** Does this CallExpression spread an expression `matcher` returns true for? */
1204
1238
  declare function callSpreads(call: CallExpression, matcher: (node: Node) => boolean): boolean;
1205
1239
 
1206
- export { type AIFilterResult, type AppRoute, type BuilderFingerprint, 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, 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 };
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 };
package/dist/index.js CHANGED
@@ -592,6 +592,15 @@ function harvestIntent(files) {
592
592
  }
593
593
  continue;
594
594
  }
595
+ if (match.origin === "declared") {
596
+ for (const line of file.content.split("\n")) {
597
+ const text = clean(line).trim();
598
+ if (text && !text.startsWith("#")) {
599
+ out.push({ text, source: file.path, line: 1, origin: match.origin });
600
+ }
601
+ }
602
+ continue;
603
+ }
595
604
  let inFence = false;
596
605
  const lines = file.content.split("\n");
597
606
  for (let i = 0; i < lines.length; i++) {
@@ -749,12 +758,26 @@ function pathTokens(p) {
749
758
  (p.toLowerCase().match(/[a-z][a-z-]{2,}/g) ?? []).filter((t) => !STOPWORDS.has(t))
750
759
  );
751
760
  }
761
+ function classifyStatement(text) {
762
+ if (describesAbsence(text)) return { checkable: false, matched: [] };
763
+ const matched = INTENT_EXPECTATIONS.filter((e) => e.claims.test(text)).map((e) => e.id);
764
+ return { checkable: matched.length > 0, matched };
765
+ }
766
+ var CHECKABLE_CLAIMS = [
767
+ { id: "owner-scoped", label: "who can see whose data", example: "Customers can only see their own orders." },
768
+ { id: "requires-auth", label: "what needs a login", example: "Every API route requires the user to be logged in." },
769
+ { id: "admin-only", label: "what is admin-only", example: "Only admins can delete a workspace." },
770
+ { id: "private-data", label: "what is private", example: "Uploaded files are never public." },
771
+ { id: "verified-webhooks", label: "which webhooks are verified", example: "Stripe webhooks are signature verified." },
772
+ { id: "rate-limited", label: "what is rate limited", example: "The public API is rate limited." }
773
+ ];
752
774
  function checkIntent(files, findings) {
753
775
  const statements = harvestIntent(files);
754
776
  const sources = [...new Set(statements.map((s) => s.source))];
755
777
  const routes = extractRoutes(files).routes;
756
778
  const mismatches = [];
757
779
  const unchallenged = [];
780
+ const uncheckable = [];
758
781
  const byRule = /* @__PURE__ */ new Map();
759
782
  for (const f of findings) {
760
783
  const list = byRule.get(f.rule);
@@ -766,6 +789,10 @@ function checkIntent(files, findings) {
766
789
  const global = isGlobalClaim(statement.text);
767
790
  const subject = topics(statement.text);
768
791
  if (describesAbsence(statement.text)) continue;
792
+ if (!classifyStatement(statement.text).checkable) {
793
+ uncheckable.push(statement);
794
+ continue;
795
+ }
769
796
  for (const exp of INTENT_EXPECTATIONS) {
770
797
  if (!exp.claims.test(statement.text)) continue;
771
798
  const candidates = exp.contradictedBy.flatMap((r) => byRule.get(r) ?? []);
@@ -810,7 +837,7 @@ function checkIntent(files, findings) {
810
837
  });
811
838
  }
812
839
  }
813
- return { statements, mismatches, sources, unchallenged };
840
+ return { statements, mismatches, sources, unchallenged, uncheckable };
814
841
  }
815
842
 
816
843
  // src/silencing.ts
@@ -1776,6 +1803,7 @@ var missingAuthMiddleware = {
1776
1803
  description: "API routes without authentication checks allow unauthorized access.",
1777
1804
  check(content, filePath, project) {
1778
1805
  if (!isServerSideFile(filePath, content)) return [];
1806
+ if (PUBLIC_BY_CONVENTION_ROUTE.test(routeSegmentName(filePath))) return [];
1779
1807
  const routePatterns = [
1780
1808
  // Express/Hono style
1781
1809
  /\.(get|post|put|patch|delete)\s*\(\s*["'`][^"'`]+["'`]\s*,\s*(?:async\s+)?\(?(?:req|c|ctx)/gi,
@@ -1841,7 +1869,22 @@ var missingAuthMiddleware = {
1841
1869
  /\bjwt\.verify\b/i,
1842
1870
  /\bbearer\s/i,
1843
1871
  /\b(?:protect|guard)\(/i,
1844
- /\.use\([^)]*(?:auth|session|protect|requireAuth)/i
1872
+ /\.use\([^)]*(?:auth|session|protect|requireAuth)/i,
1873
+ // A handler that can answer HTTP 401 is, by definition, deciding whether
1874
+ // the caller is allowed in. This catches the whole family of
1875
+ // capability-token flows the named patterns above miss — magic links,
1876
+ // share links, unsubscribe links, invite/claim URLs — where there is no
1877
+ // session and no account, and the unguessable token in the request IS
1878
+ // the credential, checked by a bespoke lookup like
1879
+ // `findShareByToken(slug, token)`.
1880
+ //
1881
+ // 401 only, deliberately not 403. 401 means "I could not authenticate
1882
+ // you"; 403 is routinely returned by things that never identified the
1883
+ // caller at all — an Origin allowlist on an anonymous analytics beacon,
1884
+ // a feature flag, a geo block. Accepting 403 would suppress genuinely
1885
+ // unauthenticated routes.
1886
+ /\bstatus(?:Code)?\s*[:(]\s*401\b/,
1887
+ /\bsendStatus\s*\(\s*401\b/
1845
1888
  ];
1846
1889
  const APP_LEVEL_AUTH = [
1847
1890
  /\.use\([^)]*(?:auth|session|protect|requireAuth)/i,
@@ -1901,6 +1944,15 @@ var missingAuthMiddleware = {
1901
1944
  return filterSilenced(unauthenticated, content, "VC003");
1902
1945
  }
1903
1946
  };
1947
+ var PUBLIC_BY_CONVENTION_ROUTE = /^(?:og|opengraph-image|twitter-image|icon|apple-icon|favicon|sitemap|robots|manifest|badge)(?:[.-]\w+)?$/i;
1948
+ function routeSegmentName(filePath) {
1949
+ const segments = filePath.split("/");
1950
+ const base = segments[segments.length - 1] ?? "";
1951
+ if (/^route\.(?:ts|tsx|js|jsx|mjs|cjs)$/i.test(base)) {
1952
+ return segments[segments.length - 2] ?? "";
1953
+ }
1954
+ return base.replace(/\.[^.]+$/, "");
1955
+ }
1904
1956
  var supabaseNoRLS = {
1905
1957
  id: "VC004",
1906
1958
  title: "Supabase Client Without Row Level Security",
@@ -2434,10 +2486,10 @@ var insecureCookies = {
2434
2486
  check(content, filePath) {
2435
2487
  if (isTestFile(filePath)) return [];
2436
2488
  if (!/cookie/i.test(content)) return [];
2437
- const setCookiePattern = /(?:set-cookie|setCookie|cookie\s*=|res\.cookie\s*\()/gi;
2489
+ const setCookiePattern = /(?:set-cookie|setCookie|\bcookie\s*=|res\.cookie\s*\()/gi;
2438
2490
  if (!setCookiePattern.test(content)) return [];
2439
2491
  const hasHttpOnly = /httpOnly\s*:\s*true|httponly/i.test(content);
2440
- const hasSecure = /secure\s*:\s*true|;\s*secure/i.test(content);
2492
+ const hasSecure = /secure\s*:\s*(?!false\b)\S/i.test(content) || /;\s*secure/i.test(content);
2441
2493
  const hasSameSite = /sameSite\s*:|samesite/i.test(content);
2442
2494
  const matches = [];
2443
2495
  if (!hasHttpOnly || !hasSecure || !hasSameSite) {
@@ -9953,6 +10005,7 @@ function extractScriptUrls(html, pageUrl, limit = 12) {
9953
10005
  return [...new Set(out)];
9954
10006
  }
9955
10007
  export {
10008
+ CHECKABLE_CLAIMS,
9956
10009
  FREE_RULE_COUNT,
9957
10010
  INTENT_EXPECTATIONS,
9958
10011
  MODEL_ANALYSIS,
@@ -9977,6 +10030,7 @@ export {
9977
10030
  callbackHell,
9978
10031
  checkIntent,
9979
10032
  classifyExposure,
10033
+ classifyStatement,
9980
10034
  clickjacking,
9981
10035
  clientComponentSecret,
9982
10036
  clientSideAuth,