Repository navigation
🛡️ Sentinel: [HIGH] Fix tab URL validation relative path bypass - #1724
RyutaKojima wants to merge 1 commit into
Conversation
Co-authored-by: RyutaKojima <12064805+RyutaKojima@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
概要
isSafeTabUrl関数において、プロトコル相対URL(//evil.com)やパス相対URL(/evil.com、\evil.com)が入力された際に、new URL(url, 'chrome-extension://dummy/')のベースURL解決によってchrome-extension:プロトコルとして判定を通り抜けてしまうセキュリティ上の懸念を修正しました。変更内容
src/js/app/background/chrome-wrapper/chromeTabs.tsのisSafeTabUrl関数にて、入力URLをトリム処理した上で、//、/、\で始まる相対URLを明示的に判定して除外(falseを返却)するように改修しました。src/js/app/background/chrome-wrapper/chromeTabs.test.tsにプロトコル相対URLおよびパス相対URLのテストケースを追加しました。検証内容・テスト結果
yarn testyarn lint:allレビュアーへの確認事項・補足
PR created automatically by Jules for task 7258471893806998287 started by @RyutaKojima