xploitscan-shared-rules 2.4.1 → 2.4.2

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.js CHANGED
@@ -2676,7 +2676,7 @@ var stripeWebhookUnprotected = {
2676
2676
  if (!/stripe/i.test(code) && !pathSaysStripeWebhook) return [];
2677
2677
  const hasStripeWebhookHandler = pathSaysStripeWebhook || /(?:stripe.{0,200}webhook|webhook.{0,200}stripe)/i.test(code) || /(?:checkout\.session\.completed|invoice\.paid|payment_intent|customer\.subscription)/i.test(code);
2678
2678
  if (!hasStripeWebhookHandler) return [];
2679
- if (/constructEvent|verifyHeader|stripe[_-]?signature|webhook[_-]?secret|STRIPE_WEBHOOK_SECRET/i.test(code) || /\b\w*verif\w*\s*\(/i.test(code) && /\bverif\w*(?:stripe|webhook|signature|sig)\w*\s*\(/i.test(code)) return [];
2679
+ if (/constructEvent|verifyHeader|stripe[_-]?signature|webhook[_-]?secret|STRIPE_WEBHOOK_SECRET/i.test(code) || /\b\w{0,40}verif\w{0,40}\s*\(/i.test(code) && /\bverif\w{0,40}(?:stripe|webhook|signature|sig)\w{0,40}\s*\(/i.test(code)) return [];
2680
2680
  const handlerPatterns = [
2681
2681
  // POST handler that processes Stripe events
2682
2682
  /export\s+(?:async\s+)?function\s+POST\s*\(/g,
@@ -2684,7 +2684,10 @@ var stripeWebhookUnprotected = {
2684
2684
  // export const POST = async (req) => { … }
2685
2685
  // Added alongside the same shape in VC003 (#648); without it an App
2686
2686
  // Router webhook written in the arrow style was invisible.
2687
- /export\s+const\s+POST\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/g,
2687
+ // Bound the optional TypeScript type annotation: `(?::[^=]+)?` walks an
2688
+ // entire 500KB line of non-`=` characters on every near-miss. Real
2689
+ // annotations (`: NextRequest`, `: RouteHandler`) sit well under 200.
2690
+ /export\s+const\s+POST\s*(?::[^=\n]{0,200})?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/g,
2688
2691
  // Express-style Stripe webhook route
2689
2692
  /\.(post|all)\s*\(\s*["'`][^"'`]*(?:stripe|webhook)[^"'`]*["'`]/gi,
2690
2693
  // Event type checking without prior verification