-
Notifications
You must be signed in to change notification settings - Fork 86
feat(config): new config redirectAllowList #1050
Conversation
Size Change: 0 B Total Size: 689 kB ℹ️ View Unchanged
|
67b1214
to
a370be2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feedback I left on #1051 applies here as well
__tests__/server/plugins/reactHtml/createRequestHtmlFragment.spec.jsx
Outdated
Show resolved
Hide resolved
if (!isRedirectUrlAllowed(redirect.url)) { | ||
renderStaticErrorPage(request, reply); | ||
throw new Error(`'${redirect.url}' is not an allowed redirect URL`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if an error is thrown it should always result in renderStaticErrorPage
if not the case thats probably how it should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing an error does not render the error page for us, verified this locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after looking into this further, this is the expected pattern.
module, | ||
moduleName, | ||
}) { | ||
export function setRootModuleConfigurations(module, moduleName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change should not be necessary with https://github.com/americanexpress/one-app/pull/984/files#diff-c2c760b479b24ea34c7eae704bba77b771c6ce7b48f7b4e6c8b386140de2ca9b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is a draft PR thats expected to go in after this PR
Description
This adds a new
appConfig
option to configure an allow list for redirects.Motivation and Context
We dont want to redirect anyone to malicious URLs in the case of user-inputed redirects.
How Has This Been Tested?
Unit and locally
Types of Changes
Checklist:
What is the Impact to Developers Using One App?
Allows further security enhancements through a customizable allow list.