fix(manager): passwordless login links not invalidated by link scanners - #88
Open
Ibochkarev wants to merge 2 commits into
Open
Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Email links open a confirmation page (?magiclink_pending=) instead of consuming the one-time token. Login happens only after the user POSTs the confirm button, so Office365 Safe Links and similar scanners no longer burn the link before the real click. Also rewrite non-EN email templates to the pending URL, keep legacy ?magiclink= on the confirm path, and add controller regression tests. Fixes modxcms#16743
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
Office365 Safe Links (и другие mail-сканеры) ходят на URL passwordless-логина раньше вас. Это раньше сжигало одноразовый токен, поэтому ваш реальный клик получал «Your login link is not valid.»
Ссылка в почте теперь ведёт на
?magiclink_pending=hash. Вы попадаете на страницу подтверждения и кликаете Log me in. Только этот POST потребляет токен. Обычный GET сmagiclink_pendingили старымmagiclinkоставляет registry нетронутым.Pending URL приходит из PHP (
[[+magic_login_url]]). Если переведённый email-шаблон всё ещё хардкодит?magiclink=, мы переписываем его при отправке. Старые?magiclink=ссылки работают; просто показывают тот же шаг подтверждения. Добавлены EN-строки для confirm-страницы и пара контроллер-тестов.Зачем нужно
Люди на Office365 (и подобных) не могли использовать passwordless-логин: сканер тратил ссылку первым. Просьба второго клика матчит то, что делают другие auth-стеки для этого класса багов.
Как проверить
passwordless_activated.curlна pending URL, затем откройте в браузере и подтвердите. Логин должен работать.?magiclink=hashURL. Страница подтверждения, затем логин после кнопки.Связанные
Refs modxcms#16743
Оригинал: modxcms#16833