Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CTFで出題されたXS-Leaks

ntomoya
June 29, 2024
760

 CTFで出題されたXS-Leaks

ntomoya

June 29, 2024
Tweet

Transcript

  1. Same Origin Policy (SOP) ブラウザにおける基本的なセキュリティ機構: http://user:[email protected]:3000/hoge/fuga?abc=def#test あるOriginによって読み込まれたdocumentやスクリプトが、異なるOriginのリソースにアクセスす ることを制限するもの プロトコル 同一Originの例

    (Same-Origin): 異なるOriginの例 (Cross-Origin): ホスト ポート番号 の3つの組で決定される http://example.com:3000/test.html http://example.com:3000/hoge/fuga/abc https://example.com/abc http://flag.example.com:3000/abc http://example.com:8080/abc
  2. Content Security Policy (CSP) ロードされるページに対して読み込み可能なリソースを制限する仕組み (HTTP Headerやmetaタグで指定) Content-Security-Policy: default-src ‘none’;

    scriptやstyle、fetch APIなどの あらゆるソースの読み込みを 無効化 Content-Security-Policy: script-src: ‘nonce-2726c7f26c’; 一致するnonceを指定したscript タグのみ許可 Content-Security-Policy: sandbox allow-scripts; iframe内のscript実行を許可、 ダウンロードやtopの別URLへの 移動を許可しない
  3. その他のXS-Leaks フレームカウント - Facebook CTF 2019: Secret Note Keeper エラーページ

    - DragonCTF 2020: Scratchpad CSS - pbctf 2021: Vault - Dice CTF 2024: another-csp - SECCON 2023 Finals: DOMLeakify タイミング計測 - justCTF 2020: Computeration Fixed コネクション - Sekai CTF 2022: safelist Lazy loading - Lake CTF 2023: GeoGuessy リダイレクト - HackTM CTF Quals 2023: secrets CSP - pbctf 2020: XSP - SECCON 2023 Finals: cgi-2023 XS-Leaksまとめ: https://xsleaks.dev/