SlideShare a Scribd company logo
ALBERT YU • TRUST ENGINEERING • ATLASSIAN • @YUKINYING
Modern Web Security
Lazy but Mindful Like a Fox
QCon SF 2016
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
security-defenses
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon San Francisco
www.qconsf.com
// TODO: Security <!--
Fix this
Build this
Who am I
Speciality: Application security
Previous: Paranoids @ Yahoo, 10+ years
Current: Trust Engineering, Sr Principal @ Atlassian
Leisure time: Cryptographic protocol analysis
Goal: Make security easy and affordable for everyone
KNOWING YOURSELF
KNOWING YOUR ENEMY
MODERN SECURITY
Agenda
Knowing Your Enemy
To win without jeopardy, be familiar with
yourself and your enemy.
SUNZI, THE ART OF WAR
“
”
Bounty
Hunters
http://www.ifc0nfig.com/dominos-pizza-and-
payments/
Paul Price, April 2016
Vendor: Domino
Bounty: $0
Tool: Burp Proxy
Pizza and Payments
What’s wrong
Pizza and Payments
What’s wrong
1. Mobile app used a payment provider
2. Provider sent payment verification to phone
3. Phone sent ordering reference back to the store
“let's trust the client. The client never lies.”
Paul Price
Imgur SSRF
Background
$2000 Bug
https://hackerone.com/reports/115748
Eugene Farfel, Mar 2016
Vendor: Imgur
Vulnerability: SSRF
Bounty: $2000
Rewarded for extending SSRF to send spam emails.
SSRF stands for Server Side Request Forgery.
Imgur SSRF
Background
$2000 Bug
SSRF in /vidgif/url?url=xxx
Translated into logic that runs curl with $url.
URL is probably sanitized, but schema can be set to
non-http protocol.
Imgur SSRF
Background
$2000 Bug
The interesting part:
SSRF with gopher protocol
gopher://evil.com/foo%0Abar%0A
=> get translated to telnet like payload
=> Exploit: Redirect gopher url to SMTP server
SSRF with tftp protocol
tftp://evil.com/foo
=> get translated to UDP
Author did not mention possibility of exploiting Redis.
Leads to additional disclosure around July 2016 by
other hackers.
Imgur Path Traversal
$5000 Bug
https://hackerone.com/reports/122475
Slim Shady, Apr 2016
Vendor: Imgur
Bounty: $5000
http://imgur.com/edit/process?
imageid=../../../../../../../../../../etc/passwd
Facebook RCE
Background
$10000 Bug
http://devco.re/blog/2016/04/21/how-I-hacked-
facebook-and-found-someones-backdoor-script-eng-
ver/
Orange Tsai, April 2016
Vendor: Facebook
Bounty: $10000
Facebook RCE
Background
$10000 Bug
tfbnw.net -> vpn.tfbnw.net -> files.fb.com
Running a vendor software with 2 existing CVE
Vulnerable system takes employee password
Found 7 more exploits, 4 of them got CVE assigned
*Found backdoors left by someone else*
Facebook RCE
Background
$10000 Bug
Uber RCE
Background
$10000 Bug
https://hackerone.com/reports/125980
http://blog.orange.tw/2016/04/bug-bounty-uber-
ubercom-remote-code_7.html
Orange Tsai, Apr 2016
Vendor: Uber
Bounty: $10000
Uber RCE
Background
$10000 Bug
String interpolation
Template rendering
All mixed up
Uber RCE
Background
$10000 Bug
Only 7-byte payload is needed
{{ 1+1 }}
Twitter Vine
$10080 Bug
https://avicoder.me/2016/07/22/Twitter-Vine-Source-
code-dump/
@avicoder, July 2016
Vendor: Twitter Vine
Bounty: $10080
Twitter Vine
$10080 Bug
https://censys.io -> https://docker.vineapp.com
Source code
API keys
Third party keys
Caja
Background
$??? Bug
http://blog.bentkowski.info/2016/07/xss-es-in-
google-caja.html
Michał Bentkowski, July 2016
Vendor: Google
Bounty: ???
Knowledge: ECMASCRIPT 6 changes
Google’s implementation of “virtual sandbox iframe”,
developed around 2008.
Parse Javascript, HTML, CSS and regenerate the safe
subset.
It was one of the safest implementation…
Caja
Background
$??? Bug
HTML5 first specification: 2008
Caja was started from HTML4
HTML comment parsing vs Javascript comment
parsing
ECMASCRIPT 6 added u{..}
Caja
Background
$??? Bug
This is why
Defense Attack
Knowing Yourself
Not knowing your enemy, a victory will
always follow with another loss.
SUNZI, THE ART OF WAR
“
”
How do we put up a good defense?
http://webblaze.cs.berkeley.edu/papers/empirical-webfwks.pdf
Talking point 1
All about contexts (client side)
Talking point 2
Supporting text should be kept
short and to the point; Limit
text to a maximum of 3 lines.
Supporting text should be kept
short and to the point; Limit
text to a maximum of 3 lines.
https://youtu.be/knWfT6CT9XM
All about contexts (server side)
All about contexts (server side)
Context - Facebook RCE via SQLi
Preparing SQL statements
mysql> SET @table = 't1';
mysql> SET @s = CONCAT('SELECT * FROM ', @table);
mysql> PREPARE stmt3 FROM @s;
http://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html
Context - Uber RCE via tempting (DSL)
Context - Imgur SSRF
Red team always win
https://youtu.be/lNIf2pAucq0
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
The Chain
Standing on
the Shoulders
of Giants
Mandating security
OS sandboxing
Seccomp (Secure Computing Mode)
• Sandboxing in Kernel
• Seccomp-BPF for sys calls
Setcap
• grant fine grained privilege to binary for non-sudo user
AppArmor
• Mandatory Access Control on processes
• Audit mode support
• Docker comes with AppArmor out of the box
https://youtu.be/-KAzChsSIlI
https://youtu.be/l9qKFwlXNic
Sample AppArmor profile for Docker
#include <tunables/global>
profile hardened flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
audit network,
audit capability,
audit file,
audit umount,
deny @{PROC}/{*,**^[0-9*],sys/kernel/shm*} wkx,
deny @{PROC}/sysrq-trigger rwklx,
deny @{PROC}/mem rwklx,
deny @{PROC}/kmem rwklx,
deny @{PROC}/kcore rwklx,
deny mount,
deny /sys/[^f]*/** wklx,
deny /sys/f[^s]*/** wklx,
deny /sys/fs/[^c]*/** wklx,
See: https://docs.docker.com/engine/security/apparmor/
Modern Web Security, Lazy but Mindful Like a Fox
Your printer
would not
initiate
outgoing
connections
https://youtu.be/pWeiZbF-Rfw
IPSet http://ipset.netfilter.org/
IPSet
• IPTables extension
• Set representations for
• multiple IPs or subnets
• can combine with ports, etc
• as bitmap or hash
https://youtu.be/HXTccEVw9NE
Risk
Management
“Consider a sequence of trials, where each trial has only
two possible outcomes, (designated failure and success).
The probability of success is assumed to be the same for
each trial. The distribution gives the probability that there
are zero failures before the first success, one failure before
the first success, two failures before the first success, and
so on…”
“the expected (mean) number of failures before the first
success is… ”
https://en.wikipedia.org/wiki/Geometric_distribution
Risk Likelihood
Do the Maths
Risk = Likelihood x Impact ?
Tuning the Risk
Risk Likelihood
Do the Maths
Tuning the Risk
Risk Likelihood
Do the Maths
Tuning the Risk
blackhat-day
t=7 t=69 t=693
Risk Likelihood
Do the Maths
Reality
Negative indicators
1. Bigger assets attract more skillful attackers
Positive indicators
1. Number of lateral movements required
2. Coverage
3. Speed to response
Tuning the Risk
Modern
Security
Defensive in Depth
Modern
Security
Response in Realtime
Defensive in Depth
Modern
Security
Mandating Practical
Security
Response in Realtime
Defensive in Depth
Modern Web Security, Lazy but Mindful Like a Fox
Derek Chamorro
Jason Fesler
Stuart Larsen
Kudos
Maze: https://www.flickr.com/photos/61287964@N00/5837800805 by John Smith
Maze: https://www.flickr.com/photos/wwworks/2786242106 by woodleywonderworks
Giant: https://www.flickr.com/photos/tuncaycoskun/15158934316 by Tuncay
Firing range: https://www.flickr.com/photos/bwjones/2285449364/ by Bryan Jones
Firewall: https://www.flickr.com/photos/ecastro/3352213726/ by Eric E Castro
The return of Boba Fett: https://www.flickr.com/photos/huguesndelafleche/7280224712 by Artamir78
Chains: https://www.flickr.com/photos/mecklenburg/11758871786 by Thomas Kohler
SELinux: https://www.flickr.com/photos/pchow98/9667426636 by pchow98
Hacked printer: https://www.flickr.com/photos/girlgeek/1877517607/ by Jennie
Risk: https://www.flickr.com/photos/jaredzimmerman/8212752926/ by Jared Zimmerman
Creative Commons
Thank you!
ALBERT YU • TRUST ENGINEERING • ATLASSIAN • @YUKINYING
Watch the video with slide synchronization on
InfoQ.com!
https://www.infoq.com/presentations/security-
defenses

More Related Content

PDF
Move fast and make things with microservices
PDF
PLNOG16: DDOS SOLUTIONS – CUSTOMER POINT OF VIEW, Piotr Wojciechowski
PPTX
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
PDF
Introduction of Cloudflare Solution for Mobile Payment
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
PDF
Building and Scaling a WebSockets Pubsub System
PPTX
Latest Trends in Web Application Security
PDF
Web Socket ASM support lior rotkovitch
Move fast and make things with microservices
PLNOG16: DDOS SOLUTIONS – CUSTOMER POINT OF VIEW, Piotr Wojciechowski
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Introduction of Cloudflare Solution for Mobile Payment
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Building and Scaling a WebSockets Pubsub System
Latest Trends in Web Application Security
Web Socket ASM support lior rotkovitch

What's hot (20)

PPTX
Content Delivery Network
PPTX
What’s New at Cloudflare: New Product Launches
PDF
Getting all the 99.99(9) you always wanted
PPTX
Scaling CometD by Kevin Nilson
PDF
Why Many Websites are still Insecure (and How to Fix Them)
PDF
New Products Overview: Use Cases and Demos
PPTX
Cloudflare Argo - Overview
PPTX
Filling the Gaps in Your DDoS Mitigation Strategy
PDF
Beginning Microservices with .NET & RabbitMQ
PDF
Narayana 5: The premier open source transaction manager
PPTX
F5's Dynamic DNS Services
PDF
How to Plan for Performance and Scale for Multiplayer Games
PPTX
Group18_Awesome4some:Proxy server.ppt
PDF
Messaging for IoT
PDF
Realtime Web Apps: WebSockets & WebRTC
PDF
65% Performance Gains at Cryptocurrency Platform CoinGecko: An Argo Smart Rou...
PDF
A vision for ejabberd - ejabberd SF Meetup
PPT
PPTX
How to Reduce Latency with Cloudflare Argo Smart Routing
PPT
BIG IP F5 GTM Presentation
Content Delivery Network
What’s New at Cloudflare: New Product Launches
Getting all the 99.99(9) you always wanted
Scaling CometD by Kevin Nilson
Why Many Websites are still Insecure (and How to Fix Them)
New Products Overview: Use Cases and Demos
Cloudflare Argo - Overview
Filling the Gaps in Your DDoS Mitigation Strategy
Beginning Microservices with .NET & RabbitMQ
Narayana 5: The premier open source transaction manager
F5's Dynamic DNS Services
How to Plan for Performance and Scale for Multiplayer Games
Group18_Awesome4some:Proxy server.ppt
Messaging for IoT
Realtime Web Apps: WebSockets & WebRTC
65% Performance Gains at Cryptocurrency Platform CoinGecko: An Argo Smart Rou...
A vision for ejabberd - ejabberd SF Meetup
How to Reduce Latency with Cloudflare Argo Smart Routing
BIG IP F5 GTM Presentation
Ad

Similar to Modern Web Security, Lazy but Mindful Like a Fox (20)

PDF
OSCP Preparation Guide @ Infosectrain
PPTX
News Bytes - May by corrupt
PDF
OWASP Portland - OWASP Top 10 For JavaScript Developers
PDF
Is your python application secure? - PyCon Canada - 2015-11-07
PPTX
PyCon Canada 2015 - Is your python application secure
PDF
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
PDF
Securing TodoMVC Using the Web Cryptography API
PDF
2018 - CertiFUNcation - Helmut Hummel: Hardening TYPO3
PDF
Profiling your Java Application
PDF
[xp2013] Narrow Down What to Test
PPTX
Owasp web application security trends
PPTX
[2.1] Web application Security Trends - Omar Ganiev
PPTX
2016 03 15_biological_databases_part4
PDF
Fix me if you can - DrupalCon prague
PDF
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
PPTX
JavaOne 2016 - Faces Counter
PPTX
Internet of things the salesforce lego machine cloud
PPTX
Stress Testing at Twitter: a tale of New Year Eves
PPTX
Splunk: Forward me the REST of those shells
PDF
Securing your EmberJS Application
OSCP Preparation Guide @ Infosectrain
News Bytes - May by corrupt
OWASP Portland - OWASP Top 10 For JavaScript Developers
Is your python application secure? - PyCon Canada - 2015-11-07
PyCon Canada 2015 - Is your python application secure
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
Securing TodoMVC Using the Web Cryptography API
2018 - CertiFUNcation - Helmut Hummel: Hardening TYPO3
Profiling your Java Application
[xp2013] Narrow Down What to Test
Owasp web application security trends
[2.1] Web application Security Trends - Omar Ganiev
2016 03 15_biological_databases_part4
Fix me if you can - DrupalCon prague
Defeating firefox by Muneaki Nishimunea - CODE BLUE 2015
JavaOne 2016 - Faces Counter
Internet of things the salesforce lego machine cloud
Stress Testing at Twitter: a tale of New Year Eves
Splunk: Forward me the REST of those shells
Securing your EmberJS Application
Ad

More from C4Media (20)

PDF
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
PDF
Next Generation Client APIs in Envoy Mobile
PDF
Software Teams and Teamwork Trends Report Q1 2020
PDF
Understand the Trade-offs Using Compilers for Java Applications
PDF
Kafka Needs No Keeper
PDF
High Performing Teams Act Like Owners
PDF
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
PDF
Service Meshes- The Ultimate Guide
PDF
Shifting Left with Cloud Native CI/CD
PDF
CI/CD for Machine Learning
PDF
Fault Tolerance at Speed
PDF
Architectures That Scale Deep - Regaining Control in Deep Systems
PDF
ML in the Browser: Interactive Experiences with Tensorflow.js
PDF
Build Your Own WebAssembly Compiler
PDF
User & Device Identity for Microservices @ Netflix Scale
PDF
Scaling Patterns for Netflix's Edge
PDF
Make Your Electron App Feel at Home Everywhere
PDF
The Talk You've Been Await-ing For
PDF
Future of Data Engineering
PDF
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Next Generation Client APIs in Envoy Mobile
Software Teams and Teamwork Trends Report Q1 2020
Understand the Trade-offs Using Compilers for Java Applications
Kafka Needs No Keeper
High Performing Teams Act Like Owners
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Service Meshes- The Ultimate Guide
Shifting Left with Cloud Native CI/CD
CI/CD for Machine Learning
Fault Tolerance at Speed
Architectures That Scale Deep - Regaining Control in Deep Systems
ML in the Browser: Interactive Experiences with Tensorflow.js
Build Your Own WebAssembly Compiler
User & Device Identity for Microservices @ Netflix Scale
Scaling Patterns for Netflix's Edge
Make Your Electron App Feel at Home Everywhere
The Talk You've Been Await-ing For
Future of Data Engineering
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
KodekX | Application Modernization Development
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Spectroscopy.pptx food analysis technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx
KodekX | Application Modernization Development
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The AUB Centre for AI in Media Proposal.docx
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectroscopy.pptx food analysis technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
MYSQL Presentation for SQL database connectivity

Modern Web Security, Lazy but Mindful Like a Fox