recoverEmail handler passes action code into the wrong parameter
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- authentication
Research direction
Read email-handler.html, starting at the recoverEmail switch branch and the handleRecoverEmail entry point. Trace the arguments through checkActionCode and applyActionCode, then verify a valid email-recovery URL completes the revert-email flow without an undefined action code.
Written by the indexing model from the issue text.
Description
Looks like the recoverEmail path in email-handler.html is passing the action code into the wrong parameter.
handleRecoverEmail is defined as:
function handleRecoverEmail(auth, actionCode, lang) {
But the switch calls it like this:
handleRecoverEmail(actionCode);
Inside the handler, checkActionCode(Auth, actionCode) and applyActionCode(Auth, actionCode) use the second parameter, so actionCode ends up being undefined for recover email links.
How to reproduce:
- Open an email recovery link that uses
/email-handler?mode=recoverEmail&oobCode=<valid code>. - The handler enters the
recoverEmailbranch. handleRecoverEmailreceives only one argument.- Firebase receives
undefinedas the action code, so the email recovery flow fails instead of reverting the email.
Impact is limited, but this does affect account recovery. If a user's email was changed accidentally or maliciously, the recovery link may not work through Monkeytype's handler. I do not think this is account takeover by itself.
A fix would be to either call handleRecoverEmail(Auth, actionCode, lang) or simplify the function signature so the action code is the first argument.
- Dominant language
- TypeScript
- Stars
- 20.7k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from monkeytypegame/monkeytype
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
monkeytypegame/monkeytype#8366 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
monkeytypegame/monkeytype#8365 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
monkeytypegame/monkeytype#8364 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
monkeytypegame/monkeytype#8363 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
monkeytypegame/monkeytype#8362 · 1 comment ·
All issues in monkeytypegame/monkeytype
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·