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
Secure your Web Application
Search
Dheeraj Joshi
July 16, 2016
Technology
0
6.5k
Secure your Web Application
Slides from my talk at JSChannel Conference 2016
Dheeraj Joshi
July 16, 2016
Tweet
Share
More Decks by Dheeraj Joshi
See All by Dheeraj Joshi
Beyond Scanning
djadmin
0
440
Let's talk Security
djadmin
0
7.4k
Other Decks in Technology
See All in Technology
セキュリティグループの”タイプ”を改めて考えてみる
masakiokuda
0
140
QAエンジニアが スクラムマスターをすると いいなぁと思った話
____rina____
1
280
EC-CUBEはサーバレスで動かせるのか?
yukishimada
1
130
書籍『入門 OpenTelemetry』 / Intro of OpenTelemetry book
ymotongpoo
10
680
【Oracle Cloud ウェビナー】【入門&再入門】はじめてのOracle Cloud Infrastructure [+最新情報]
oracle4engineer
PRO
1
310
ブレインパッド_20250311_AIxIoTビジネス共創ラボ_第2回勉強会.pdf
iotcomjpadmin
0
210
保育 AI「たよれるくん」で 保育の質向上をアシスト
skakimoto
0
120
人生を左右する「即答」のススメ: 一瞬の判断を間違えないためにするべきこと
takasyou
10
1.4k
リポジトリをまるっとAIに食わせるRepomixの話
yamadashy
0
140
組織に持ち込む脅威モデリング
nikinusu
1
520
StotybookからはじめるVRT -個人開発編-
arrow2nd
1
950
技術を育てる組織・組織を育てる技術 / technology and organization
motemen
10
3.9k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Become a Pro
speakerdeck
PRO
26
5.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
280
Large-scale JavaScript Application Architecture
addyosmani
511
110k
For a Future-Friendly Web
brad_frost
176
9.6k
Visualization
eitanlees
146
15k
Music & Morning Musume
bryan
46
6.4k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Transcript
Let’s talk Security Secure your Web Application - Best Practices
Dheeraj Joshi @dheerajhere
• Front-End @ • Previously @ • Open Source (medium-cli)
• Ambidextrous TT Player About Me
More... I wear White Hat. Uber, CKEditor, Dropbox, MailChimp, Recruiterbox,
InVision, DigitalOcean, Intuit, Groupon, etc. What makes me happy?
Agenda • Why ? • Cross-site Scripting (XSS) • Cross-site
Request Forgery (CSRF) • Content Security Policy (CSP) • Useful Headers • Other Best Practices • Live Demo
Why should Startups Care about Security? Startups & SMEs are
known to cut corners. One of the first things they cut is ‘Security'.
None
Github Reused password attack
HACKER PUTS HOSTING SERVICE “CODE SPACES” OUT OF BUSINESS The
Shutdown
CROSS SITE SCRIPTING - XSS • XSS attack users •
“Javascript Injection” • Exploits can be bad, really bad..
What is XSS? Typical Reflected XSS
Stored XSS
DOM XSS
Protect Yourself • Input Validation • Ensure that outputs are
HTML encoded • Don’t reinvent the wheel (Use proven sanitizers) • Analyze places where DOM elements are created
ngBind attribute $sanitize - service in module ngSanitize Sanitizes an
html string by stripping all potentially dangerous tokens.
• Add HTTPOnly, Secure attributes on Session Cookie
CROSS-SITE REQUEST FORGERY (CSRF)
Because the attack is carried out by the victim, CSRF
can bypass: • HTTP Auth • Session-based auth • Firewalls CSRF Attacks
Prevention
• Only accepting POST requests • Referer Protection • Multi-Step
Transactions • URL Rewriting • application/json “CSRF Myths” Preventions that Won’t work
XSS + CSRF =
Content Security Policy (CSP)
List of useful HTTP headers • Strict-Transport-Security: max-age=16070400; includeSubDomains •
X-Frame-Options: deny • X-XSS-Protection: 1; mode=block
Prevent Information Disclosure Hide X-Powered-By Or try this ;)
Target=”_blank” • Access `window.opener`. • Fix `rel=noopener`. (Firefox : rel=noreferrer)
• window.opener = null;
How to improve ? • SECURITY.md • Security audits •
Discuss Vulnerabilities
Show Time !
Thank you @dheerajhere @djadmin