SlideShare a Scribd company logo
• Web
►
• Cross Site Scripting (XSS)
► Web
► Web
► 3
• Client-Side XSS
1
XSS Client-Side XSS
• Client-Side XSS ( : DOM Based XSS) [1]
2[1]. IPA, “IPA DOM Based XSS ”, https://www.ipa.go.jp/files/000024729.pdf , 2013
XSS
3
Client-Side XSS [2]
HTML XSS
Content Security PolicyWeb Application Firewall
[2]. Sebastian Lekies, Krzysztof Kotowicz, Samuel Groß, Eduardo A. Vela Nava, Martin Johns,
“Code-Reuse Attacks for the Web: Breaking Cross-Site Scripting Mitigations via Script Gadgets”, The ACM CCS, 2017
XSS
JavaScript
Client-Side XSS
• Client-Side XSS
► [3]
► [4]
► [5]
► … etc
4
JavaScript Web
[3]. Ben Stock, Sebastian Lekies, Tobias Mueller, Patrick Spiegel, Martin Johns,
“Precise Client-side Protection against DOM-based Cross-Site Scripting”, 23rd USENIX Security Symposium, 2014
[4]. Inian Parameshwaran, Enrico Budianto, Shweta Shinde, “Auto-Patching DOM-based XSS At Scale”,
Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 272-283, 2015.
[5]. Marius Musch, Marius Steffens, Sebastian Roth, Ben Stock, Martin Johns.
"Scriptprotect: Mitigating unsafe third-party javascript practices", AsiaCCS, 2019.
Trusted Types
• [6]
► Trusted Types
5
$('div').innerHTML = '<img src=/ onerror="alert(10)">' // ERROR
const escapePolicy = TrustedTypes.createPolicy('mypolicy', {
createHTML: (unsafe) => {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
}
})
const trustedHTML = escapePolicy.createHTML('<img src=/ onerror="alert(10)">')
$('div').innerHTML = trustedHTML // SUCCESS
[6]. Krzysztof Kotowicz, Mike West, "Trusted Types", https://wicg.github.io/trusted-types/dist/spec/
Web
Trusted Types
• 3
►
► Web
► DOM
• Trusted Types JavaScript
►
► Web Web
6
let trusted = "https://example.co.jp/";
let host = location.host;
let hash = location.hash;
document.writeln(trusted); // SUCCESS
document.writeln(host); // ERROR
document.writeln(hash); // ERROR
Trusted Types
• Trusted Types 2
7
1
Trusted Types
let trusted = "https://example.co.jp/";
let host = location.host;
let hash = location.hash;
document.writeln(trusted); // SUCCESS
document.writeln(host); // SUCCESS
document.writeln(hash); // ERROR
Trusted Types
Input Source
URL document.location
baseURI location.hash
documentURI location.search
window.location location.href
• OSS JavaScript Web
► V8: 7.7.299.11
► Chromium: 77.0.3865.90
81 2
let trusted = "https://example.co.jp/";
let host = location.host;
let hash = location.hash;
document.writeln(trusted);
document.writeln(host);
document.writeln(hash);
• JavaScript
•
►
9
Stock
[3]
Parameshwaran
[4] 1 2
Web
×
Web Web
( ) 7~17% 5% 1.2% 0.4~1.2%
0.16% - 46.2% 10.9%
•
► Trusted Types
• 2 URL ? #
10
2 1269 1.1%
))
(
047
12 4 7
36 36 58

More Related Content

PPTX
Web content security policies
PDF
Protecting Java Microservices: Best Practices and Strategies
PDF
CILogon & SciTokens: OIDC/OAuth Federation
PPTX
Xss attack
PDF
Securing your Movable Type installation
PPTX
Xss what the heck-!
PDF
Securing your Node.js App
PPTX
Cross Site Scripting(XSS)
Web content security policies
Protecting Java Microservices: Best Practices and Strategies
CILogon & SciTokens: OIDC/OAuth Federation
Xss attack
Securing your Movable Type installation
Xss what the heck-!
Securing your Node.js App
Cross Site Scripting(XSS)

What's hot (20)

PPTX
Cross site scripting
PDF
Django ws
PDF
OWASP AppSec USA 2017: Cookie Security – Myths and Misconceptions by David Jo...
PPTX
OWASP Top Ten 2017
 
PDF
[Cluj] CSP (Content Security Policy)
PDF
Content Security Policy
PDF
Meteor Meets Mallory
PPTX
Ransomware wannacry
PPTX
Kenneth simple bitcoinwebsite
PDF
Web vulnerabilities
PDF
Browser Wars 2019 - Implementing a Content Security Policy
PDF
Http security response headers
PDF
웹 개발을 위해 꼭 알아야하는 보안 공격
PPTX
Propelling security
PPTX
Cyber Security Briefing for Beginners
PDF
BsidesDelhi 2018: DomGoat - the DOM Security Playground
PDF
Security Basics For Developers Knowledge
PPTX
Windows Azure Kick Start - Common Scenarios
PDF
匿名性が気になってZerocashの White Paperを追ってみた #blockchaintokyo
PDF
Content Security Policy
Cross site scripting
Django ws
OWASP AppSec USA 2017: Cookie Security – Myths and Misconceptions by David Jo...
OWASP Top Ten 2017
 
[Cluj] CSP (Content Security Policy)
Content Security Policy
Meteor Meets Mallory
Ransomware wannacry
Kenneth simple bitcoinwebsite
Web vulnerabilities
Browser Wars 2019 - Implementing a Content Security Policy
Http security response headers
웹 개발을 위해 꼭 알아야하는 보안 공격
Propelling security
Cyber Security Briefing for Beginners
BsidesDelhi 2018: DomGoat - the DOM Security Playground
Security Basics For Developers Knowledge
Windows Azure Kick Start - Common Scenarios
匿名性が気になってZerocashの White Paperを追ってみた #blockchaintokyo
Content Security Policy
Ad

Similar to パフォーマンスを考慮したプリミティブなTrusted TypesによるClient-Side XSS防御手法 (20)

PDF
Trusted Types @ W3C TPAC 2018
PDF
Trusted Types and the end of DOM XSS
PDF
Appsec XSS Case Study
PPTX
Cross Site Scripting (XSS)
PDF
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
PPTX
How to React to JavaScript Insecurity
PDF
OWASP SF - Reviewing Modern JavaScript Applications
PDF
XSS.pdf
PDF
XSS.pdf
PDF
Secure java script-for-developers
PPTX
XSS: From alert(1) to crypto mining malware
PDF
Locking the Throne Room - How ES5+ might change views on XSS and Client Side ...
PDF
The Cross Site Scripting Guide
PDF
ClubHack Magazine issue April 2012
PPTX
Webinar–Reviewing Modern JavaScript Applications
DOC
Same Origin Policy Weaknesses
PPTX
W3 conf hill-html5-security-realities
PDF
XSS Injection Vulnerabilities
PPTX
Web security: Securing untrusted web content at browsers
PDF
[OPD 2019] Trusted types and the end of DOM XSS
Trusted Types @ W3C TPAC 2018
Trusted Types and the end of DOM XSS
Appsec XSS Case Study
Cross Site Scripting (XSS)
Trusted Types - Securing the DOM from the bottom up (JSNation Amsterdam)
How to React to JavaScript Insecurity
OWASP SF - Reviewing Modern JavaScript Applications
XSS.pdf
XSS.pdf
Secure java script-for-developers
XSS: From alert(1) to crypto mining malware
Locking the Throne Room - How ES5+ might change views on XSS and Client Side ...
The Cross Site Scripting Guide
ClubHack Magazine issue April 2012
Webinar–Reviewing Modern JavaScript Applications
Same Origin Policy Weaknesses
W3 conf hill-html5-security-realities
XSS Injection Vulnerabilities
Web security: Securing untrusted web content at browsers
[OPD 2019] Trusted types and the end of DOM XSS
Ad

More from inet-lab (6)

PDF
清掃工場における磁気フィンガープリンティングパスマッチングによる 屋内測位手法の性能評価
PDF
2022/02 情報基盤システム学(NAIST)の研究室紹介
PDF
運行情報と気象情報の畳み込みによるバス到着時刻予測手法の提案と評価
PDF
euclides-c mthesis
PPTX
shuji-oh master thesis
PDF
情報基盤システム学(NAIST)の研究室紹介
清掃工場における磁気フィンガープリンティングパスマッチングによる 屋内測位手法の性能評価
2022/02 情報基盤システム学(NAIST)の研究室紹介
運行情報と気象情報の畳み込みによるバス到着時刻予測手法の提案と評価
euclides-c mthesis
shuji-oh master thesis
情報基盤システム学(NAIST)の研究室紹介

Recently uploaded (20)

PPTX
Introduction to Information and Communication Technology
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
Funds Management Learning Material for Beg
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
innovation process that make everything different.pptx
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
newyork.pptxirantrafgshenepalchinachinane
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Internet___Basics___Styled_ presentation
Introduction to Information and Communication Technology
Decoding a Decade: 10 Years of Applied CTI Discipline
artificialintelligenceai1-copy-210604123353.pptx
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Funds Management Learning Material for Beg
Unit-1 introduction to cyber security discuss about how to secure a system
INTERNET------BASICS-------UPDATED PPT PRESENTATION
innovation process that make everything different.pptx
international classification of diseases ICD-10 review PPT.pptx
Design_with_Watersergyerge45hrbgre4top (1).ppt
introduction about ICD -10 & ICD-11 ppt.pptx
Job_Card_System_Styled_lorem_ipsum_.pptx
Exploring VPS Hosting Trends for SMBs in 2025
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Cloud-Scale Log Monitoring _ Datadog.pdf
Paper PDF World Game (s) Great Redesign.pdf
Power Point - Lesson 3_2.pptx grad school presentation
newyork.pptxirantrafgshenepalchinachinane
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Internet___Basics___Styled_ presentation

パフォーマンスを考慮したプリミティブなTrusted TypesによるClient-Side XSS防御手法

  • 1. • Web ► • Cross Site Scripting (XSS) ► Web ► Web ► 3 • Client-Side XSS 1
  • 2. XSS Client-Side XSS • Client-Side XSS ( : DOM Based XSS) [1] 2[1]. IPA, “IPA DOM Based XSS ”, https://www.ipa.go.jp/files/000024729.pdf , 2013
  • 3. XSS 3 Client-Side XSS [2] HTML XSS Content Security PolicyWeb Application Firewall [2]. Sebastian Lekies, Krzysztof Kotowicz, Samuel Groß, Eduardo A. Vela Nava, Martin Johns, “Code-Reuse Attacks for the Web: Breaking Cross-Site Scripting Mitigations via Script Gadgets”, The ACM CCS, 2017 XSS JavaScript
  • 4. Client-Side XSS • Client-Side XSS ► [3] ► [4] ► [5] ► … etc 4 JavaScript Web [3]. Ben Stock, Sebastian Lekies, Tobias Mueller, Patrick Spiegel, Martin Johns, “Precise Client-side Protection against DOM-based Cross-Site Scripting”, 23rd USENIX Security Symposium, 2014 [4]. Inian Parameshwaran, Enrico Budianto, Shweta Shinde, “Auto-Patching DOM-based XSS At Scale”, Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 272-283, 2015. [5]. Marius Musch, Marius Steffens, Sebastian Roth, Ben Stock, Martin Johns. "Scriptprotect: Mitigating unsafe third-party javascript practices", AsiaCCS, 2019.
  • 5. Trusted Types • [6] ► Trusted Types 5 $('div').innerHTML = '<img src=/ onerror="alert(10)">' // ERROR const escapePolicy = TrustedTypes.createPolicy('mypolicy', { createHTML: (unsafe) => { return unsafe .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") } }) const trustedHTML = escapePolicy.createHTML('<img src=/ onerror="alert(10)">') $('div').innerHTML = trustedHTML // SUCCESS [6]. Krzysztof Kotowicz, Mike West, "Trusted Types", https://wicg.github.io/trusted-types/dist/spec/ Web
  • 6. Trusted Types • 3 ► ► Web ► DOM • Trusted Types JavaScript ► ► Web Web 6
  • 7. let trusted = "https://example.co.jp/"; let host = location.host; let hash = location.hash; document.writeln(trusted); // SUCCESS document.writeln(host); // ERROR document.writeln(hash); // ERROR Trusted Types • Trusted Types 2 7 1 Trusted Types let trusted = "https://example.co.jp/"; let host = location.host; let hash = location.hash; document.writeln(trusted); // SUCCESS document.writeln(host); // SUCCESS document.writeln(hash); // ERROR Trusted Types Input Source URL document.location baseURI location.hash documentURI location.search window.location location.href
  • 8. • OSS JavaScript Web ► V8: 7.7.299.11 ► Chromium: 77.0.3865.90 81 2 let trusted = "https://example.co.jp/"; let host = location.host; let hash = location.hash; document.writeln(trusted); document.writeln(host); document.writeln(hash);
  • 9. • JavaScript • ► 9 Stock [3] Parameshwaran [4] 1 2 Web × Web Web ( ) 7~17% 5% 1.2% 0.4~1.2% 0.16% - 46.2% 10.9%
  • 10. • ► Trusted Types • 2 URL ? # 10 2 1269 1.1% )) ( 047 12 4 7 36 36 58