fix(client): validate urls to improve security
This commit is contained in:
parent
572000f868
commit
788ae2f6ca
4 changed files with 4 additions and 0 deletions
|
@ -70,6 +70,7 @@ async function accept(): Promise<void> {
|
|||
state = 'accepted';
|
||||
if (props.callback) {
|
||||
const cbUrl = new URL(props.callback);
|
||||
if (!['http:', 'https:'].includes(cbUrl.protocol)) throw new Error('invalid url');
|
||||
cbUrl.searchParams.set('session', props.session);
|
||||
location.href = cbUrl.href;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue