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
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
71
Introdução ao GraphQL
paulohp
0
67
GraphQL 101
paulohp
0
130
Side Effects: Uma Saga até o React
paulohp
0
100
MobX: State Management made easy
paulohp
0
110
Docker: The Rise of Containers
paulohp
0
140
We Work Remotely
paulohp
2
120
Angular2
paulohp
0
250
Node.js Codelab
paulohp
1
200
Other Decks in Programming
See All in Programming
mrbgem 三角測量 開発
ogom
0
220
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
640
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
210
contenteditable と日本語入力に向き合う
colorful12
0
180
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
570
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.3k
setup-vp GitLab対応の裏側
naokihaba
0
160
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
Are APIs Still Relevant in the AI Era?
soyuka
0
440
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
Domain-Driven Transformation
hschwentner
2
2.3k
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1.1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
860
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
400
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
550
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
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