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.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2830,7 +2830,7 @@ var stripeWebhookUnprotected = {
|
|
|
2830
2830
|
if (!/stripe/i.test(code) && !pathSaysStripeWebhook) return [];
|
|
2831
2831
|
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);
|
|
2832
2832
|
if (!hasStripeWebhookHandler) return [];
|
|
2833
|
-
if (/constructEvent|verifyHeader|stripe[_-]?signature|webhook[_-]?secret|STRIPE_WEBHOOK_SECRET/i.test(code) || /\b\w
|
|
2833
|
+
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 [];
|
|
2834
2834
|
const handlerPatterns = [
|
|
2835
2835
|
// POST handler that processes Stripe events
|
|
2836
2836
|
/export\s+(?:async\s+)?function\s+POST\s*\(/g,
|
|
@@ -2838,7 +2838,10 @@ var stripeWebhookUnprotected = {
|
|
|
2838
2838
|
// export const POST = async (req) => { … }
|
|
2839
2839
|
// Added alongside the same shape in VC003 (#648); without it an App
|
|
2840
2840
|
// Router webhook written in the arrow style was invisible.
|
|
2841
|
-
|
|
2841
|
+
// Bound the optional TypeScript type annotation: `(?::[^=]+)?` walks an
|
|
2842
|
+
// entire 500KB line of non-`=` characters on every near-miss. Real
|
|
2843
|
+
// annotations (`: NextRequest`, `: RouteHandler`) sit well under 200.
|
|
2844
|
+
/export\s+const\s+POST\s*(?::[^=\n]{0,200})?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>/g,
|
|
2842
2845
|
// Express-style Stripe webhook route
|
|
2843
2846
|
/\.(post|all)\s*\(\s*["'`][^"'`]*(?:stripe|webhook)[^"'`]*["'`]/gi,
|
|
2844
2847
|
// Event type checking without prior verification
|