Skip to content

🛡️ Sentinel: [HIGH] Fix tab URL validation relative path bypass - #1724

Open
RyutaKojima wants to merge 1 commit into
masterfrom
fix/is-safe-tab-url-relative-bypass-7258471893806998287
Open

RyutaKojima wants to merge 1 commit into
masterfrom
fix/is-safe-tab-url-relative-bypass-7258471893806998287

Conversation

@RyutaKojima

Copy link
Copy Markdown
Owner

概要

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 test
  • 結果: PASS (16 test suites, 73 tests passed)
  • 実行コマンド: yarn lint:all
  • 結果: PASS (type-check, eslint, stylelint すべて通過)

レビュアーへの確認事項・補足

  • 特になし

PR created automatically by Jules for task 7258471893806998287 started by @RyutaKojima

Co-authored-by: RyutaKojima <12064805+RyutaKojima@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant