Fix: Encode message param in email callback redirect#256
Open
taheerahmed wants to merge 1 commit intoe2b-dev:mainfrom
Open
Fix: Encode message param in email callback redirect#256taheerahmed wants to merge 1 commit intoe2b-dev:mainfrom
taheerahmed wants to merge 1 commit intoe2b-dev:mainfrom
Conversation
…tion The message query parameter was interpolated directly into the redirect URL without encoding. A crafted message value containing & or = could inject additional query parameters. This is inconsistent with encodedRedirect() used elsewhere in the same file. Closes e2b-dev#255
|
@taheerahmed is attempting to deploy a commit to the E2B Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
The
messagequery parameter in/api/auth/email-callbackwas interpolated into the redirect URL without encoding, enabling query parameter injection.Change
src/app/api/auth/email-callback/route.tsx— lines 17 and 27:This is consistent with
encodedRedirect()used elsewhere in the same file (line 21), which already encodes values properly.Example
Before:
/api/auth/email-callback?message=foo%26error%3Dinjected→ redirects to
/dashboard/account?message=foo&error=injected&type=update_emailAfter: same input
→ redirects to
/dashboard/account?message=foo%26error%3Dinjected&type=update_emailCloses #255