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
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
220
Command-line scripting with Rust. Wait, what?!
listochkin
0
420
Server Memory - BuildStuff Ukraine 2019
listochkin
0
70
Server Memory - Chernivtsi JS 2019
listochkin
1
170
10 Years Later
listochkin
0
400
Managing Managers - DevTalks iHUB
listochkin
0
86
Time, Numbers, Text
listochkin
1
660
Software Licensing: A Minefield Guide
listochkin
0
180
We Make Bots. For Real
listochkin
0
470
Other Decks in Programming
See All in Programming
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
160
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.6k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
440
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
170
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
910
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
550
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
170
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
210
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
230
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
350
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
130
Featured
See All Featured
Docker and Python
trallard
47
4k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
610
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
Paper Plane (Part 1)
katiecoart
PRO
1
9.8k
How to build a perfect <img>
jonoalderson
1
5.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
460
New Earth Scene 8
popppiees
3
2.4k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
380
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