Repository navigation
fix(e2e): fake EHR redirects only to the registered redirect URI - #74
Merged
Merged
Conversation
The SMART launch spec's fake authorization server answered /authorize with a 302 to whatever redirect_uri the request carried (CodeQL js/server-side-unvalidated-url-redirection, alert #2). It now checks client_id and redirect_uri against the registered values like a real authorization server, answers 400 invalid_request on a mismatch, and builds Location from the registered URI with code and state encoded through searchParams.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Fixes code-scanning alert #2 (Server-side URL redirect,
frontend/e2e/smart-launch.spec.js:49).The fake EHR in the SMART launch E2E spec answered
/authorizewith a 302 to the request's ownredirect_uri, an open redirect driven by the request. It now behaves like a real authorization server:client_idandredirect_urimust equal the registeredCLIENT_IDandREDIRECT; otherwise 400{error: 'invalid_request'}.Locationis built fromnew URL(REDIRECT)withcodeandstateset throughsearchParams, sostateis encoded too.No other fake server in
frontend/e2e/orbackend/tests/redirects to a request value.Test-only change; the test's behaviour is otherwise unchanged.
Checks
npx eslint .: cleannpx playwright test e2e/smart-launch.spec.js(local, Chrome): 2 passed