Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Web Security
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hooopo
November 29, 2012
Programming
230
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web Security
Web Security
Hooopo
November 29, 2012
More Decks by Hooopo
See All by Hooopo
test
hooopo
2
120
Other Decks in Programming
See All in Programming
ジョジョの世界をXRで再現する
mofurune
0
160
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
残高管理から台帳サービスへの進化
artoy
1
200
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2k
Event is what happens
moro
2
780
SREの越境 / SRE Collaboration
y0hgi
2
310
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
330
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Agile that works and the tools we love
rasmusluckow
331
22k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
BBQ
matthewcrist
90
10k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Transcript
Web Security
Same Origin Policy 同源策略
同源 • 协议相同 • 域名相同 • 端口相同
同源策略的内容 限制来自不同源的“document”或脚本, 对当前“document”读取或设置某些属 性
浏览器沙箱 • XMLHttpRequest和CURL发起请求有 什么不同? • 同源策略保护当前域还是被请求域? • SRC属性加载外部资源违背同源策略 么? •
第三方Cookie和会话Cookie
如何绕过同源策略 • document.domain = "csdn.net" • Flash的crossdomain.xml • JSONP解决跨域发送请求,带来的问 题?
• P3P解决跨域共享Cookie,带来的问 题?
Cross Site Scriping 跨站脚本攻击
XSS的分类 • 反射型 • 持久型
XSS攻击方式 • Cookie劫持 • XSS钓鱼(诱骗密码) • XSS蠕虫
对抗XSS • HTTP Only Cookie • IE8 XSS Filter •
Firefox的CSP(Content Security Policy) • IE8的X-Content-Type-Options: nosniff
IE8 XSS Filter • X-XSS-Protection: 1; mode=block
Firefox CSP • X-Content-Security-Policy: allow 'self' *.mydomain.com • X-Content-Security-Policy: allow
'self' img-src *;media-src medial. com script-src script.com
Firefox CSP XSS Filter • reflected-xss allow is equivalent to
X- XSS-Protection: 0 • reflected-xss filter is equivalent to X-XSS- Protection: 1 • reflected-xss block is equivalent to X- XSS-Protection: 1; mode=block
Auto HTML Escape能否彻底防御XSS?
Cross Site Request Forgery 跨站伪造请求
CSRF的原理 • 以用户的身份(Cookie)伪造请求
CSRF的危害 • 伪造普通用户的请求 • 伪造管理员的请求 • CSRF蠕虫
使用Post请求能否彻底防御 CSRF?
Referer检测能否正确防御 CSRF? • Flash某些版本可以自定义referer • 页面从HTTPS跳转到HTTP(RFC-2616) • Firefox中有相应参数可以设置是否发送HTTP Referer
CSRF的本质 • 所有请求参数都可以被攻击者猜到
正确的防御CSRF方法 • 不可预测原则 • one csrf token per session •
one csrf token per user
JSONP Hijacking JSONP 劫持
JSONP劫持本质是CSRF
点击劫持(Clickjacking)
点击劫持的防御 • FrameBusting:HTML5 iframe sandbox属性 和IE iframe security属性 • IE8+的
X-Frame-Options: DENY/SAMEORIGIN/Allow-From • Firefox的CSP
图片覆盖攻击(Cross Site Image Overlaying)
P3P头的副作用 IE默认禁止img,iframe,script,link等 标签发送第三方cookie,开启P3P之后会 允许发送第三方cookie
开源软件和CVE • Semantic Versioning
Refs • http://recxltd.blogspot.co.uk/2012/03/seven-web-server-http-headers-that.html • https://blog.whitehatsec.com/x-frame-options/ • http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx • http://homakov.blogspot.com/2012/06/saferweb-with-new-features-come-new.html •
http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx • https://www.owasp.org/index.php/HttpOnly • http://guides.rubyonrails.org/security.html#session-hijacking • http://en.wikipedia.org/wiki/HTTP_cookie#Secure_and_HttpOnly • http://rubylution.herokuapp.com/topics/32 • https://www.owasp.org/index.php/Clickjacking • http://blogs.msdn.com/b/ie/archive/2010/10/26/mime-handling-changes-in-internet- explorer.aspx • http://hi.baidu.com/aullik5/item/da5f5fec1a78c9d5ea34c9f8 • http://seclab.stanford.edu/websec/framebusting/framebust.pdf • http://book.douban.com/subject/10546925/ • http://hi.baidu.com/sysdog/item/4b44b7dd892d9655d63aaeb5 • http://semver.org/