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
Keep Your API Secure
Search
Андрей Листочкин (Andrey Listochkin)
November 29, 2014
Programming
88
1
Share
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
210
Command-line scripting with Rust. Wait, what?!
listochkin
0
420
Server Memory - BuildStuff Ukraine 2019
listochkin
0
68
Server Memory - Chernivtsi JS 2019
listochkin
1
160
10 Years Later
listochkin
0
390
Managing Managers - DevTalks iHUB
listochkin
0
81
Time, Numbers, Text
listochkin
1
650
Software Licensing: A Minefield Guide
listochkin
0
180
We Make Bots. For Real
listochkin
0
460
Other Decks in Programming
See All in Programming
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
160
iOS26時代の新規アプリ開発
yuukiw00w
0
130
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
620
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
3
180
AgentCore Optimizationを始めよう!
licux
3
250
[BalkanRuby 2026] Drop your app/services!
palkan
3
510
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
要はバランスからの卒業 #yumemi_grow
kajitack
0
170
Are We Really Coding 10× Faster with AI?
kohzas
0
190
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
340
The Limits of Empathy - UXLibs8
cassininazir
1
330
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
210
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
300
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
240
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
New Earth Scene 8
popppiees
3
2.2k
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