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
Keep Your API Secure
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Андрей Листочкин (Andrey Listochkin)
November 29, 2014
Programming
88
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Keep Your API Secure
Kiyv JS November 2014
Андрей Листочкин (Andrey Listochkin)
November 29, 2014
More Decks by Андрей Листочкин (Andrey Listochkin)
See All by Андрей Листочкин (Andrey Listochkin)
Everybody Stand Back! I Know Regular Expressions
listochkin
0
240
Command-line scripting with Rust. Wait, what?!
listochkin
0
420
Server Memory - BuildStuff Ukraine 2019
listochkin
0
76
Server Memory - Chernivtsi JS 2019
listochkin
1
170
10 Years Later
listochkin
0
400
Managing Managers - DevTalks iHUB
listochkin
0
87
Time, Numbers, Text
listochkin
1
670
Software Licensing: A Minefield Guide
listochkin
0
190
We Make Bots. For Real
listochkin
0
480
Other Decks in Programming
See All in Programming
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
The Rails Doctrine Decade
koic
2
560
Java 27新機能 / Java 27 new features
kishida
2
220
sbt 2.0: takeoff
eed3si9n
0
120
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
すこし踏み込む CancellationToken
htkym
2
1.7k
APNsからLive Activityを開始する話
yumnumm
0
160
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
650
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Workers Cache を知る
syumai
0
350
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
Evolving SEO for Evolving Search Engines
ryanjones
0
320
Statistics for Hackers
jakevdp
799
230k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Site-Speed That Sticks
csswizardry
13
1.6k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
720
sira's awesome portfolio website redesign presentation
elsirapls
0
450
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
720
Transcript
Keep Your API Secure
None
OSWAP
XSS
SQL Injection
Plugins
Today
Crossite
CSRF
HTTP
Cookies
Secure HttpOnly
Set-Cookie: name=value; domain=.whatever.com; path=/; expires=Tue, 28-Nov-2034 21: 05:44 GMT; secure;
HttpOnly
Cookie: name=value
sessionId=a4d543bc809
Session Management
In Memory
External
None
Client Based
WAT??? нужна картинка
Encrypt
salt
salt+encData
salt+encData
Sign
(salt+encData)+signature
(salt+encData+createdAt+lifetime Duration)+signature
2 keys: encryption key signing key
{user info} => encrypt => sign => cookie
cookie => check signature => decrypt => {User Info}
Too complicated?
But ready-made!
by Mozilla
mozilla/node-client-sessions
Browser sends cookies automatically
CSRF
Roll-your-own-Cookie
Client: custom header / payload Server: middleware
Tokens
JSON Web Token
{user data} => encrypt => sign => token => memory,
localStorage
jsonwebtoken express-jwt
Securing WebSockets
HTTP Upgrade Request 101
Only implicit Auth Cookie or Basic Auth
HTTP: get WS token WS: send token to validate user
Fin
Frontend UA
Frontend UA Angular UA Ember UA Node UA Mobile Frontend
...
None
Gitter
NodeSchool Node Forward Angular UI RobotsConf lxjs
dev-ua
None
https://tinyurl.com/welcome-to-dev-ua frontendua.im angular.im