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
Андрей Листочкин (Andrey Listochkin)
November 29, 2014
Programming
91
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
Transcript
56 slides
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
More Decks by Андрей Листочкин (Andrey Listochkin)
See All by Андрей Листочкин (Andrey Listochkin)
Everybody Stand Back! I Know Regular Expressions
listochkin
0
250
Command-line scripting with Rust. Wait, what?!
listochkin
0
430
Server Memory - BuildStuff Ukraine 2019
listochkin
0
79
Server Memory - Chernivtsi JS 2019
listochkin
1
180
10 Years Later
listochkin
0
410
Managing Managers - DevTalks iHUB
listochkin
0
93
Time, Numbers, Text
listochkin
1
680
Software Licensing: A Minefield Guide
listochkin
0
190
We Make Bots. For Real
listochkin
0
480
Other Decks in Programming
See All in Programming
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
230
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
520
Kiro Crewによる開発体験ーKiro CrewでStrands Decider 2B に関する技術検証をやってみた
satoshi256kbyte
1
140
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
280
はじめてのPLATEAU
nokonoko1203
1
670
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
Promiseの向こう側へコンテキストを届ける ― proposal-async-context
seriseri
0
210
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
390
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
130
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
SODA - FACT BOOK(EN)
sodainc
1
290
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
The browser strikes back
jonoalderson
0
2k
How to train your dragon (web standard)
notwaldorf
96
6.9k
The agentic SEO stack - context over prompts
schlessera
0
1k
4 Signs Your Business is Dying
shpigford
187
23k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Odyssey Design
rkendrick25
PRO
3
980
SEO for Brand Visibility & Recognition
aleyda
0
4.9k
New Earth Scene 8
popppiees
5
2.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k