فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(A06): reject invalid offline activation clock inputs
davoodmehraban89 committed
Oct 19, 2026 at 10:46 UTC
b2efdd5c41376eb4b857241814fd3ec9ef53cea5
1 file changed
+3
-1
src/core/LicenseActivationCore.mjs
+3
-1
@@ -21,7 +21,9 @@ export function loadProductionLicensePublicKey(rawValue) {
21
* supplied by the application build configuration.
22
*/
23
export async function validateOfflineActivation(token, publicJwk, installationId, nowMs = Date.now()) {
24
- if (!publicJwk || !token || typeof token !== 'object' ||
24
+ // Invalid or untrusted clock values must never extend an offline lease.
25
+ if (!Number.isSafeInteger(nowMs) || nowMs < 0 ||
26
+ !publicJwk || !token || typeof token !== 'object' ||
27
!validateEntitlementPayload(token.payload, installationId, nowMs)) return false;
28
const lease = token.payload.lastOnlineCheckAt;
29
if (typeof lease !== 'string' || !lease.trim()) return false;