Web-Application Security



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

The Top Web Application Attacks: Are you vulnerable?

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

Hack Proof Your Webapps

(WAPT) Web Application Penetration Testing

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

What is Web Security? Motivation

Security features of ZK Framework

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

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

Finding and Preventing Cross- Site Request Forgery. Tom Gallagher Security Test Lead, Microsoft

Check list for web developers

Cross-Site Scripting

Magento Security and Vulnerabilities. Roman Stepanov

Web application security

A Tale of the Weaknesses of Current Client-Side XSS Filtering

elearning for Secure Application Development

Preparing for the Cross Site Request Forgery Defense

Complete Cross-site Scripting Walkthrough

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

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

HTTPParameter Pollution. ChrysostomosDaniel

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

Enterprise Application Security Workshop Series

Network Security Web Security

Where every interaction matters.

Gateway Apps - Security Summary SECURITY SUMMARY

Chapter 1 Web Application (In)security 1

Criteria for web application security check. Version

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

Network Security Exercise #8

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

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Summary of the SEED Labs For Authors and Publishers

Understanding Web Application Security Issues

Attacks on Clients: Dynamic Content & XSS

Web Application Security Assessment and Vulnerability Mitigation Tests

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

Last update: February 23, 2004

Web Application Worms & Browser Insecurity

Cross Site Scripting Prevention

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Thomas Röthlisberger IT Security Analyst

Web Application Security

Web Application Vulnerability Testing with Nessus

Application security testing: Protecting your application and data

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

Web and Security 1 / 40

Still Aren't Doing. Frank Kim

Intrusion detection for web applications

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

Blackbox Reversing of XSS Filters

Introduction to Computer Security

Java Web Application Security

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

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Data Breaches and Web Servers: The Giant Sucking Sound

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Sitefinity Security and Best Practices

Ruby on Rails Secure Coding Recommendations

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

Web Application Guidelines

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

Security Testing with Selenium

Analysis of Browser Defenses against XSS Attack Vectors

Project 2: Web Security Pitfalls

WEB SECURITY. Oriana Kondakciu Software Engineering 4C03 Project

Security Research Advisory IBM inotes 9 Active Content Filtering Bypass

Essential IT Security Testing

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

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

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

Recommended Practice Case Study: Cross-Site Scripting. February 2007

Exploits: XSS, SQLI, Buffer Overflow

DNS REBINDING DENIS BARANOV, POSITIVE TECHNOLOGIES

CS5008: Internet Computing

Sichere Software- Entwicklung für Java Entwickler

The Dark Side of Ajax. Jacob West Fortify Software

Hacking de aplicaciones Web

Web Application Security Considerations

Document Structure Integrity: A Robust Basis for Cross-Site Scripting Defense

Next Generation Clickjacking

Web Security. Crypto (SSL) Client security Server security 2 / 40. Web Security. SSL Recent Changes in TLS. Protecting the Client.


Web Application Penetration Testing

IJMIE Volume 2, Issue 9 ISSN:

Adobe Systems Incorporated

Secure development and the SDLC. Presented By Jerry

Web Application Security Bootcamp. Christian Wenz

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

NoSQL, But Even Less Security Bryan Sullivan, Senior Security Researcher, Adobe Secure Software Engineering Team

Course Content: Session 1. Ethics & Hacking

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

Cross Site Scripting in Joomla Acajoom Component

Advanced Security for Systems Engineering VO 01: Web Application Security

SECURITY ADVISORY. December 2008 Barracuda Load Balancer admin login Cross-site Scripting

Webapps Vulnerability Report

Rational AppScan & Ounce Products

Transcription:

Web-Application Security Kristian Beilke Arbeitsgruppe Sichere Identität Fachbereich Mathematik und Informatik Freie Universität Berlin 29. Juni 2011

Overview Web Applications SQL Injection XSS Bad Practice DNS Rebinding

Web applications applications that are accessed over a network software, hosted in a browser controlled environment, relying on browser to execute it cross-platform, no native install webmail, wikis, google docs difference to client-server

History JavaScript (Netscape, 1995) client-side scripting Flash (Macromedia, 1996) web application in Java (Servlet Specification, 1999) Ajax (2005) todays cross-platfom approach, browser embedding internet operating systems (ChromeOS)

Structure and Development the browser-server seperation naturally leads to an tiered architecture presentation, application, storage dumb client + smart server vs. smart client + dumb server web application frameworks (MVC) database access, templates, session management CMS

Drawbacks browser dependence connection dependence supplier/vendor dependence

Attack vectors SQL Injection XSS, CSRF, Response Splitting Magic URLs, Predictable Cookies, Hidden Form Fields DNS Rebinding

Overview Web Applications SQL Injection XSS Bad Practice DNS Rebinding

SQL Injection can lead to machine compromise, disclosure of sensitive data, spreading of malware most common form: attacker controlled string is used to create a SQL query or as parameter of a stored procedure results from lack of filtering/masking of untyped input

SQL Injection SqlCommand cmd = new SqlCommand( "SELECT ccnum FROM cust WHERE id = " + id + " ;"); CREATE PROCEDURE dbo.doquery(@id nchar(128)) AS DECLARE @query nchar(256) SELECT @query = select ccnum from cust where id = + @id + EXEC @query RETURN

Attack 1 OR 1=1 2<3 SqlCommand cmd = new SqlCommand( "SELECT ccnum FROM cust WHERE id = " + id + " ;");

Little Bobby Tables

Example 2008 thousands of computers running SQL Server and IIS compromised through a bug in a custom ASP script obfuscated SQL injection to add a malicous and obfuscated JavaScript file serverd by the webserver in an iframe to all clients the script installed malware on the clients

Blind SQL Injection application is vulnerable, but results are not visible page does not show data but will display differently depending on result of a query effectively a one bit channel, time consuming attack automated with tools SELECT a FROM b WHERE Id = OOk14cd AND 1 = 1 ; SELECT a FROM b WHERE Id = OOk14cd AND 1 = 2 ;

Countermeasures don t use string concat or string replacement prepared statements/parameterized queries validate input limit database access (only stored procedures and views) web application firewalls, IDS

Overview Web Applications SQL Injection XSS Bad Practice DNS Rebinding

Cross Site Scripting most common bug nowadays, thanks to increasing amount of web applications without security exploitable basically with just a browser attacker is able to inject client-side script into web pages can lead to bypass of same origin policy, stealing of cookies, or manipulation of the web site (all data the browser has access to) XSS worms not a bug in the web server but a bug in the web page rendered by the server

Types DOM-based XXS, local or type 0 Reflected XSS, nonpersistent or type 1 Stored XSS, persistent or type 2 HTTP response splitting Cross-site request forgery (XSRF, CSRF)

DOM-Based XSS web-based gadgets, widgets make these bugs more common attack depend solely on an insecurely written HTML page on an users computer bug in the content processing on the client gadgets is a mini applicatoin built using web technologies (HTML, JavaScript, XML) mobile code that runs on a desktop or browser with access to system resources gadgets can render untrusted input that might contain code

DOM-Based XSS

Reflected XSS most common form data provided by the web client (i.e. HTTP query parameter or HTML form submissions) is used directly by server-side scripts to generate a page of results without sanitizing the request markup injection (JavaScript, iframe,...) user clicks on link to vulnerable web app containing malicous code, code is reflected back and executed in his browser

Reflected XSS

Reflected XSS malicous code runs in context of the vulnerable domain has access to domain cookies, DOM famous sample code: <script>alert("xss");</script>

Stored XSS similar to type 1 but web server persists the input, which is later served up to victims blogs, forums, comments (accept arbitrary input from users and echo it back to all visitors) more dangerous, since no social engineering is required in the context of social networking sites this code can be designed to self propagate

Persistent XSS

HTTP Response Splitting instead of manipulating the HTML body, the header is attacked just as powerful and versatile as regular XSS attacks in HTTP (RFC 2616) Headers are separated by one CRLF failure to sanitize input from CRs and LFs lets attacker set arbitrary headers, body, or split the response

CSRF XSS: client (browser) trusts the server CSRF: server trusts the client (browser) server can not differentiate, whether a request from the browser was initiated by the user or by an attacker attacker includes a link or script in a page that accesses a site to which the user is known/authenticated <img src="http://bank.example.com/withdraw? account=bob&amount=1000000&for=mallory">

CSRF requirements target site does not check referer, or referer must be spoofed target must have form submission field or URL that has side effects all values must be known beforehand (no nonces) victim has to be logged in at target

XSS Mitigation allow only valid input (validate) encoding/escaping of output, so it won t get executed but displayed use POST instead of GET (data in form fields instead of query, operations that change state should be POST anyway) bind cookies to IPs filter CRs and LFs in headers add secret values to the session, which is not included in the cookie session timeouts FireFox Plugins: NoScript, RequestPolicy

Overview Web Applications SQL Injection XSS Bad Practice DNS Rebinding

Bad Practice in general: sensitive information is read from a cookie, HTTP header, or URL hidden forms (hold important data) predictable cookies, i.e. autoincrement userid or lousy encryption

magic URLs (parameters, access control) http://www.example.com?id=txkkzwnyzstwqsqkdzbyra== base64 decode: My$ecre+pA$$w0rD

Overview Web Applications SQL Injection XSS Bad Practice DNS Rebinding

DNS Rebinding we have to rely on name resolution, which is a fragile system infrastructure design flaw all applications that need to identify a host are affected

DNS hierarchy

DNS recursion

DNS interna when doing a request a client knows IP address of server source port of request name to resolve 16-bit request id (to differentiate between multiple applications) an attacker knows or can learn clients DNS server IP (same subnet or with DNS-server under attackers control, IDS) source port incremented monotonically (nowadays random 16-bit) 16-bit request id incremented monotonically (nowadays also random)

More on DNS cache (TTL) in response packet servers display the same problems when acting as clients to their authorities don t rely on only DNS for authentication DNSSEC, provides origin authentication, data integrity, authenticated denail of existence crypto, PKI, IPSec, SSL/TLS

Discussion Questions?