Don t Write Your Own Security Code The Enterprise Security API Project OWASP. The OWASP Foundation http://www.owasp.org



Similar documents
Enterprise Security API (ESAPI) Java Java User Group San Antonio. Jarret Raim June 3 rd, 2010

Building & Measuring Security in Web Applications. Fabio Cerullo Cycubix Limited 30 May Belfast

OWASP Enterprise Security API (ESAPI)

Points of View. CxO s point of view. Developer s point of view. Attacker s point of view

How We Implemented Security in Agile for 20 SCRUMs- and Lived to Tell

OpenSAMM Software Assurance Maturity Model

Automatic vs. Manual Code Analysis

Development. Resilient Software. Secure and. Mark S. Merkow Lakshmikanth Raghavan. CRC Press. Taylor& Francis Croup. Taylor St Francis Group,

DISA's Application Security and Development STIG: How OWASP Can Help You. AppSec DC November 12, The OWASP Foundation

XSS Lightsabre techniques. using Hackvertor

Still Aren't Doing. Frank Kim

Web Application Guidelines

Enterprise Application Security Workshop Series

General principles and architecture of Adlib and Adlib API. Petra Otten Manager Customer Support

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

Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Validation Procedure. ANNEX 4. Security Testing Basis

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

D. Best Practices D.1. Assurance The 5 th A

Web Development using PHP (WD_PHP) Duration 1.5 months

Hack-proof Your Drupal App. Key Habits of Secure Drupal Coding

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

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

Lecture 11 Web Application Security (part 1)

CrownPeak Playbook CrownPeak Hosting with PHP

NextRow - AEM Training Program Course Catalog

Adobe Systems Incorporated

elearning for Secure Application Development

Spring Security CAS Plugin - Reference Documentation. Burt Beckwith. Version M1

COURSE CONTENT FOR WINTER TRAINING ON Web Development using PHP & MySql

International Journal of Engineering Technology, Management and Applied Sciences. November 2014, Volume 2 Issue 6, ISSN

Pentesting Web Frameworks (preview of next year's SEC642 update)

Check list for web developers

SANS Dshield Webhoneypot Project. OWASP November 13th, The OWASP Foundation Jason Lam

Course Number: IAC-SOFT-WDAD Web Design and Application Development

THE OPEN UNIVERSITY OF TANZANIA

DTWMS Required Software Engineers. 1. Senior Java Programmer (3 Positions) Responsibilities:

CommonSpot Content Server Version 6.2 Release Notes

reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

Smart and Innovative Web Solutions. Just One Click Away

OWASP TOP 10 ILIA

Put a Firewall in Your JVM Securing Java Applications!

Specialized Programme on Web Application Development using Open Source Tools

alchemy webapp framework Introduction What is alchemy?

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Project 2: Web Security Pitfalls

Towards More Security in Data Exchange

Input Validation Vulnerabilities, Encoded Attack Vectors and Mitigations OWASP. The OWASP Foundation. Marco Morana & Scott Nusbaum

Certification Report

Oracle Identity Analytics Architecture. An Oracle White Paper July 2010

LDAPCON Sébastien Bahloul

A Strategic Approach to Web Application Security The importance of a secure software development lifecycle

Software Architecture for Paychex Out of Office Application

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

Getting Started Guide for Developing tibbr Apps

Mike Boyarski Jaspersoft Product Marketing Business Intelligence in the Cloud

Sitefinity Security and Best Practices

Top Ten Web Application Vulnerabilities in J2EE. Vincent Partington and Eelco Klaver Xebia

What is Web Security? Motivation

4 Understanding. Web Applications IN THIS CHAPTER. 4.1 Understand Web page development. 4.2 Understand Microsoft ASP.NET Web application development

Chapter 1 Web Application (In)security 1

Web Mapping in Archaeology

HP OO 10.X - SiteScope Monitoring Templates

CloudCERT (Testbed framework to exercise critical infrastructure protection)

Implementing Mobile Thin client Architecture For Enterprise Application

Web Application Security

MESSAGING SECURITY USING GLASSFISH AND OPEN MESSAGE QUEUE

Web 2.0 Technology Overview. Lecture 8 GSL Peru 2014

Enterprise Ajax Security with ICEfaces

Criteria for web application security check. Version

INTEGRATION GUIDE. DIGIPASS Authentication for Google Apps using IDENTIKEY Federation Server

Manage Website Template That Using Content Management System Joomla

CSCI110 Exercise 4: Database - MySQL

E-Commerce: Designing And Creating An Online Store

A Comparative Study of Web Development Technologies Using Open Source and Proprietary Software

Multiple vulnerabilities in Apache Foundation Struts 2 framework. Csaba Barta and László Tóth

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

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

The AppSec How-To: Achieving Security in DevOps

Web development... the server side (of the force)

JAVA/J2EE DEVELOPER RESUME

Table of contents. Jasig CAS support for the Spring Security plugin.

Oracle WebLogic Server 11g: Administration Essentials

Visual WebGui for ASP.NET Ajax (and other Ajax) Web Developers Learn what makes Visual WebGui not just another Ajax framework

Software development & technologies in Market Research industry

Sabre Red Apps. Developer Toolkit Overview. October 2014

Security Assessment of Waratek AppSecurity for Java. Executive Summary

Security at Scale: Effective approaches to web application

Alice. Software as a Service(SaaS) Delivery Platform. innovation is simplicity

QualysGuard WAS. Getting Started Guide Version 4.1. April 24, 2015

Building a Mobile App Security Risk Management Program. Copyright 2012, Security Risk Advisors, Inc. All Rights Reserved

Transcription:

Don t Write Your Own Security Code The Enterprise Security API Project Jeff Williams Aspect Security CEO Volunteer Chair of jeff.williams@aspectsecurity.com modified by app@iki.fi Copyright 2009 - The Foundation This work is available under the Creative Commons SA 3.0 license The Foundation http://www.owasp.org

2

The Challenge Cryptix Struts Commons Validator xml-dsig JCE Reform Spring xml-enc ACEGI HDIV Jasypt Log4j JAAS Stinger BouncyCastle Anti-XSS Many More Java Logging 3 3

Philosophy Using security controls is different from building All the security guidelines, courses, tutorials, websites, books, etc are all mixed up because everyone builds their own controls Most developers shouldn t build security controls When to use a control How to use a control Why to use a control (maybe) Most enterprises need the same set of calls 4 4

Design Only include methods that Are widely useful and focus on the most risky areas Designed to be simple to understand and use Interfaces with concrete reference implementation Full documentation and usage examples Same basic API across common platforms Java EE,.NET, PHP, others? Useful to Rich Internet Applications? 5 5

Architecture Overview Custom Enterprise Web Application Enterprise Security API Authenticator User AccessController AccessReferenceMap Validator Encoder HTTPUtilities Encryptor EncryptedProperties Randomizer Exception Handling Logger IntrusionDetector SecurityConfiguration Existing Enterprise Security Services/Libraries 6 6

Create Your ESAPI Implementation Your Security Services Wrap your existing libraries and services Extend and customize your ESAPI implementation Fill in gaps with the reference implementation Your Coding Guideline Tailor the ESAPI coding guidelines Retrofit ESAPI patterns to existing code 7 7

Frameworks and ESAPI ESAPI is NOT a framework Just a collection of security functions, not lock in Frameworks already have some security Controls are frequently missing, incomplete, or wrong ESAPI Framework Integration Project We ll share best practices for integrating Hopefully, framework teams like Struts adopt ESAPI 8 8

Vulnerabilities and Security Controls 9

Web Escaping and Encoding < Percent Encoding %3c %3C HTML Entity Encoding &#60 &#060 &#0060 &#00060 &#000060 &#0000060 < < < < < < &#x3c &#x03c &#x003c &#x0003c &#x00003c &#x000003c < < < < < < &#X3c &#X03c &#X003c &#X0003c &#X00003c &#X000003c < < < < < < &#x3c &#x03c &#x003c &#x0003c &#x00003c &#x000003c < < < < < < &#X3C &#X03C &#X003C &#X0003C &#X00003C &#X000003C < < < < < < &lt &lt &Lt &LT < &lt; &Lt; &LT; JavaScript Escape \< \x3c \X3c \u003c \U003c \x3c \X3C \u003c \U003C CSS Escape \3c \03c \003c \0003c \00003c \3C \03C \003C \0003C \00003C Overlong UTF-8 %c0%bc %e0%80%bc %f0%80%80%bc %f8%80%80%80%bc %fc%80%80%80%80%bc US-ASCII ¼ UTF-7 +ADw- Punycode <- Simple Double Encoding < --> < --> &#26;lt&#59 (double entity) < --> %3c --> %253c (double percent) etc... Double Encoding with Multiple Schemes < --> < --> %26lt%3b (first entity, then percent) < --> %26 --> &#25;26 (first percent, then entity) etc... Simple Nested Escaping < --> %3c --> %%33%63 (nested encode percent both nibbles) < --> %3c --> %%33c (nested encode first nibble percent) < --> %3c --> %3%63 (nested encode second nibble percent) < --> < --> &&108;t; (nested encode l with entity) etc... Nested Escaping with Multiple Schemes < --> < --> &%6ct; (nested encode l with percent) < --> %3c --> %3c (nested encode 3 with entity) etc... 1,677,721,600,000,000 ways to encode <script> 1 10 0

1. ESAPI Input Validation Validate: getvaliddate() getvalidcreditcard() getvalidsafehtml() getvalidinput() getvalidnumber() getvalidfilename() getvalidredirect() safereadline() Validation Engine Decoding Engine Codecs: HTML Entity Encoding Percent Encoding JavaScript Encoding VBScript Encoding CSS Encoding MySQL Encoding Oracle Encoding LDAP Encoding Any Encoding Any Interpreter User Controller Business Functions Data Layer Backend Presentation Layer 11

HTML Execution Contexts \any \xhh \uhhhh \000 (octal) CSS \specials \xhh \uhhhh JavaScript HTML Elements HTML Attributes Event Handlers &#DD &#xhh &entity; " &apos; &#DD &#xhh URI Attributes " &apos; \specials \xhh \uhhhh %HH 12

ESAPI Swingset http://www.owasp.org/index.php?title=xss_prevention 13

2. ESAPI Output Encoding User Controller Business Functions Data Layer Backend Presentation Layer Encode: Encoding Engine setcharacterencoding() encodeforhtml() encodeforhtmlattribute() encodeforjavascript() encodeforvbscript() encodeforcss() encodeforurl() encodeforxml() encodeforldap() encodefordn() 14

Applications Enjoy Attacks Live Search YouTube Blogger 15

3. Errors, Logging, and Detection User Controller Business Functions Data Layer Backend Presentation Layer throw new ValidationException( User message, Log message ); Enterprise Security Exceptions Logger Intrusion Detector Configurable Thresholds Responses Log Intrusion Logout User Disable Account 16

ESAPI Book! http://www.owasp.org/images/7/79/esapi_book.pdf 17

Closing Thoughts I am learning an amazing amount (I thought I knew) An ESAPI is a key part of a balanced breakfast Build rqmts, guidelines, training, tools around your ESAPI Secondary benefits May help static analysis do better Enables security upgrades across applications Simplifies developer training Next year experiences moving to ESAPI 18 18

Questions and Answers Rollout strategy? Integrating existing security libraries? Technical questions? Contact Information: Jeff Williams jeff.williams@aspectsecurity.com Work: 410-707-1487 Main: 301-604-4882 19