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
Transcript
46 slides
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
More Decks by Paulo Pires
See All by Paulo Pires
Introdução ao WebAssembly
paulohp
0
74
Introdução ao GraphQL
paulohp
0
73
GraphQL 101
paulohp
0
140
Side Effects: Uma Saga até o React
paulohp
0
110
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
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
1.3k
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
650
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
680
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
120
Getting Started with Vibe Coding
miccheng
0
260
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
200
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
360
Featured
See All Featured
Accessibility Awareness
sabderemane
1
320
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
390
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k