From 4c9354362a0e1acc3b0c014d62a1c902bdb824e0 Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 17:51:05 +0300 Subject: [PATCH] validate Stripe period end timestamps --- server/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/index.js b/server/index.js index b4659e2..8500ac6 100644 --- a/server/index.js +++ b/server/index.js @@ -1334,6 +1334,8 @@ const server = http.createServer(async (req, res) => { const aktif = ['active', 'trialing'].includes(o.status); const k = store.findByStripe({ customerId: o.customer, subId: o.id }); if (k) { + if (o.current_period_end != null && (!Number.isSafeInteger(o.current_period_end) || o.current_period_end <= 0)) + throw new Error('Stripe dönem sonu tarihi geçersiz.'); store.setPlan(k.email, { plan: aktif ? planId : 'ucretsiz', kaynak: 'stripe', bitis: o.current_period_end ? new Date(o.current_period_end * 1000).toISOString() : null,