Invites never expire (no TTL on pending tokens) #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low — hardening.
Problem
Pending invite tokens are valid indefinitely (src/Auth/InviteRepository.php); there is no expiry. Token entropy is fine (
wp_generate_password(32)), so this is about limiting the window of a leaked/forwarded link.Fix
Add a TTL (e.g. 7–14 days): store/compare against
created_atwhen resolving a token infindByToken/registration, and treat expired pending invites as invalid. Surface expiry state on the admin invites page.Verified resolved on main (
061d09e, PR #38): Invite::EXPIRY_DAYS = 14 — isAcceptable() (pending + not expired) is enforced both when rendering the registration form and again on submit, and the admin Invites page badges expired invites. Further hardened by #41 / PR #43, which stores only the SHA-256 hash of the token at rest. Re-confirmed during the 2026-06-10 security review pass.