Hacking Like a FED
Omer Levi Hevroni
@omerlh
@SolutoEng
Every line of code can introduce a new security issue
@omerlh
@omerlh
I’m a Developer
@omerlh
AppSec @
@omerlh
https://www.solutotlv.com/ @omerlh
@omerlh
@omerlh
FED’s Hacking Tool
@omerlhhttps://github.com/omerlh/juice-shop/pull/6
@omerlh
@omerlh
Dynamic Analysis Security Testing
https://www.zaproxy.org/
@omerlh
What Zap does?
• Inspecting request and response
• Run scan rules:
○ Cookies misconfiguration
○ Security HTTP Headers
○ Mixed Content
○ And many more
@omerlh
Leveraging End to End Tests
@omerlh
Example: Proxy Configuration
@omerlh
Running in the CI
• Run e2e tests
• Proxy through Zap
• Fail the build
@omerlh
And the result…
@omerlh
@omerlh
@omerlh
Cross Site Request Forgery (CSRF)
@omerlh
@omerlh
Mitigating CSRF
• Using SameSite attribute
• Adding Anti-CSRF token
https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross-
Site_Request_Forgery_Prevention_Cheat_Sheet.md
@omerlh
Static Analysis Security Testing
https://github.com/ajinabraham/NodeJsScan
@omerlh
Running it in the CI
Target Folder Repot file
@omerlh
@omerlh
Failing the build
Glue file Repot file
@omerlh
And the results…
@omerlh
trackorder.js
@omerlh
Normal Input
@omerlh
Malicious Input
@omerlh
Exploit time!
@omerlh
Viola!
@omerlh
Mitigating NoSQLi
• Never trust user input
• Input Sanitization
@omerlh
Packages Scanning
https://snyk.io/
@omerlh
@omerlh
What if one of this packages is vulnerable?
@omerlh
Running in the CI
https://snyk.io/docs/github/
@omerlh
And the results…
@omerlh
Let’s zoom in
@omerlh
Cross Site Scripting
• Code injection
• Usually, very high risk
@omerlh
Let’s zoom in
@omerlh
We can see the original GitHub issue!
@omerlh
Let’s exploit it!
@omerlh
Viola!
@omerlh
Fixing Vulnerable Packages
@omerlh
Mitigating XSS
• Never trust user input
• Input sanitization
• Security headers
• React is not immune to XSS!
https://github.com/OWASP/CheatSheetSeries/blob/master/che
atsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md
@omerlh
Wrapping Up
@omerlhhttps://github.com/omerlh/juice-shop/pull/6
@omerlh
Tool Type Tool Name Ease of Use
Packages Scanning Snyk Easy
Static Analysis NodeJSScan Medium
Dynamic Analysis OWASP Zap Hard
https://wp.me/pakmvi-3g
Tools Summary
@omerlh
Feedback is much appreciated!
@omerlh
@omerlh
https://wp.me/pakmvi-3g
Thank You
Omer Levi Hevroni
April 2019
@omerlh
http://jobs.soluto.com/

Hacking like a FED