diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-11-09 10:52:07 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-09 10:52:07 +0900 |
| commit | 5b60ae810b975d4b86a47a00b65b0736e39fe949 (patch) | |
| tree | dcbf27b83bc9b82d2c506a5cbd75b1221efa4845 /packages | |
| parent | fix(backend): SQLのサニタイズを強化 (#14920) (diff) | |
| download | sharkey-5b60ae810b975d4b86a47a00b65b0736e39fe949.tar.gz sharkey-5b60ae810b975d4b86a47a00b65b0736e39fe949.tar.bz2 sharkey-5b60ae810b975d4b86a47a00b65b0736e39fe949.zip | |
fix(frontend): 外部URLへのリダイレクトのバリデーションを強化 (#14919)
* Fix code scanning alert no. 25: Incomplete URL scheme check (MisskeyIO#799)
* Fix code scanning alert no. 26: Incomplete URL scheme check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Fix code scanning alert no. 25: Incomplete URL scheme check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
(cherry picked from commit 7d7552e076c0152a5966e919be0e9a60b3736208)
* :v:
---------
Co-authored-by: あわわわとーにゅ <17376330+u1-liquid@users.noreply.github.com>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/frontend/src/pages/auth.vue | 2 | ||||
| -rw-r--r-- | packages/frontend/src/pages/miauth.vue | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/packages/frontend/src/pages/auth.vue b/packages/frontend/src/pages/auth.vue index d8f8d0b428..4170b4f73e 100644 --- a/packages/frontend/src/pages/auth.vue +++ b/packages/frontend/src/pages/auth.vue @@ -62,7 +62,7 @@ function accepted() { state.value = 'accepted'; if (session.value && session.value.app.callbackUrl) { const url = new URL(session.value.app.callbackUrl); - if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(url.protocol)) throw new Error('invalid url'); + if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(url.protocol)) throw new Error('invalid url'); location.href = `${session.value.app.callbackUrl}?token=${session.value.token}`; } } diff --git a/packages/frontend/src/pages/miauth.vue b/packages/frontend/src/pages/miauth.vue index e89dd5c4a5..e85d2c29c1 100644 --- a/packages/frontend/src/pages/miauth.vue +++ b/packages/frontend/src/pages/miauth.vue @@ -65,7 +65,7 @@ async function onAccept(token: string) { if (props.callback && props.callback !== '') { const cbUrl = new URL(props.callback); - if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(cbUrl.protocol)) throw new Error('invalid url'); + if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(cbUrl.protocol)) throw new Error('invalid url'); cbUrl.searchParams.set('session', props.session); location.href = cbUrl.toString(); } else { |