diff --git a/scripts/lib/security-checklist.mjs b/scripts/lib/security-checklist.mjs index ca5616b05..18fc272b5 100644 --- a/scripts/lib/security-checklist.mjs +++ b/scripts/lib/security-checklist.mjs @@ -68,7 +68,7 @@ export function evaluateSecurityEvidence(value) { } if (Number.isNaN(updatedAtMs)) { failures.push("updated_at must be an ISO date or timestamp"); - } else if (updatedAtMs - Date.now() > 24 * 60 * 60 * 1000) { + } else if (updatedAtMs > Date.now()) { failures.push("updated_at cannot be in the future"); } diff --git a/test/security-checklist.test.ts b/test/security-checklist.test.ts index 2b0293116..61bcc8b1c 100644 --- a/test/security-checklist.test.ts +++ b/test/security-checklist.test.ts @@ -67,6 +67,14 @@ describe("security validation checklist parser", () => { expect(result.failures).toEqual([]); }); + it("rejects security evidence dated even slightly in the future", () => { + const futureTimestamp = new Date(Date.now() + 60 * 60 * 1000).toISOString(); + const result = evaluateSecurityEvidence(reviewedSecurityEvidence(futureTimestamp)); + + expect(result.passed).toBe(false); + expect(result.failures).toContain("updated_at cannot be in the future"); + }); + it.each([ "07/02/2026", "2026-07-02 10:30:15",