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
Como Fazer Apps Node.Js Seguras
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Paulo Pires
March 22, 2014
Programming
300
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Como Fazer Apps Node.Js Seguras
Paulo Pires
March 22, 2014
More Decks by Paulo Pires
See All by Paulo Pires
Introdução ao WebAssembly
paulohp
0
70
Introdução ao GraphQL
paulohp
0
65
GraphQL 101
paulohp
0
120
Side Effects: Uma Saga até o React
paulohp
0
100
MobX: State Management made easy
paulohp
0
100
Docker: The Rise of Containers
paulohp
0
130
We Work Remotely
paulohp
2
120
Angular2
paulohp
0
250
Node.js Codelab
paulohp
1
190
Other Decks in Programming
See All in Programming
新卒PdEのリアル
ryu1013
1
500
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
120
Heart of Swift Concurrency
koher
0
910
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
260
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1k
The Rails Doctrine Decade
koic
2
150
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
250
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
530
wkhtmltopdfの次どうするか問題2026
willnet
2
1.5k
速習iPhone Duo対応
yuukiw00w
1
660
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
220
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
We Are The Robots
honzajavorek
0
380
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
My Coaching Mixtape
mlcsv
0
320
A Tale of Four Properties
chriscoyier
163
24k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
730
Transcript
Como Fazer Apps Node.Js SEGURAS
@paulo_hp
None
Eu não sou um especialista em segurança web!
Como você inicia uma aplicação?
Muita Coisa Pra Pensar
Regras de Negócio Modelagem Frameworks? Node.JS?
Você trabalha igual louco e coloca o app em produção
+ usuários + visibilidade + exposição
Você fica vulnerável
SE GU RAN ÇA?
Segurança quase nunca entra em pauta!
Maioria dos ataques acontecem na camada de aplicação
Como prevenir esses ataques em nossos apps Node.JS?
Defesa
XSS
localhost:8000/?name=<script>alert(1)</script>
Encode Untrusted Data
SSJSi
eval() is evil
{"symbol" : "ASDF"} A chamada para eval avalia assim a
string: ({"symbol" : "ASDF"})
Mas se ao invés de um simples JSON, o atacante
enviar um código JS malicioso?
res.end('success')
O servidor executa esse comando, retornando o texto "success" como
resposta HTTP.
Com essa resposta, o atacante sabe que seu server é
vulnerável.
E assim ele pode enviar códigos que realmente causam estragos.
DoS *deprecated
Um ataque efetivo DoS pode ser executado simplesmente enviando um
comando
while(1)
Um descuido como esse pode dar acesso aos arquivos, processos
e até ao seu banco NoSQL
Algumas pequenas coisas podem ser feitas para evitar, como validar
inputs com RegEx e evitando o uso de eval()
e se você usa versão antiga, ATUALIZE!
CSRF
Ativando o uso de CSRF no Express.JS
app.js form.html
Garanta o uso correto dos metodos HTTP
Nomes de Cookies Genéricos
None
X-Powerd-By
Esse valor não interessa muito pra nós, e pode ser
removido facilmente
None
Avalie os módulos externos do NPM
nodesecurity.io
Eduque os desenvolvedores com OWASP Top 10 owasp.org
Inclua testes de segurança no ciclo de desenvolvimento
vlw :D