Web Application and API Security The Latest Trends and Threats. 03/19/15 Sean Leach



Similar documents
Web-Application Security

Sitefinity Security and Best Practices

Check list for web developers

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Criteria for web application security check. Version

Where every interaction matters.

Recent Advances in Web Application Security

Web Application Guidelines

ASP.NET MVC Secure Coding 4-Day hands on Course. Course Syllabus

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

SSL BEST PRACTICES OVERVIEW

Hack Proof Your Webapps

Security starts in the head(er)

Enterprise Application Security Workshop Series

HTML5. Eoin Keary CTO BCC Risk Advisory.

Secure development and the SDLC. Presented By Jerry

Web application security

Gateway Apps - Security Summary SECURITY SUMMARY

Hacking Web Apps. Detecting and Preventing Web Application Security Problems. Jorge Blanco Alcover. Mike Shema. Technical Editor SYNGRESS

STOPPING LAYER 7 ATTACKS with F5 ASM. Sven Müller Security Solution Architect

Data Breaches and Web Servers: The Giant Sucking Sound

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Web Application Security

Thomas Röthlisberger IT Security Analyst

Contemporary Web Application Attacks. Ivan Pang Senior Consultant Edvance Limited

Next Generation Clickjacking

OAuth: Where are we going?

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

(WAPT) Web Application Penetration Testing

Intrusion detection for web applications

Cloud Security Through Threat Modeling. Robert M. Zigweid Director of Services for IOActive

Relax Everybody: HTML5 Is Securer Than You Think

Web Application Security

Hack Yourself First. Troy troyhunt.com

Secure Coding in Node.js

Magento Security and Vulnerabilities. Roman Stepanov

Architectural Design Patterns. Design and Use Cases for OWASP. Wei Zhang & Marco Morana OWASP Cincinnati, U.S.A.

Real World Java Web Security

Securing the SSL/TLS channel against man-in-the-middle attacks: Future technologies - HTTP Strict Transport Security and Pinning of Certs

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Sichere Webanwendungen mit Java

Protecting Web Applications and Users

The Top Web Application Attacks: Are you vulnerable?

What is Web Security? Motivation

SSL and Browsers: The Pillars of Broken Security

Using PHPIDS to Understand Attacks

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Cloud Security Framework (CSF): Gap Analysis & Roadmap

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

REAL-TIME WEB APPLICATION PROTECTION. AWF SERIES DATASHEET WEB APPLICATION FIREWALL

Bypassing Web Application Firewalls (WAFs) Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

JVA-122. Secure Java Web Development

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Conducting Web Application Pentests. From Scoping to Report For Education Purposes Only

Security features of ZK Framework

Cloud Security Framework (CSF): Gap Analysis & Roadmap

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Ruby on Rails Secure Coding Recommendations

APPLICATION SECURITY AND ITS IMPORTANCE

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

Client vs. Server Implementations of Mitigating XSS Security Threats on Web Applications

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

HTTPParameter Pollution. ChrysostomosDaniel

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

Breaking the Myths of Extended Validation SSL Certificates

Adobe Systems Incorporated

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

Hacking de aplicaciones Web

Weird New Tricks for Browser Fingerprinting. yan ToorCon 2015

Still Aren't Doing. Frank Kim

Web Application Security Assessment and Vulnerability Mitigation Tests

OWASP AND APPLICATION SECURITY

Cloud Security:Threats & Mitgations

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

WEB APPLICATION FIREWALLS: DO WE NEED THEM?

Preparing for the Cross Site Request Forgery Defense

Web Application Attacks And WAF Evasion

Arrow ECS University 2015 Radware Hybrid Cloud WAF Service. 9 Ottobre 2015

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

JOOMLA SECURITY. ireland website design. by Oliver Hummel. ADDRESS Unit 12D, Six Cross Roads Business Park, Waterford City

AppSec USA 2014 Denver, Colorado Security Header Injection Module (SHIM)

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Project 2: Web Security Pitfalls

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Kentico CMS security facts

5 Mistakes to Avoid on Your Drupal Website

How To Protect A Web Application From Attack From A Trusted Environment

Client logo placeholder XXX REPORT. Page 1 of 37

Protecting Your Organisation from Targeted Cyber Intrusion

elearning for Secure Application Development

Web Application Security. Radovan Gibala Senior Field Systems Engineer F5 Networks

Network Security Exercise #8

APIs The Next Hacker Target Or a Business and Security Opportunity?

Transcription:

Web Application and API Security The Latest Trends and Threats 03/19/15 Sean Leach

Who am I? Sean Leach Vice President, Product and Chief Security Officer - Fastly >>> len("vice President, Product and Chief Security Officer") 50 Previously VP, Technology Verisign CTO, Name.com Sr. Director, Technology UltraDNS then Neustar bought us

Who is Fastly?

We love open source - free CDN

Who is Fastly? Real time config/purge Can cache content you never could before Event driven content All SSD cache servers 768 GB of RAM Varnish based Custom SSD filesystem Lots of perf. tweaks Amazing support

Web App. Security FASTLY

Web App. Sec. Trends and Threats Modern web applications are real time, complex, and layered Less focus on desktop applications in favor of the web Convergence towards web APIs - REST, microservices Mobile apps and web apps sharing backend APIs/services Web attacks now affecting not just web users, but your mobile apps & other integrators of your services OWASP Top 10 - https://www.owasp.org/index.php/top_10_2013 Some very consistent entries between years SQLi, XSS, CSRF, etc The same threats have plagued web applications for years

Cross Site Scripting - XSS Modern web applications are dynamic Boundary between data and code is permeable Data ends up in DOM via string manipulation Elements created on the fly Attributes populated with user data Echoed into variables in script blocks Persistent XSS - present in server response, not request - stored in DB Reflected XSS - present in client request and rendered response - per req. Impact not limited to alert( You have XSS ); BEEF toolkit is a great example of post-exploitation functionality Same origin bypassed Session hijacking frequently possible

XSS - Fixes Ideally solved at the framework level Good templating languages are safe by default E.g. Jinja2 autoescapes template content Good frameworks provide safe sanitization helpers E.g. AngularJS ngsanitize s $sanitize Don t try to blacklist characters/strings. You will fail. Whitelisting is much easier/reliable Understand the context the output will be placed OWASP XSS Prevention Rules - http://goo.gl/vm4yqg Use modern JS best practices! Avoid eval() - Use JSON.parse Avoid inline <script> blocks Don t use JSONP - Use CORS Jinja2 security.py testsuite https://github.com/mitsuhiko/jinja2/

XSS - WAF Consider a Web Application Firewall (WAF) Best viewed as defense in depth Stopgap - Not a full solution (Fix your apps!) Fastly customers have built anti-xss WAF rules with Varnish Config Language (VCL)

XSS - CSP is Awesome! Content Security Policy (CSP) Have the browser enforce your best practices! Limit your exposure based on what you know your app does/needs Extra header sent from your server to supporting browsers Whitelist script sources (Google Analytics, JQuery, etc) Turn off eval entirely, inline scripts entirely report-uri lets you get back data on CSP failures/blocks Generate your own policy! http://cspisawesome.com/

XSS - CSP is Awesome!

Cross Site Request Forgery - CSRF Cookies are passed with all requests to origin that they are scoped for This happens regardless of whether the requests were user initiated This happens regardless of what the request is for! Very easy to initiate HTTP requests from a user s browser Have them visit a page with IMG tags, CSS tags, other src elements CSRF = Causing authenticated requests across-sites by abusing cookie stickyness to requests <img src= http://target.com/app/logoff.php /> on attacker page Request generated to target.com User has a cookie for target.com, it goes along for the ride User is logged out : ( Not limited to GET - can POST from attacker JS to diff origin if you don t need to view the response

CSRF Example

CSRF - Fixes Require additional request authentication above & beyond cookie Generate a token/nonce, store server side, embed in client forms Mandate requests include a valid nonce Attacker can t known nonce apriori to put in CSRF request Again, ideally solved at framework level! ASP.NET MVC - HTMLHelper.AntiForgeryToken If not built-in, offered as a plugin (e.g. flask-csrf) CSRF tokens can be a pain with caching There are strategies to help! [1] [1] http://www.fastly.com/blog/caching-the-uncacheable-csrf-security/

CSRF - First Party Cookies Standards track IETF draft - Mike West @ Google Proposes a CSRF Mitigation built into browsers Lets servers declare some cookies First party only Request for https://fastly.com/logout when https://fastly.com is in the browser URL bar -> First party request! Request for https://fastly.com/logout when https://attacker.com/sketch is the in the browser URL bar -> 3rd party request! Prevents the ambient authority of a session cookie from being sent in a cross-site request vs a first-party request. No browser support yet, but one day!

SQL Injection - SQLi Again abusing conflation of data and code Boundaries between languages/systems String concatenation the root of all evil Particularly insidious effects: password hash dumps filesystem access pivoting to full DB server compromise What if userid is 99 ; DROP DATABASE users? Classic SQLi vs BlindSQLi Amount of feedback given to attacker Blind SQLi typically creates an oracle with delays/sleeps id=1' waitfor delay '00:00:10'-- (If it takes 10 seconds, it worked)

SQLi - Fixes Fix at the Object Relational Mapping (ORM) level Don t write SQL queries at all! Use a safe ORM :-) Fix at the statement level Use parameterized queries Don t use string concatenation/string formatting to make queries! Escaping as a last resort Its very hard to get right Right can vary database vendor to database vendor Practice principle of least privilege Does your app s DB user need drop table perms? Does your app s DB user need INFILE/OUTFILE?

SQLi - WAF Consider a Web Application Firewall (WAF) Like with XSS, best viewed as defense in depth Stopgap - Not a full solution (Fix your apps!) Fastly customers have built anti-sqli WAF rules with Varnish Config Language (VCL)

Distributed Denial of Service - DDOS Supply vs Demand where Demand > Supply How do you isolate real demand from an attacker? Distributed, so no one source point to block Attacker wants traffic amplification for greater success Send as few bytes as possible Amplify to as many bytes as possible Typically abuse other services (DNS, NTP) to achieve this A problem of pattern identification Identifying pattern of attacker behaviour/traffic Dropping anything that matches on the floor

Happy Server Pong

DDOS d Server Pong

DDOS Example - BroBot Targeted at Banks Compromised Shared Hosting Accounts Millions of GET and POST s per second Couldn t be spoofed (not running as root) 200 300 Gbps

Where do they come from?

DDOS - Fixes Fastly customers are strictly HTTP(S). We absorb all lower layer/non-http traffic at our edge Fastly customers know who is expected to talk to their origins - Fastly! An API endpoint exists to get up-to-date IP lists for our POP servers Block all other source IPs at the origin Application level DDOS (random URL parameters, bogus API calls) are a little trickier Identify the pattern, use VCL to serve synthetic response/drop traffic Sometimes very easy! if (req.url ~ cachebust ) { }

Clickjacking ~Analogous to CSRF at the presentation layer Attacker super imposes a fake UI on top of embedded copy of targeted page/ui Click the weasle game over top of the Transfer $1000 to Sean bank transfer website interface. Target site is typically iframed invisibly & moved under the user s cursor as they click User doesn t know clicks are Falling through to the target website

Clickjacking - Fixes Use CSP! CSP is awesome! The frame-src knobs allow you to control how your page can be framed Use the X-Frame-Options header Older browser supported header for X frame controls Can forbid framing entirely, limit to some domains Easy to serve either header from the edge with a CDN that has VCL support (like Fastly!)

Web PKI/TLS Trends FASTLY

Problem? Too many CA s!!! 50 different root certs in browsers Many, many, many more intermediates How can you tell the right CA issued the right certificate? How do we solve this?

I m not a cryptographer!

TLS for Microservices Moving from monolithic apps to microservices involves more communication/rpc Increased need for confidentiality between services Increased need for authentication between services Ideally we want mutual authentication! Service<->Client TLS is the best hammer we have for this nail Lots of refinement over the past few years Add-ons and features to strengthen TLS PKI With Microservices, typically control both the consumer and producer side Great fit for many of the TLS/PKI addons

SPKI Pinning & HPKP SPKI - Subject Public Key Identifier Client side technique Pre-program knowledge of expected TLS public keys HPKP - Public Key Pinning for HTTP (PKPH doesn t have a good ring ) A header for pinning! Helps address the too many CAs problem Specify the public key for the CA(s) you actually use!

HSTS - TLS Strict Mode HTTP Strict Transport Security Strict mode for TLS/HTTPS Browser enforces HTTPS usage, rewrites HTTP to HTTPS Addresses TLS stripping attacks Cert warnings are hard failure - no click through Enabled by Strict-Transport-Security header (TOFU) o Must be delivered over HTTPS, with no cert errors o Has an expiry o Policy may optionally apply to all subdomains Supported by Chrome/Firefox/Safari/Opera, and soon IE! o See chrome://net-internals/#hsts

Certificate Transparency Public record of all certs issued by all participating CAs append only, cryptographically verified (merkle tree!) CA gets back a proof of submission (SCT) Proof can get relayed to client 3rd parties can audit log to watch for certs being issued 3rd parties can audit log itself to ensure its playing fairly Chrome moving towards requiring CT for all EV certs One day, all certs must have CT proof http://www.certificate-transparency.org/

DANE DNS-based Authentication of Named Entities Bind x509 certificates to DNS names using DNSSEC Can store signature or content of certificate in DNS But requires DNSSEC (and nobody supports it yet)

From: http://www.slideshare.net/deploy360/8-danehardaker

We are like totally hiring FASTLY fastly.com/about/careers