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
320
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
57
State of the Union: Advances in Web Application and Browser Security
mastahyeti
2
130
Other Decks in Technology
See All in Technology
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
54k
AI駆動開発はどこまで来たのか? ファインディの最新実態調査で読み解く現在地 Devin Con Tokyo
akiratom
2
1.3k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
AI時代の「OAuth認証」にどう物申すか?(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
290
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
300
紙 to デジタル
ichien178
0
160
1.5時間を無駄にして学んだwsl2におけるaptとsnapの選択と仕組み
yosaka0123
0
450
tamachi.go 誕生の裏側
rymiyamoto
1
210
dbt と Snowflake と tag
kevinrobot34
1
250
RelayerというPHPのフレームワークを作った
polidog
PRO
0
140
内製AIチャットボット開発で学んだ Datadog Agent Observability活用術
mkdev10
0
150
Windows の互換機能 - 古いプログラムはなぜ動作できるのか
murachiakira
PRO
0
110
Featured
See All Featured
Leo the Paperboy
mayatellez
8
2.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
210
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Automating Front-end Workflow
addyosmani
1369
210k
Scaling GitHub
holman
464
140k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
500
It's Worth the Effort
3n
188
29k
Deep Space Network (abreviated)
tonyrice
0
270
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Become a Pro
speakerdeck
PRO
31
6.2k
Prompt Engineering for Job Search
mfonobong
0
420
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...