Menu

Your password reset link is a bearer credential: designing signed, single-use tokens that fail closed
📰

Your password reset link is a bearer credential: designing signed, single-use tokens that fail closed

DEV Community: python·MapToSite·1 day ago
#lwhVxyTt
#devtopython#devto#dev#token#time
Reading 0:00
15s threshold

A password-reset link went out on a Tuesday. The user clicked it, changed the password, and forgot about it. Eleven days later the same link still worked, because the service had put the user id and an issued-at timestamp in the URL and signed nothing at all — the "token" was ?uid=8412&t=1731000000 , and the only check was that the timestamp was not in the future. Anyone who had seen that URL — in a shared screen, in a screenshot pasted into a support thread, in the browser history of a borrowed laptop — could reset that account as long as they got there first.

The failure is not exotic. It comes from treating a URL as a page address when the URL is actually a bearer credential : whoever holds it is the holder, and the server has no way to ask "but is it you?"

That distinction is the whole design.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.