From 5bffc66fc6781c7f6c5a37b957b3445e5bbd76ba Mon Sep 17 00:00:00 2001 From: ht Date: Sun, 6 Sep 2026 17:49:09 +0300 Subject: [PATCH] validate Stripe cancellation timestamp --- server/billing.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/billing.mjs b/server/billing.mjs index 2e4d07a..6153098 100644 --- a/server/billing.mjs +++ b/server/billing.mjs @@ -230,6 +230,8 @@ export async function cancelSubscription({ subId, neden, aciklama }) { if (!res.ok) throw new Error(data?.error?.message || `Stripe hatası: HTTP ${res.status}`); if (typeof data.id !== 'string' || !data.id.trim() || typeof data.status !== 'string' || !data.status.trim()) throw new Error('Stripe abonelik iptal yanıtı geçersiz.'); + if (data.cancel_at != null && (!Number.isSafeInteger(data.cancel_at) || data.cancel_at <= 0)) + throw new Error('Stripe iptal tarihi geçersiz.'); return { id: data.id, status: data.status,