Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CSP
Search
Ben Toews
January 10, 2013
Technology
310
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSP
Content Security Policy
Ben Toews
January 10, 2013
More Decks by Ben Toews
See All by Ben Toews
GitHub AppSec: Keeping up with 111 prolific engineers
mastahyeti
0
140
The sky is falling: Nephological tales of security woe
mastahyeti
0
53
State of the Union: Advances in Web Application and Browser Security
mastahyeti
2
130
Other Decks in Technology
See All in Technology
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
20260801_スクフェス大阪
kgnkhkr
1
1.2k
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.7k
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
190
Goでデータパイプラインを作ろう
sansantech
PRO
0
250
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
380
Digitization部 紹介資料
sansan33
PRO
2
7.7k
【Google Cloud Next Tokyo'26】Gemini Enterprise と Oracle AI Database で実現する、業務データ活用を実現する AI エージェント実装
shisyu_gaku
0
210
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
1
400
事業価値と Engineering 2026年度版
recruitengineers
PRO
35
18k
初めてのGitHub Actions / GitHub Actions at First
tooppoo
0
140
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
480
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
So, you think you're a good person
axbom
PRO
2
2.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
870
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
650
New Earth Scene 8
popppiees
3
2.5k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
400
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Transcript
csp ben toews github
the problem
None
<script>alert(123)</script>
the old fix
<script>alert(123)</script>
the problem
None
<script>alert(123)</script>
the new fix
csp
<a onclick=‘doit()’>123</a>
<a onclick=‘doit()’>123</a>
<a href=‘javascript:doit()’>123</a>
<a href=‘javascript:doit()’>123</a>
<a style=‘display: block’>123</a>
<a style=‘display: block’>123</a>
csp = no javascript + no css = 1995?
csp = source whitelisting!
X-Content-Security-Policy: default-src *; script-src https://github.com https://a24 8.e.akamai.net https://jobs.github.com h ttps://ssl.google-analytics.com
https://s ecure.gaug.es https://gist.github.com; s tyle-src https://github.com https://a248. e.akamai.net https://jobs.github.com htt ps://ssl.google-analytics.com https://sec ure.gaug.es https://gist.github.com 'uns afe-inline'; report-uri /errors Content-Se curity-Policy: default-src *; script-src htt ps://github.com https://a248.e.akamai.ne
Content-Security-Policy: X-WebKit-CSP: X-Content-Security-Policy:
default-src
script-src
style-src
object-src
img-src
media-src
frame-src
font-src
connect-src
Content-Security-Policy: img-scr ‘none’
Content-Security-Policy: img-scr ‘self’
Content-Security-Policy: img-scr ‘unsafe-inline’
Content-Security-Policy: img-scr ‘unsafe-eval’
Content-Security-Policy: img-scr https://me.com:443
ity-Policy: img-scr https:
ity-Policy: img-scr me.com
ity-Policy: img-scr *.me.com
ity-Policy: img-scr https://me.com
ity-Policy: img-scr me.com:443
Content-Security-Policy: default-src ‘self’; object-src h ttps://youtube.com; img-src http://foo.akami.com https://bar.akami.com;
report-uri
{ "csp-report": { "document-uri": "https://github.com/", "referrer": "", "blocked-uri": "self", "violated-directive":
"eval script base restriction", "source-file": "chrome://firebug/content/co...", "script-sample": "call to eval() or related...", "line-number": 166 } }
the end...