You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect expiration date validation for _perishable_token_expires_at #9935
In src/Routers/UsersRouter.js around lines 454 to 471, the token lookup query
uses the wrong expiry comparator and is missing the same options as the email
path; change the _perishable_token_expires_at check to $gt Parse._encode(new
Date()) so only unexpired tokens match, and call req.config.database.find with
the same options as the email branch: pass { limit: 1 } and
Auth.maintenance(req.config) as the query options so the lookup is limited to
one result and runs under maintenance context.
ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
There is a test that seems cover this 'can resend email using an expired reset password token' in ValidationAndPasswordsReset.spec.js. I don't know if this one should be removed or no ?
After investigating, this looks like a false positive — the $lt comparator is intentional, not inverted.
The token branch of handleResetRequest (POST /requestPasswordReset) is the "resend a password-reset email after your link has expired" flow, so it deliberately matches only expired tokens:
PagesRouter.js (link-expired handling) → when a reset link expires, the page deliberately preserves the expired token in the query params so the user can resend a fresh link from the expired-link page.
spec/ValidationAndPasswordsReset.spec.js → 'can resend email using an expired reset password token' → forces the token expired (year 2000), POSTs it to /requestPasswordReset, and asserts a new token is issued (expect(obj._perishable_token).not.toBe(token)).
Flipping to $gt would break that feature and that test. The bundled sub-suggestions aren't bugs either: { limit: 1 } is cosmetic (perishable tokens are per-user unique), and Auth.maintenance isn't required here (the query works today, as the passing test shows).
To stop this being re-flagged, I've opened #10533 which adds an inline comment documenting the intent. Recommend closing this as not a bug.
Activity
parse-github-assistant commentedon Nov 17, 2025
🚀 Thanks for opening this issue!
ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
coratgerl commentedon Nov 18, 2025
There is a test that seems cover this
'can resend email using an expired reset password token'in ValidationAndPasswordsReset.spec.js. I don't know if this one should be removed or no ?mtrezza commentedon Nov 18, 2025
I haven't validated the issue yet. It may be a false positive. There should be tests for the token expiration we should look for.
dblythy commentedon Jul 4, 2026
After investigating, this looks like a false positive — the
$ltcomparator is intentional, not inverted.The token branch of
handleResetRequest(POST /requestPasswordReset) is the "resend a password-reset email after your link has expired" flow, so it deliberately matches only expired tokens:git blameonUsersRouter.js(the$ltline) → added intentionally in fix: Remove username from email verification and password reset process #8488.PagesRouter.js(link-expired handling) → when a reset link expires, the page deliberately preserves the expiredtokenin the query params so the user can resend a fresh link from the expired-link page.spec/ValidationAndPasswordsReset.spec.js→'can resend email using an expired reset password token'→ forces the token expired (year 2000), POSTs it to/requestPasswordReset, and asserts a new token is issued (expect(obj._perishable_token).not.toBe(token)).Flipping to
$gtwould break that feature and that test. The bundled sub-suggestions aren't bugs either:{ limit: 1 }is cosmetic (perishable tokens are per-user unique), andAuth.maintenanceisn't required here (the query works today, as the passing test shows).To stop this being re-flagged, I've opened #10533 which adds an inline comment documenting the intent. Recommend closing this as not a bug.