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
XSS&CSRF
Search
ar7z1
November 17, 2015
0
130
XSS&CSRF
Внутренний курс по безопасности для разработчиков
ar7z1
November 17, 2015
Tweet
Share
More Decks by ar7z1
See All by ar7z1
Шпора.Безопасность
ar7z1
1
72
XSS & CSRF 2.0
ar7z1
0
100
HappyDev 2015
ar7z1
0
93
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
How to train your dragon (web standard)
notwaldorf
96
6.2k
How STYLIGHT went responsive
nonsquared
100
5.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
The Invisible Side of Design
smashingmag
301
51k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
Art, The Web, and Tiny UX
lynnandtonic
302
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Into the Great Unknown - MozCon
thekraken
40
2k
GraphQLとの向き合い方2022年版
quramy
49
14k
Transcript
XSS CSRF
[email protected]
TOOLS
http://bit.ly/ 1tMrggU
http://bit.ly/ 1jKA1UJ
XSS
Reflected
http://example.com/? q=<script>alert('1') </script>
Stored
<img src=lalala onerror="alert('1')" />
DOM-based
http://example.com/ #'><img src=qqq onerror=“alert(‘1’)”>
https://xss- game.appspot .com/
None
None
jsfuck.com
HtmlEncode
innerHTML document.write eval @Html.Raw
X-XSS-Protection
Content-Security- Policy X-Content-Security- Policy X-WebKit-CSP
Content-Security- Policy: default-src 'self'
<system.web> <httpRuntime requestValidationMode="4.0" /> </system.web> <system.web> <pages validateRequest="true" /> </system.web>
CSRF
site.com
site.com GET /emails gmail.com
site.com GET /emails gmail.com
Same Origin Policy
protocol://host:port
https://site.com http://site.com https://a.site.com https://site.com:9090
None
Cross-origin writes $.ajax({ type: "POST", url: url, data: {…}, contentType:'text/plain'
});
Cross-origin writes • application/x-www- form-urlencoded • multipart/form- data • text/plain
Cross-origin embedding $(‘…’).append( ‘<img src=“…”>’ );
Cross-origin reads $.get(url, function(data){ alert(data); });
GET evil.com
GET evil.com
<form method=“POST” action=“https://…/ SaveEmail”> <input type=“hidden” name=“email” value=“
[email protected]
” /> </form>
<form method=“POST” action=“https://…/SaveEmail”> <input type=“hidden” name=“email” value=“
[email protected]
” /> </form>
<script> window.onload = function(){ … form.submit(); } </script>
POST /SaveEmail
[email protected]
GET evil.com
candy- csrf.apphb.com
None
@troyhunt
webgoat. github.io
https://ctftime.org
@ar7z1
[email protected]