NODE.JS SECURITY - ADDICTION TO SELF DESTRUCT
BY ROMAN SACHENKO
NODE.JS SECURITY - ADDICTION TO SELF DESTRUCT
BY ROMAN SACHENKO
ABOUT ME
I did everything wrong because I can do everything wrong
CONTENTS
Cyber Security - beginning for beginners
NodeJS Vulnerabilities
It's show time (c) Ben Richards
Painkiller
CYBER SECURITY - BEGINNING FOR BEGINNERS
Okay, now it's secure enough (c) noone ever
Application evolution
Before
Simple static websites with the same information for all user.
After
Huge complex applications with personal interface, stored data and high-level functionality.
CYBER SECURITY - BEGINNING FOR BEGINNERS
What's now:
etc.
CYBER SECURITY - BEGINNING FOR BEGINNERS
Is this application secure enough?
CYBER SECURITY - BEGINNING FOR BEGINNERS
Is this application secure enough?
CYBER SECURITY - BEGINNING FOR BEGINNERS
User can:
User/Attacker can initiate a process of:
CYBER SECURITY - BEGINNING FOR BEGINNERS
BEFORE WE START
Good developers code; Best developers copy (c) stack overflow
3rd party dependencies
your code
APP
MODERN APPLICATION
The most guaranteed but time-consuming method to crack a password
BRUTE-FORCE ATTACK
Guess:
Conditions:
BRUTE-FORCE ATTACK
Guess:
Conditions:
Result:
BRUTE-FORCE ATTACK
Guess:
Result:
BRUTE-FORCE ATTACK
Best Practice:
BRUTE-FORCE ATTACK
Painkiller
BRUTE-FORCE ATTACK
DATABASE INJECTIONS
DB injection has been around for almost 20 years and is still a big issue
Examples:
DELETE /users/?id=<userId>
UserModel.remove({ _id: req.query.id });
DATABASE INJECTIONS
Examples:
DELETE /users/?id=<userId>
UserModel.remove({ _id: req.query.id });
UserModel.remove({ _id: { '$exists': true } });
DELETE /users/?id={ '$exists': true }
DATABASE INJECTIONS
Examples:
db.<collection>.find( { $where: "this.<key> == 'a; sleep(1000000)'" } );
db.<collection>.find( { $where: "this.<key> == <value>" } );
DATABASE INJECTIONS
Best Practice:
DATABASE INJECTIONS
DATABASE INJECTIONS
REGULAR EXPRESSION DOS
RE implementations may reach extreme situations that cause them to work slowly
What the hell is the state machine and NFA?
REGULAR EXPRESSION DOS
Regular Expression: ^(a+)+$
Result:
aaaaX - 16 possible paths
aaaaaaaaaaaaaaaaX - 65536 possible paths
REGULAR EXPRESSION DOS
Evil Regular Expressions:
REGULAR EXPRESSION DOS
Painkiller:
REGULAR EXPRESSION DOS
Helpers:
MEMORY LEAKS
Tracking down memory leaks has always been a challenge
MEMORY LEAKS
heap
stack
resident set
retained size
shallow size
mark-sweep
scavenge
old space
new space
Common Reasons:
MEMORY LEAKS
Painkiller:
MEMORY LEAKS
HIJACKING THE REQUIRE CHAIN
Hooking all asynchronous core methods is definitely possible
HIJACKING THE REQUIRE CHAIN
A
B
C
HIJACKING THE REQUIRE CHAIN
A
B
C
D
C
E
HIJACKING THE REQUIRE CHAIN
A
B
C
D
C
E
PATCH
HIJACKING THE REQUIRE CHAIN
HIJACKING THE REQUIRE CHAIN
B
A
D
C
E
C
APPLICATION
CACHED
HIJACKING THE REQUIRE CHAIN
HIJACKING THE REQUIRE CHAIN
Rain Bow Table attack must be weird enough...
RAINBOW TABLE
Theory:
RAINBOW TABLE
Best Practice:
RAINBOW TABLE
BEST PRACTICE
May the 4th be with you
BEST PRACTICE
HELPFUL MODULES
Let off some steam
Rate Limiting
Memory Check
Other
HELPFUL MODULES
ARTICLES
Do they speak English in What?
Security 'musts'
Memory Leak
Require Chain
ARTICLES
QUESTIONS?
*and again I couldn't find a funny meme for this page
roman.sachenko@gmail.com
roman.sachenko
CONTACTS