breaking is easy, preventing is hard - owasp …...• bug tracking: security issues grouped...

48
©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Breaking is easy, Preventing is hard Secure in 2010? Broken in 2011! Matias Madou, Ph.D. Principal Security Researcher

Upload: others

Post on 13-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

©2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice

Breaking is easy, Preventing is hard Secure in 2010? Broken in 2011!

Matias Madou, Ph.D.

Principal Security Researcher

Page 2: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Matias Madou

• Principal Security Researcher, HP Enterprise Security (formerly Fortify)

– Static Analysis: Standard rules + Customization

– Insider Threat Research

– Hybrid: Static and Dynamic result correlation

– Gray-box analysis (HP WebInspect + Fortify SecurityScope)

• Presentations @ DefCon, BlackHat, RSA Conference, …

• Contributor to Building Security in Maturity Model (BSIMM) Europe

• History in code obfuscation (and binary rewriting)

Page 3: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Introduction

• The Test Application: Secure in 2010

• What’s new in 2011?

– New vulnerabilities

– New analysis techniques

• Continues Testing

Overview

3

Page 4: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

History of the experiment: Gather empirical results while developing

gray-box analysis.

Test Application, criteria:

• Extensively used

• Undergone security improvements

Introduction

4

Page 5: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Selection criteria for the project working on:

– Open source, java or .NET

– Widely used

• Apache 10.04

The Test Application

5

Page 6: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• End Users:

– 1-800-Flowers

– Olympus.de

– United.com

– BT.com

– …

The Test Application

6

Page 7: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Products and Projects based on Apache OFBiz:

– OpenTaps

The Test Application

7

Page 8: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Security?

– Multiple vulnerabilities found in CVE

– Other (Exploit Search)

– … and an interesting video on how to become an admin by exploiting a XSS

The Test Application

8

Page 9: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

The Test Application

9

Page 10: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

The Test Application

10

Page 11: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

The Test Application

11

Page 12: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Bug Tracking: Security Issues grouped together

The Test Application

12

Page 13: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• In the end: All known issues are fixed in Apache OFBiz 10.04

The Test Application

Secure in 2010!

13

Page 14: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

1) New vulnerabilities:

Denial-of-service:

Parse Double

2) Analysis techniques:

Gray box analysis

So… what’s new in 2011?

14

Page 15: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

1) New vulnerabilities:

Denial-of-service:

Parse Double

2) Analysis techniques:

Gray box analysis

So… what’s new in 2011?

15

Page 16: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

CVE-2010-4476 (Feb 1, 2010)

• Value:

• API:

Infinite loop!

Fixed: Feb 8, 2011

Denial-of-Service: Parse Double

2.2250738585072012e-308

Double.parseDouble(value)

16

Page 17: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Feb 01, 2011? No, no. March 04, 2001!

• Why is this fixed within 1 month after the rediscover?

Denial-of-Service: Parse Double

17

Page 18: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Examples:

• Application:

• Usage:

Big trouble!

Denial-of-Service: Parse Double

http://blog.fortify.com/blog/2011/02/08/Double-Trouble

Apache Tomcat

Tomcat uses parseDouble() on the value of the Accept-Language HTTP header when an application calls request.getLocale()

18

Page 19: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

How many issues in Apache OFBiz?

Used analysis techniques:

• Static Analysis (White Box)

• Penetration Testing (Black Box)

Denial-of-Service: Parse Double

19

Page 20: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Static Analysis (White Box)

Denial-of-Service: Parse Double

20

Page 21: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Penetration Testing (Black Box):

Denial-of-Service: Parse Double

http://yourofbiz.com/ecommerce/control/modifycart (update_0, update_1, …) http://yourofbiz.com/ecommerce/control/additem/showcart (quantity, add_product_id) http://yourofbiz.com/ecommerce/control/additem/quickadd (quantity) http://yourofbiz.com/ecommerce/control/additem/keywordsearch (quantity) http://yourofbiz.com/ecommerce/control/additem/advancedsearch (quantity) http://yourofbiz.com/ecommerce/control/additem/showPromotionDetails (quantity) http://yourofbiz.com/ecommerce/control/additem/product (quantity,add_amount) http://yourofbiz.com/ecommerce/control/additem/lastViewedProduct (update_0) http://yourofbiz.com/ecommerce/control/additem/showForum (quantity) http://yourofbiz.com/ecommerce/control/additem/category (quantity) http://yourofbiz.com/ecommerce/control/additem/main (quantity) http://yourofbiz.com/ecommerce/control/additem (quantity) http://yourofbiz.com/ecommerce/control/additem/setDesiredAlternateGwpProductID (…) …

21

Page 22: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

What is the problem?

• Root case is a Java problem, not an application problem!

• Everybody uses the fixed java version, right? (Version Java 6 Update

24 or later)

Because of lack of updating java, Apache tomcat installed additional

checking. (Tomcat 7.0.8, 6.0.32, 5.5.33 or later)

Denial-of-Service: Parse Double

22

Page 23: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

1) New vulnerabilities:

Denial-of-service:

Parse Double

2) Analysis techniques:

Gray box analysis

So… what’s new in 2011?

23

Page 24: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Well… what is black-box analysis?

–Can see that something is truly wrong

–No inside information

What is Gray-Box Analysis

24

Page 25: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Black-box Testing (Penetration Testing)

Penetration testing

Application

25

http://www.testapp.com/index.html?q=a’or+1=1--

App crashes…

Page 26: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Get inside information

• Easier to find out what’s wrong and where exactly so

easier to fix

What is Gray-Box Analysis

26

Page 27: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Application

Gray-box analysis: Integrated Analysis

Penetration testing

Application

Monitoring agent Real-time link

• Find More

• Fix Faster

27

Page 28: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Detect new types of vulnerabilities

– Privacy violation, Log Forging

• Find more of all kinds of vulnerabilities

– Automatic attack surface identification

– Understand effects of attacks

Find More

28

Page 29: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Attack surface identification

/login.jsp

/pages/account.jsp

/pages/balance.jsp

/backdoor.jsp

• File system • Configuration-driven • Programmatic

29

Page 30: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Attack surface identification: Apache Ofbiz

30

Black-box

Gray-box

Page 31: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Understand effects of attacks

/backdoor.jsp

Command Injection

sysadmin$./sh

31

Page 32: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Provide Actionable Details

–Stack trace

–Line of code

• Group Symptoms with a Common Cause

Fix Faster

32

Page 33: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Actionable Details

/login.jsp

33

Page 34: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Fix Faster: Actionable details

34

Page 35: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Fix Faster: Actionable details

35

Page 36: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Group Symptoms with a common cause

• Counting issues seems to be hard!

/login.jsp /pages/account.jsp /pages/balance.jsp

1 Cross-Site Scripting Symptom 2 Cross-Site Scripting Symptoms 3 vulnerabilities from the attackers perspective

1 vulnerability from the developers perspective

36

Page 37: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Fix Faster: Group symptoms

37

Page 38: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Detailed information on where

to fix the issue

Group symptoms: details

38

Page 39: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Applications found secure in 2010

Broken in 2011 because:

1) New vulnerabilities:

Denial-of-service:

Parse Double

2) Analysis techniques:

Gray box analysis

How to prevent?

Wrap-up

39

Page 40: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

40

Typical security throughout the SDLC

• How about security testing in production?

Page 41: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Seen in the field: adding the pattern to WAF

• Problems:

1. Does not protect against persistent

2. Are you sure your patterns cover everything?

Pattern often used:

2.2250738585072012e-308

How about:

0.22250738585072012e-307

Pen testers find something, rely on WAF

41

Page 42: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Seen in the field: adding the pattern to WAF

• Problems:

2. Are you sure your patterns cover everything?

Denial-of-Service: Parse Double

42

Page 43: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

Took a released application

• hit it with new analysis technique

• Search for vulnerabilities that were not known at the release day

43

So… what did we do?

Page 44: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

44

Solution to keep it protected

• How about the application in production?

Page 45: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Even if there are no code changes at all: keep scanning with updated

security knowledge

• This way, you’ll find new ways of breaking your application

Solution to keep it protected

45

Page 46: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• It’s still open source, so you can DIY

(found in the bug databse)

Solution to fix Apache Ofbiz?

46

Page 47: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

• Run the Java 6 Update 24 or later (no DoS: Parse Double issues)

• XSS issues reported in CVE-2012-1621:

Upgrade from version 10.04 to 10.04.02

Solution to fix Apache Ofbiz?

47

Page 48: Breaking is easy, Preventing is hard - OWASP …...• Bug Tracking: Security Issues grouped together The Test Application 12 • In the end: All known issues are fixed in Apache OFBiz

THANK YOU!

QUESTIONS?

Matias Madou, [email protected] https://www.surveymonkey.com/s/Research12_MatiasMadou