Web Application Security: Centre For Development of Advanced Computing (C-DAC) Electronics City, Bangalore
Web Application Security: Centre For Development of Advanced Computing (C-DAC) Electronics City, Bangalore
Agenda
Who are your Enemies What is a web application SD3 Security Framework Top 10 vulnerabilities How to avoid these Demo Example
Web application
A web application or web service is a software application that is accessible using a web browser or HTTP(s) user agent. A web application or webapp is an application that is accessed via web browser over a network such as the Internet or an intranet. A computer software application that is
Security goes beyond establishing a firewall and implementing SSL. Includes IDS, Policy, Standards, Awareness, Audit, Testing. Do not assume someone else is taking care of it.
C-DAC, EC, Bangalore
Firewalls
Firewalls can provide:
Secure gateway to the Internet for internal clients Packet filtering Auditing
Firewalls cannot provide:
Concepts
Threat : Any natural or unintentional event with the potential to cause harm to an information system, resulting in a degradation of a systems ability to fully perform its mission. Vulnerability: A security exposure in a system software or application software component.
C-DAC, EC, Bangalore
Secure by Default
Secure in Deployment
C-DAC, EC, Bangalore
Secure by Default
Secure in Deployment
C-DAC, EC, Bangalore
Leverage the security best practices Create security guidance Build tools to assess application security
Web Services
Directories
APPLICATION ATTACK
You cant use network layer protection (firewall, SSL, IDS, hardening) to stop or detect application layer attacks
Billing
SSL Protection
Top 10 Vulnerabilities
Invalidated Parameters Broken Access Control Broken Account and Session Management Cross-site Scripting(XSS) Flaws Buffer Overflows Command Injection Flaws Error Handling Problems Insecure Use of Cryptography Remote Administration Flaws Web and Application Server Misconfiguration
95% of Web Apps Have Vulnerabilities Cross-site scripting (80 percent) SQL injection (62 percent) Parameter tampering (60 percent) Cookie poisoning (37 percent) Database server (33 percent) Web server (23 percent) Buffer overflow (19 percent)
1. Invalidated Parameters
Attacker can easily tamper any part of the HTTP request before submitting. - URL - Cookies - Form fields - Hidden fields - Headers Common names for common input tampering attacks forced browsing, command insertion, cross site scripting, buffer overflows, format string attacks, SQL injection, cookie poisoning, and hidden field manipulation.
C-DAC, EC, Bangalore
Invalidated Parameters continued.. Do rigorous input data validation - All parameters should be validated before use Do server-side validation - Client side validation could be bypassed by the attacker easily - Client side validation is to be used mainly for quick user responsiveness
Invalidated Parameters continued.. Use centralized code for input validation - Scattered code is hard to maintain Each parameter should be checked against a strict format that specifies exactly what input will be allowed.
Access control is how you keep one user away from other users information
The problem is that many environments provide authentication, but dont handle access control well Many sites have a complex access control policy Key Points Write down your access control policy Dont use any ids that an attacker can
Includes all aspects of handling user authentication and managing active sessions. Session hi-jacking If the session cookies are not properly protected, an attacker can hijack an active session and assume the identity of a user. Account Management Handling credentials across client-server gap Backend authentication credentials too
5 .Buffer Overflow
Many system put limits on how much data a variable can store or a system can handle. Often times if these limits are exceeded, the data will still be used, but bypass certain security considerations. Attackers use buffer overflows to corrupt the execution stack of a web application. By sending carefully crafted input to a web application, an attacker can cause the web application to execute arbitrary code.
C-DAC, EC, Bangalore
6. SQL Injection
When a web application passes information from an HTTP request through as part of an external request, the attacker can inject special (meta) characters, malicious commands, or command modifiers into the information. SQL injection is a particularly widespread and dangerous form of injection - To exploit a SQL injection flaw, the attacker must find a parameter that the web application passes through to a database.
Improper Error Handling continued.. The errors must be handled according to a well thought out scheme that will - provide a meaningful error message to the user - provide diagnostic information to the site maintainers - provide no useful information to an attacker All security mechanisms should deny access until specifically granted, not grant access
C-DAC, EC, Bangalore
Improper Error Handling continued.. A specific policy for how to handle errors should be documented, including - The types of errors to be handled - For each, what information is going to be reported back to the user What information is going to be logged In the implementation, ensure that the site is built to gracefully handle all possible errors. When errors occur, the site should respond with a
C-DAC, EC, Bangalore
Tools
WebScarab - a web application vulnerability assessment suite including proxy tools Validation Filters (Stinger for J2EE, filters for PHP) generic security boundary filters that developers can use in their own applications CodeSpy look for security issues using reflection in J2EE apps
WebGoat - an interactive training and benchmarking tool that users can learn about web application security in a safe and legal environment
WebSphinx web crawler looking for security issues in web applications OWASP - Java based portal code designed with security as a prime concern
C-DAC, EC, Bangalore
Case Study
Thank You !!