Advanced Web Technology 10) XSS, CSRF and SQL Injection

Size: px
Start display at page:

Download "Advanced Web Technology 10) XSS, CSRF and SQL Injection"

Transcription

1 Berner Fachhochschule, Technik und Informatik Advanced Web Technology 10) XSS, CSRF and SQL Injection Dr. E. Benoist Fall Semester 2010/2011 1

2 Table of Contents Cross Site Request Forgery - CSRF Presentation Vulnerability CSRF allows to access the intranet Protection Conclusion Injection Flows Presentation Vulnerability Protection Examples Conclusion 2

3 Cross Site Request Forgery Not a new attack, but simple and devastating CSRF attack forces a logged-on victim s browser to send a request to a vulnerable web application Target: Perform the chosen action on behalf of the victim Cross Site Request Forgery - CSRF 3

4 Sending a request without the consent of the victim? Insert an image in a HTML file <img src= > Browser: Downloads an image GET /image/test.gif HTTP/ An image can be generated by a PHP program (or any program) <img src= > Browser: Downloads an image Cross Site Request Forgery - CSRF: Presentation 4

5 Sending a request? (Cont.) An image can be generated according to some parameters <img src= /barcode.php?number= > Browser: Downloads an image An image tag can contain something else <img src= logout > Browser????? Cross Site Request Forgery - CSRF: Presentation 5

6 Very widespread vulnerability Touches any web application that has no authorization checks for vulnerable actions will process an action if a default login is able to be given in the request <img src= pwd=123 > Authorizes requests based only on credentials that are automatically submitted cookies if currently logged into the application or Remember me functionality if not logged into the application or a Kerberos token if part of an Intranet participating in integrated logon with Active Directory. Cross Site Request Forgery - CSRF: Presentation 6

7 State of the art Most of web applications rely solely on automatically submitted credentials cookies basic authentication credentials source IP addresses SSL certificates or windows domain credentials Vulnerability also known as Session Riding, One-Click Attacks, Cross Site Reference Forgery, Hostile Linking, and Automation Attack Acronym XSRF is also used together with CSRF Cross Site Request Forgery - CSRF: Presentation 7

8 Vulnerability A typical CSRF attack directs the user to invoke some function for instance application s logout page The following tag can be inserted in any page viewed by the victim <img src= > it generates the same request as clicking on a link containing this address! Example: Online banking transfer <img src= frmacct=document.form.frmacct&toacct= &amt = > Could transfer the money from the account of the user, to a given account. Cross Site Request Forgery - CSRF: Vulnerability 8

9 Vulnerability (Cont.) Jeremiah Grossman 1 Succeeded in making changes in victims DSL routers Even if the user doesn t know that he can configure his router ;-) He used the router s default account name to perform his attack Example <img src= > Then you just have to reconfigure the system <img src= = > Once DNS changed, user will never be able to access a site securely! 1 Talk in Blackhat 2006 : Hacking Intranet Sites from the outside Cross Site Request Forgery - CSRF: Vulnerability 9

10 How such a link could reach a victim Web-site Owner embedded JavaScript malware Web page defaced with embedded JavaScript malware JavaScript Malware injected into a public area of a website. (persistent XSS) Clicked on, a specially-crafted link causing the website to echo JavaScript malware. (non-persistent XSS) Cross Site Request Forgery - CSRF: Vulnerability 10

11 CSRF allows to access the intranet The attacker sends requests from inside the Intranet Doesn t have to go throw the firewall, the victim is already CSRF combined with javascript allows to send many requests sequentially javascript adds an image in the DOM (possibly invisible). when the request is sent, another image is added and so on Cross Site Request Forgery - CSRF: CSRF allows to access the intranet 11

12 Internet is protected, but Intranet? You would never dare doing this on Internet! But what about Intranet? Leaving hosts unpatched Servers are always patched regularly, but local PC s? Using default passwords What the use of changing the password, the IP address can only be reached from inside my network x.y Do not putting a firewall in front of a host Everything seams OK because the perimeter firewalls black external access So CSRF attacks can be very fruitful Cross Site Request Forgery - CSRF: CSRF allows to access the intranet 12

13 Why do CSRF attacks work? User authorization credential is automatically included in any request by the browse Typical: Session Cookie The Attacker doesn t need to supply that credential It belongs to the victim s browser Success of CSRF belongs on the probability that the victim is logged in the attacked system Idea: attack the site the victim visits Mean : XSS Cross Site Request Forgery - CSRF: CSRF allows to access the intranet 13

14 CSRF and XSS Combine CSRF and XSS The tag is already posted inside the vulnerable application Risk is increased by that combination Probability to find a logged in user is higher CSRF does not require XSS One can attack a site from another one Any application with XSS flaws is susceptible to CSRF CSRF attacks can exploit the XSS flaw to steal any non-automatically submitted credential When building defenses against CSRF attacks, you must eliminate XSS vulnerabilities Cross Site Request Forgery - CSRF: CSRF allows to access the intranet 14

15 Protection Application must ensure that they are not only relying on credentials or tokens that are automatically submitted by browsers Session Cookies Certificates Remember me... Application should use a custom token that the browser will not Remember So it can not be included in the Requests sent automatically Cross Site Request Forgery - CSRF: Protection 15

16 Strategies Ensure that there are no XSS vulnerabilities in your application Otherwise, any protection is useless, since javascript could access the hidden data. Insert custom random tokens into every form and URL It will not be automatically submitted by the browser Example: <form action= /transfer.do method= POST > <input type= hidden name= value= >... </form> Then you have to verify that token Token can be unique for a session or even for each page The more focused the token is, the higher the security is, but the application is then much more complicated to write Cross Site Request Forgery - CSRF: Protection 16

17 Strategies (Cont.) For sensitive data or value transactions, re-authenticate or use transaction signing to ensure that the request is genuine. Set up external mechanism to verify requests (phone, ) Notify the user of the request using an Do not use GET requests for sensitive data or to perform value transactions Use only POST methods when processing sensitive data from the user. However the URL may contain the random token as this creates a unique URL, which makes CSRF almost impossible to perform POST alone is an insufficient protection You must also combine it with random tokens Cross Site Request Forgery - CSRF: Protection 17

18 Verifying Security Goal: Verify that the application generates and requires some authorization token that is not resent automatically by the browser Automated approaches: Automated approach: few automated scanners can detect CSRF vulnerabilities. Manual Approach: Penetration testing and verification of the code Cross Site Request Forgery - CSRF: Protection 18

19 Conclusion - CSRF Cross Site Scripting - XSS Exploits the trust a user has in a website Cross Site Request Forgery - CSRF Exploits the trust the site has in a user by forging the enactor and making a request appear to come from a trusted user 2 2 wikipedia Cross Site Request Forgery - CSRF: Conclusion 19

20 Injection Flows Principle: Occurs when user supplied data is sent to an interpreter as part of a command or a query. Injection Flows may be done on: SQL (most common) LDAP XPath XSLT HTML OS Command injection... This vulnerability is very common on Web Application Injection Flows: Presentation 20

21 How does it work? Attacker tricks the interpreter into executing unintended command Attacker supplies unexpected content to a site Data is especially designed to fool the site Attacker may take control of the interpreter, for instance SQL: Read data (unintended, of course) update, delete or create any arbitrary data For the Operating System interpreter Attacker may have the opportunity to execute any command Injection Flows: Presentation 21

22 Vulnerability Environments affected Any framework using an interpreter or invoke process SQL Command line... System is vulnerable when user input is passed without tests PHP $query = select from guestbook ; $query.= where title like.$ REQUEST[ search ]; $result = mysql query($query, $conn); Java String query = select from user where username= ; query += req.getparameter( userid ); query += and password = +req.getparameter( pwd ) + ; Injection Flows: Vulnerability 22

23 Protection Avoid the use of interpreter if possible Otherwise: Use safe APIs Strongly typed parameterized queries Object Relational Mapping (ORM) They handle data escaping Validation is still recommended in order to detect attacks Injection Flows: Protection 23

24 Take Extra Care when using interpreters Input Validation Validate all input data: length, type, syntax, business rules validation is done before displaying or storing any data Validation must be done server-side Javascript validation doesn t bring any security Use strongly typed parameterized query APIs with placeholder substitution markers, Enforce least privilege Configure your DB such that the web account can t do more than what is expected restrict the rights of your user when executing an OS command Injection Flows: Protection 24

25 Take Extra Care (Cont.) Avoid detailed error messages Give access to versions numbers Give access to parts of the code Give access to configurations Use stored procedures They are generally safe from SQL injection Can however be injected (for instance using exec()) Do not use dynamic query interfaces (such as mysql query()) Injection Flows: Protection 25

26 Take Extra Care (Cont.) Do not use simple escaping functions such as addslashes() in PHP str replace(" "," ") it is weak and has been successfully exploited Prefer following methods use mysql real escape string() or preferably PDO which does not require escaping Injection Flows: Protection 26

27 Language Specific recommendations Java EE use strongly typed PreparedStatement or use an ORM (Object Relational Manager) such as Hibernate or Spring PHP Use PDO with strongly typed parameterized queries (using bindparam()). Injection Flows: Protection 27

28 Which site is subject to SQL injection? Such a site must access a DB The parameter should be given by the user This parameter is then used to select data in the DB Example Means there exists a request for the page number 100 If the site does not test its input You can test it by typing something like: If the site lets the user see error messages Test the output of your input Examples Search form (SELECT with LIKE) Login form (SELECT with two =) Insertion of new entries... Injection Flows: Examples 28

29 Example: Presentation Suppose we have the following HTML Form <form method= POST > <input type= text name= username ><br> <input type= password name= password ><br> <input type= submit value= Login > </form> and the following PHP line defining a SQL command: $query = SELECT FROM user WHERE username= $user ; $query.= AND password= $pwd ; For our examples, we disable a security feature from the php.ini file (normally this option is on, and it quotes all GET, POST and COOKIES parameters, means chars like: and are escaped and Advanced become Web\ Technology and 10) \ ): XSS, magic_quotes_gpc CSRF and SQL Injection = off Injection Flows: Examples 29

30 Example: Select user and password We want the select to work in any case Following expressions are always true SELECT FROM table WHERE 1=1; SELECT FROM table WHERE 1; SELECT FROM table WHERE ISNULL(NULL) SELECT FROM table WHERE 1 IS NOT NULL SELECT FROM table WHERE NULL IS NULL... Injection Flows: Examples 30

31 Example: Select user and password (Cont.) So we do not need a valid username and password if $user=" OR a = a" and $password remains empty then the previous expression becomes: SELECT FROM user WHERE username= OR a = a AND \ password= ; Returns the list of all users So we are logged in with the first provided Injection Flows: Examples 31

32 Login on a specific account We can specify the right username and change the password If we give $user="emmanuel" And $password=" OR b BETWEEN a AND c" The previous SQL statement becomes SELECT FROM user WHERE username= Emmanuel AND \ password= OR b BETWEEN a AND c ; So username is OK, but password is not checked! Injection Flows: Examples 32

33 Example, using Comments Another great principle in SQL injection is Comments It is also very common in all the other injections If we inject a #, the rest of the SQL expression is not evaluated if $user="john #" the request becomes SELECT FROM user WHERE username= John # AND password= which is equal to SELECT FROM user WHERE username= John If we use the comments /* comments */ we may escape some tests Injection Flows: Examples 33

34 More injection in SELECT Suppose we have the following query, for displaying the content of one single comment in our guestbook: $query = select from guestbook where guestbookid= $number ; We can copy the content in a file suppose we define $number="11 or 1=1 INTO OUTFILE /tmp/test.security.txt " The total content of the table is sent to a file. Suppose the Attacker has an account on the system (e.g. foobar). It is possible to change the password of foobar If we can write the following query: SELECT password FROM user WHERE login= foobar INTO OUTFILE\ /opt/lampp/htdocs/test.php Injection Flows: Examples 34

35 Attacks compatible with magic quotes Since most of the server have magic quotes gpc = on Attackers can not use or Use MySQL char() function Returns the character denoted by the number, For instance char(104,111,112) returns the string hop Previous attack becomes The following query is used to count one vote: UPDATE news SET votes=votes+1, score=score+$note WHERE\ newsid= $id, We have the following attack $note= 3, title=char(104,111,112) Injection Flows: Examples 35

36 How to protect yourself From SQL injection in PHP Configure PHP such that and are automatically escaped magic quotes gpc = on Always quote input before sending query to an interpreter mysql real escape string() Do not use any interpreter at all Use PDO Injection Flows: Examples 36

37 Conclusion (Injection Flows) SQL Injection allows attacker to Read data: Access passwords, data stored Change Data : Access security level Delete data SQL injection Vulnerabilities opens the door to: Privacy breach : Data can be accessed without consent Identity theft : idem + failure in authentication Compromission of the system : write of new files (maybe PHP)... Easy protection are already exploited Adding one (or more) layers between presentation and database layer is a must (also from the point of view of Design) Even this has also been successfully exploited. Solution? test your inputs! Injection Flows: Conclusion 37

38 Conclusion (Web Security) Infrastructure Security is Vital Good Network Architecture (Firewals, DMZ,... ) Application Security must not be forgotten Test Inputs Encode Outputs Teach your users No security is efficient is users aren t included for instance if they never log-out Security is expensive in Development time or in Usability Injection Flows: Conclusion 38

39 References OWASP Top A Guide for Building Secure Web Applications and Web Services Advanced SQL Injection in SQL Server Applications - Chris Anley injection.pdf L injection (My)SQL via PHP - leseulfrog Advanced version: SQLMAP (a SQL Injection Tool) Injection Flows: Conclusion 39

Web Application Security. Philippe Bogaerts

Web Application Security. Philippe Bogaerts Web Application Security Philippe Bogaerts OWASP TOP 10 3 Aim of the OWASP Top 10 educate developers, designers, architects and organizations about the consequences of the most common web application security

More information

Application vulnerabilities and defences

Application vulnerabilities and defences Application vulnerabilities and defences In this lecture We examine the following : SQL injection XSS CSRF SQL injection SQL injection is a basic attack used to either gain unauthorized access to a database

More information

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any OWASP Top 10 Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any tester can (and should) do security testing

More information

OWASP Top 10 The Ten Most Critical Web Application Security Risks

OWASP Top 10 The Ten Most Critical Web Application Security Risks OWASP Top 10 The Ten Most Critical Web Application Security Risks The Open Web Application Security Project (OWASP) is an open community dedicated to enabling organizations to develop, purchase, and maintain

More information

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11 Attacks Against Websites Tom Chothia Computer Security, Lecture 11 A typical web set up TLS Server HTTP GET cookie Client HTML HTTP file HTML PHP process Display PHP SQL Typical Web Setup HTTP website:

More information

CIS 4360 Secure Computer Systems XSS

CIS 4360 Secure Computer Systems XSS CIS 4360 Secure Computer Systems XSS Professor Qiang Zeng Spring 2017 Some slides are adapted from the web pages by Kallin and Valbuena Previous Class Two important criteria to evaluate an Intrusion Detection

More information

P2_L12 Web Security Page 1

P2_L12 Web Security Page 1 P2_L12 Web Security Page 1 Reference: Computer Security by Stallings and Brown, Chapter (not specified) The web is an extension of our computing environment, because most of our daily tasks involve interaction

More information

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP OWASP Top 10 Risks Dean.Bushmiller@ExpandingSecurity.com Many thanks to Dave Wichers & OWASP My Mom I got on the email and did a google on my boy My boy works in this Internet thing He makes cyber cafes

More information

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH Faculty of Computer Science Institute of Systems Architecture, Operating Systems Group PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH THE WEB AS A DISTRIBUTED SYSTEM 2 WEB HACKING SESSION 3 3-TIER persistent

More information

Application Security Introduction. Tara Gu IBM Product Security Incident Response Team

Application Security Introduction. Tara Gu IBM Product Security Incident Response Team Application Security Introduction Tara Gu IBM Product Security Incident Response Team About Me - Tara Gu - tara.weiqing@gmail.com - Duke B.S.E Biomedical Engineering - Duke M.Eng Computer Engineering -

More information

CS 161 Computer Security

CS 161 Computer Security Paxson Spring 2017 CS 161 Computer Security Discussion 4 Week of February 13, 2017 Question 1 Clickjacking (5 min) Watch the following video: https://www.youtube.com/watch?v=sw8ch-m3n8m Question 2 Session

More information

CSCD 303 Essential Computer Security Fall 2017

CSCD 303 Essential Computer Security Fall 2017 CSCD 303 Essential Computer Security Fall 2017 Lecture 18a XSS, SQL Injection and CRSF Reading: See links - End of Slides Overview Idea of XSS, CSRF and SQL injection is to violate the security of the

More information

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Table of Contents Hacking Web Sites Broken Authentication Emmanuel Benoist Spring Term 2018 Introduction Examples of Attacks Brute Force Session Spotting Replay Attack Session Fixation Attack Session Hijacking

More information

Hacking Intranet Websites from the Outside

Hacking Intranet Websites from the Outside 1 Hacking Intranet Websites from the Outside "JavaScript malware just got a lot more dangerous" Black Hat (Japan) 10.05.2006 Jeremiah Grossman (Founder and CTO) WhiteHat Security 2 WhiteHat Sentinel -

More information

Computer Security 3e. Dieter Gollmann. Chapter 18: 1

Computer Security 3e. Dieter Gollmann.  Chapter 18: 1 Computer Security 3e Dieter Gollmann www.wiley.com/college/gollmann Chapter 18: 1 Chapter 18: Web Security Chapter 18: 2 Web 1.0 browser HTTP request HTML + CSS data web server backend systems Chapter

More information

Andrew Muller, Canberra Managing Director, Ionize, Canberra The challenges of Security Testing. Security Testing. Taming the Wild West

Andrew Muller, Canberra Managing Director, Ionize, Canberra The challenges of Security Testing. Security Testing. Taming the Wild West Andrew Muller, Canberra Managing Director, Ionize, Canberra The challenges of Security Testing Advancing Expertise in Security Testing Taming the Wild West Canberra, Australia 1 Who is this guy? Andrew

More information

Copyright

Copyright 1 Security Test EXTRA Workshop : ANSWER THESE QUESTIONS 1. What do you consider to be the biggest security issues with mobile phones? 2. How seriously are consumers and companies taking these threats?

More information

NET 311 INFORMATION SECURITY

NET 311 INFORMATION SECURITY NET 311 INFORMATION SECURITY Networks and Communication Department Lec12: Software Security / Vulnerabilities lecture contents: o Vulnerabilities in programs Buffer Overflow Cross-site Scripting (XSS)

More information

Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security

Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security Cross-Site Request Forgery: The Sleeping Giant Jeremiah Grossman Founder and CTO, WhiteHat Security Cross-Site Request Forgeries (CSRF) 1. Session Riding 2. Client-Side Trojans 3. Confused Deputy 4. Web

More information

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Application Security through a Hacker s Eyes James Walden Northern Kentucky University Application Security through a Hacker s Eyes James Walden Northern Kentucky University waldenj@nku.edu Why Do Hackers Target Web Apps? Attack Surface A system s attack surface consists of all of the ways

More information

Preparing for the Cross Site Request Forgery Defense

Preparing for the Cross Site Request Forgery Defense Preparing for the Cross Site Request Forgery Defense By Chuck Willis chuck.willis@mandiant.com Presented at Black Hat Briefings DC 2008 on February 20, 2008 Slides available at www.blackhat.com. Abstract:

More information

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang WEB SECURITY WORKSHOP TEXSAW 2014 Presented by Solomon Boyd and Jiayang Wang Introduction and Background Targets Web Applications Web Pages Databases Goals Steal data Gain access to system Bypass authentication

More information

This slide shows the OWASP Top 10 Web Application Security Risks of 2017, which is a list of the currently most dangerous web vulnerabilities in

This slide shows the OWASP Top 10 Web Application Security Risks of 2017, which is a list of the currently most dangerous web vulnerabilities in 1 This slide shows the OWASP Top 10 Web Application Security Risks of 2017, which is a list of the currently most dangerous web vulnerabilities in terms of prevalence (how much the vulnerability is widespread),

More information

Web Security, Summer Term 2012

Web Security, Summer Term 2012 IIG University of Freiburg Web Security, Summer Term 2012 Brocken Authentication and Session Management Dr. E. Benoist Sommer Semester Web Security, Summer Term 2012 7 Broken Authentication and Session

More information

Web Security, Summer Term 2012

Web Security, Summer Term 2012 Table of Contents IIG University of Freiburg Web Security, Summer Term 2012 Brocken Authentication and Session Management Dr. E. Benoist Sommer Semester Introduction Examples of Attacks Brute Force Session

More information

WHY CSRF WORKS. Implicit authentication by Web browsers

WHY CSRF WORKS. Implicit authentication by Web browsers WHY CSRF WORKS To explain the root causes of, and solutions to CSRF attacks, I need to share with you the two broad types of authentication mechanisms used by Web applications: 1. Implicit authentication

More information

Welcome to the OWASP TOP 10

Welcome to the OWASP TOP 10 Welcome to the OWASP TOP 10 Secure Development for Java Developers Dominik Schadow 03/20/2012 BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN 1 AGENDA

More information

W e b A p p l i c a t i o n S e c u r i t y : T h e D e v i l i s i n t h e D e t a i l s

W e b A p p l i c a t i o n S e c u r i t y : T h e D e v i l i s i n t h e D e t a i l s W e b A p p l i c a t i o n S e c u r i t y : T h e D e v i l i s i n t h e D e t a i l s Session I of III JD Nir, Security Analyst Why is this important? ISE Proprietary Agenda About ISE Web Applications

More information

WEB SECURITY: XSS & CSRF

WEB SECURITY: XSS & CSRF WEB SECURITY: XSS & CSRF CMSC 414 FEB 22 2018 Cross-Site Request Forgery (CSRF) URLs with side-effects http://bank.com/transfer.cgi?amt=9999&to=attacker GET requests should have no side-effects, but often

More information

Sichere Software vom Java-Entwickler

Sichere Software vom Java-Entwickler Sichere Software vom Java-Entwickler Dominik Schadow Java Forum Stuttgart 05.07.2012 BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN We can no longer

More information

1 About Web Security. What is application security? So what can happen? see [?]

1 About Web Security. What is application security? So what can happen? see [?] 1 About Web Security What is application security? see [?] So what can happen? 1 taken from [?] first half of 2013 Let s focus on application security risks Risk = vulnerability + impact New App: http://www-03.ibm.com/security/xforce/xfisi

More information

DEFENSIVE PROGRAMMING. Lecture for EDA 263 Magnus Almgren Department of Computer Science and Engineering Chalmers University of Technology

DEFENSIVE PROGRAMMING. Lecture for EDA 263 Magnus Almgren Department of Computer Science and Engineering Chalmers University of Technology DEFENSIVE PROGRAMMING Lecture for EDA 263 Magnus Almgren Department of Computer Science and Engineering Chalmers University of Technology Traditional Programming When writing a program, programmers typically

More information

Web Application Security

Web Application Security Web Application Security Rajendra Kachhwaha rajendra1983@gmail.com October 16, 2015 Lecture 16: 1/ 14 Outline Browser Security Principles: 1 Cross Site Scripting (XSS) 2 Types of XSS 3 Lecture 16: 2/ 14

More information

Some Facts Web 2.0/Ajax Security

Some Facts Web 2.0/Ajax Security /publications/notes_and_slides Some Facts Web 2.0/Ajax Security Allen I. Holub Holub Associates allen@holub.com Hackers attack bugs. The more complex the system, the more bugs it will have. The entire

More information

CSCD 303 Essential Computer Security Fall 2018

CSCD 303 Essential Computer Security Fall 2018 CSCD 303 Essential Computer Security Fall 2018 Lecture 17 XSS, SQL Injection and CRSF Reading: See links - End of Slides Overview Idea of XSS, CSRF and SQL injection is to violate security of Web Browser/Server

More information

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security.

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security. Web Security Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming Web Security Slide 1/25 Outline Web insecurity Security strategies General security Listing of server-side risks Language

More information

Avoiding Web Application Flaws In Embedded Devices. Jake Edge LWN.net URL for slides:

Avoiding Web Application Flaws In Embedded Devices. Jake Edge LWN.net URL for slides: Avoiding Web Application Flaws In Embedded Devices Jake Edge LWN.net jake@lwn.net URL for slides: http://lwn.net/talks/elce2008 Overview Examples embedded devices gone bad Brief introduction to HTTP Authentication

More information

Combating Common Web App Authentication Threats

Combating Common Web App Authentication Threats Security PS Combating Common Web App Authentication Threats Bruce K. Marshall, CISSP, NSA-IAM Senior Security Consultant bmarshall@securityps.com Key Topics Key Presentation Topics Understanding Web App

More information

Computer Forensics: Investigating Network Intrusions and Cyber Crime, 2nd Edition. Chapter 3 Investigating Web Attacks

Computer Forensics: Investigating Network Intrusions and Cyber Crime, 2nd Edition. Chapter 3 Investigating Web Attacks Computer Forensics: Investigating Network Intrusions and Cyber Crime, 2nd Edition Chapter 3 Investigating Web Attacks Objectives After completing this chapter, you should be able to: Recognize the indications

More information

Common Websites Security Issues. Ziv Perry

Common Websites Security Issues. Ziv Perry Common Websites Security Issues Ziv Perry About me Mitnick attack TCP splicing Sql injection Transitive trust XSS Denial of Service DNS Spoofing CSRF Source routing SYN flooding ICMP

More information

OWASP TOP 10. By: Ilia

OWASP TOP 10. By: Ilia OWASP TOP 10 By: Ilia Alshanetsky @iliaa ME, MYSELF & I PHP Core Developer Author of Guide to PHP Security Security Aficionado WEB SECURITY THE CONUNDRUM USABILITY SECURITY YOU CAN HAVE ONE ;-) OPEN WEB

More information

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web Security and Privacy SWE 432, Fall 2016 Design and Implementation of Software for the Web Today Security What is it? Most important types of attacks Privacy For further reading: https://www.owasp.org/index.php/

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Semester 2, 2017 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 9 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2465 1 Assignment

More information

OWASP TOP Release. Andy Willingham June 12, 2018 OWASP Cincinnati

OWASP TOP Release. Andy Willingham June 12, 2018 OWASP Cincinnati OWASP TOP 10 2017 Release Andy Willingham June 12, 2018 OWASP Cincinnati Agenda A quick history lesson The Top 10(s) Web Mobile Privacy Protective Controls Why have a Top 10? Software runs the world (infrastructure,

More information

Web Security, Summer Term 2012

Web Security, Summer Term 2012 IIG University of Freiburg Web Security, Summer Term 2012 Web Application: Testing Security Dr. E. Benoist Sommer Semester Web Security, Summer Term 2012 10) Web Application: Testing Security 1 Table of

More information

CSE361 Web Security. Attacks against the client-side of web applications. Nick Nikiforakis

CSE361 Web Security. Attacks against the client-side of web applications. Nick Nikiforakis CSE361 Web Security Attacks against the client-side of web applications Nick Nikiforakis nick@cs.stonybrook.edu Despite the same origin policy Many things can go wrong at the client-side of a web application

More information

Aguascalientes Local Chapter. Kickoff

Aguascalientes Local Chapter. Kickoff Aguascalientes Local Chapter Kickoff juan.gama@owasp.org About Us Chapter Leader Juan Gama Application Security Engineer @ Aspect Security 9+ years in Appsec, Testing, Development Maintainer of OWASP Benchmark

More information

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection Is Browsing Safe? Web Browser Security Charlie Reis Guest Lecture - CSE 490K - 5/24/2007 Send Spam Search Results Change Address? Install Malware Web Mail Movie Rentals 2 Browser Security Model Pages are

More information

Attacking the Application OWASP. The OWASP Foundation. Dave Ferguson, CISSP Security Consultant FishNet Security.

Attacking the Application OWASP. The OWASP Foundation. Dave Ferguson, CISSP Security Consultant FishNet Security. Attacking the Application Dave Ferguson, CISSP Security Consultant FishNet Security Copyright The Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the

More information

Web basics: HTTP cookies

Web basics: HTTP cookies Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh February 11, 2016 1 / 27 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the

More information

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH Department of Computer Science Institute of System Architecture, Operating Systems Group PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH THE WEB AS A DISTRIBUTED SYSTEM 2 WEB HACKING SESSION 3 3-TIER persistent

More information

CSCE 813 Internet Security Case Study II: XSS

CSCE 813 Internet Security Case Study II: XSS CSCE 813 Internet Security Case Study II: XSS Professor Lisa Luo Fall 2017 Outline Cross-site Scripting (XSS) Attacks Prevention 2 What is XSS? Cross-site scripting (XSS) is a code injection attack that

More information

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh March 30, 2015 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the server sends

More information

Perslink Security. Perslink Security. Eleonora Petridou Pascal Cuylaerts. System And Network Engineering University of Amsterdam.

Perslink Security. Perslink Security. Eleonora Petridou Pascal Cuylaerts. System And Network Engineering University of Amsterdam. Eleonora Petridou Pascal Cuylaerts System And Network Engineering University of Amsterdam June 30, 2011 Outline Research question About Perslink Approach Manual inspection Automated tests Vulnerabilities

More information

Web Application Penetration Testing

Web Application Penetration Testing Web Application Penetration Testing COURSE BROCHURE & SYLLABUS Course Overview Web Application penetration Testing (WAPT) is the Security testing techniques for vulnerabilities or security holes in corporate

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Web Application Security Dr. Basem Suleiman Service Oriented Computing Group, CSE, UNSW Australia Semester 1, 2016, Week 8 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2442

More information

Security. CSC309 TA: Sukwon Oh

Security. CSC309 TA: Sukwon Oh Security CSC309 TA: Sukwon Oh Outline SQL Injection NoSQL Injection (MongoDB) Same Origin Policy XSSI XSS CSRF (XSRF) SQL Injection What is SQLI? Malicious user input is injected into SQL statements and

More information

Assignment 6: Web Security

Assignment 6: Web Security COS 432 November 20, 2017 Information Security Assignment 6: Web Security Assignment 6: Web Security This project is due on Monday, December 4 at 11:59 p.m.. Late submissions will be penalized by 10% per

More information

GOING WHERE NO WAFS HAVE GONE BEFORE

GOING WHERE NO WAFS HAVE GONE BEFORE GOING WHERE NO WAFS HAVE GONE BEFORE Andy Prow Aura Information Security Sam Pickles Senior Systems Engineer, F5 Networks NZ Agenda: WTF is a WAF? View from the Trenches Example Attacks and Mitigation

More information

CS 161 Computer Security

CS 161 Computer Security Raluca Ada Popa Spring 2018 CS 161 Computer Security Discussion 9 Week of March 19, 2018 Question 1 Warmup: SOP (15 min) The Same Origin Policy (SOP) helps browsers maintain a sandboxed model by preventing

More information

Top 10 Web Application Vulnerabilities

Top 10 Web Application Vulnerabilities Top 10 Web Application Vulnerabilities Why you should care about them plus a live hacking demo!! Why should you care?! Insecure so*ware is undermining our financial, healthcare, defense, energy, and other

More information

Project 2: Web Security

Project 2: Web Security EECS 388 September 30, 2016 Intro to Computer Security Project 2: Web Security Project 2: Web Security This project is due on Thursday, October 13 at 6 p.m. and counts for 8% of your course grade. Late

More information

OWASP Top 10. Copyright 2017 Ergon Informatik AG 2/13

OWASP Top 10. Copyright 2017 Ergon Informatik AG 2/13 Airlock and the OWASP TOP 10-2017 Version 2.1 11.24.2017 OWASP Top 10 A1 Injection... 3 A2 Broken Authentication... 5 A3 Sensitive Data Exposure... 6 A4 XML External Entities (XXE)... 7 A5 Broken Access

More information

Excerpts of Web Application Security focusing on Data Validation. adapted for F.I.S.T. 2004, Frankfurt

Excerpts of Web Application Security focusing on Data Validation. adapted for F.I.S.T. 2004, Frankfurt Excerpts of Web Application Security focusing on Data Validation adapted for F.I.S.T. 2004, Frankfurt by fs Purpose of this course: 1. Relate to WA s and get a basic understanding of them 2. Understand

More information

RKN 2015 Application Layer Short Summary

RKN 2015 Application Layer Short Summary RKN 2015 Application Layer Short Summary HTTP standard version now: 1.1 (former 1.0 HTTP /2.0 in draft form, already used HTTP Requests Headers and body counterpart: answer Safe methods (requests): GET,

More information

Web Security. Thierry Sans

Web Security. Thierry Sans Web Security Thierry Sans 1991 Sir Tim Berners-Lee Web Portals 2014 Customer Resources Managemen Accounting and Billing E-Health E-Learning Collaboration Content Management Social Networks Publishing Web

More information

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007 Web 2.0 and AJAX Security OWASP Montgomery August 21 st, 2007 Overview Introduction Definition of Web 2.0 Basics of AJAX Attack Vectors for AJAX Applications AJAX and Application Security Conclusions 1

More information

Web basics: HTTP cookies

Web basics: HTTP cookies Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh November 20, 2017 1 / 32 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the

More information

Solutions Business Manager Web Application Security Assessment

Solutions Business Manager Web Application Security Assessment White Paper Solutions Business Manager Solutions Business Manager 11.3.1 Web Application Security Assessment Table of Contents Micro Focus Takes Security Seriously... 1 Solutions Business Manager Security

More information

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14 Attacks Against Websites 3 The OWASP Top 10 Tom Chothia Computer Security, Lecture 14 OWASP top 10. The Open Web Application Security Project Open public effort to improve web security: Many useful documents.

More information

Information Security CS 526 Topic 8

Information Security CS 526 Topic 8 Information Security CS 526 Topic 8 Web Security Part 1 1 Readings for This Lecture Wikipedia HTTP Cookie Same Origin Policy Cross Site Scripting Cross Site Request Forgery 2 Background Many sensitive

More information

Security Engineering by Ross Andersson Chapter 18. API Security. Presented by: Uri Ariel Nepomniashchy 31/05/2016

Security Engineering by Ross Andersson Chapter 18. API Security. Presented by: Uri Ariel Nepomniashchy 31/05/2016 Security Engineering by Ross Andersson Chapter 18 API Security Presented by: Uri Ariel Nepomniashchy 31/5/216 Content What is API API developing risks Attacks on APIs Summary What is API? Interface for

More information

C1: Define Security Requirements

C1: Define Security Requirements OWASP Top 10 Proactive Controls IEEE Top 10 Software Security Design Flaws OWASP Top 10 Vulnerabilities Mitigated OWASP Mobile Top 10 Vulnerabilities Mitigated C1: Define Security Requirements A security

More information

Hacker Attacks on the Horizon: Web 2.0 Attack Vectors

Hacker Attacks on the Horizon: Web 2.0 Attack Vectors IBM Software Group Hacker Attacks on the Horizon: Web 2.0 Attack Vectors Danny Allan Director, Security Research dallan@us.ibm.com 2/21/2008 Agenda HISTORY Web Eras & Trends SECURITY Web 2.0 Attack Vectors

More information

CS 155 Project 2. Overview & Part A

CS 155 Project 2. Overview & Part A CS 155 Project 2 Overview & Part A Project 2 Web application security Composed of two parts Part A: Attack Part B: Defense Due date: Part A: May 5th (Thu) Part B: May 12th (Thu) Project 2 Ruby-on-Rails

More information

Web Application Vulnerabilities: OWASP Top 10 Revisited

Web Application Vulnerabilities: OWASP Top 10 Revisited Pattern Recognition and Applications Lab Web Application Vulnerabilities: OWASP Top 10 Revisited Igino Corona igino.corona AT diee.unica.it Computer Security April 5th, 2018 Department of Electrical and

More information

Information Security CS 526 Topic 11

Information Security CS 526 Topic 11 Information Security CS 526 Topic 11 Web Security Part 1 1 Readings for This Lecture Wikipedia HTTP Cookie Same Origin Policy Cross Site Scripting Cross Site Request Forgery 2 Background Many sensitive

More information

LECT 8 WEB SECURITY BROWSER SECURITY. Repetition Lect 7. WEB Security

LECT 8 WEB SECURITY BROWSER SECURITY. Repetition Lect 7. WEB Security Repetition Lect 7 LECT 8 WEB SECURITY Access control Runtime protection Trusted computing Java as basic model for signed code Trusted Computing Group TPM ARM TrustZone Mobile Network security GSM security

More information

A D V I S O R Y S E R V I C E S. Web Application Assessment

A D V I S O R Y S E R V I C E S. Web Application Assessment A D V I S O R Y S E R V I C E S Web Application Assessment March 2009 Agenda Definitions Landscape of current web applications Required skills Attack surface Scope Methodology Soft skills 2 Definitions

More information

Securing Your Web Application against security vulnerabilities. Alvin Wong, Brand Manager IBM Rational Software

Securing Your Web Application against security vulnerabilities. Alvin Wong, Brand Manager IBM Rational Software Securing Your Web Application against security vulnerabilities Alvin Wong, Brand Manager IBM Rational Software Agenda Security Landscape Vulnerability Analysis Automated Vulnerability Analysis IBM Rational

More information

Robust Defenses for Cross-Site Request Forgery

Robust Defenses for Cross-Site Request Forgery University of Cyprus Department of Computer Science Advanced Security Topics Robust Defenses for Cross-Site Request Forgery Name: Elena Prodromou Instructor: Dr. Elias Athanasopoulos Authors: Adam Barth,

More information

Robust Defenses for Cross-Site Request Forgery Review

Robust Defenses for Cross-Site Request Forgery Review Robust Defenses for Cross-Site Request Forgery Review Network Security Instructor:Dr. Shishir Nagaraja Submitted By: Jyoti Leeka October 16, 2011 1 Introduction to the topic and the reason for the topic

More information

Web Security: Web Application Security [continued]

Web Security: Web Application Security [continued] CSE 484 / CSE M 584: Computer Security and Privacy Web Security: Web Application Security [continued] Spring 2017 Franziska (Franzi) Roesner franzi@cs.washington.edu Thanks to Dan Boneh, Dieter Gollmann,

More information

Exploiting and Defending: Common Web Application Vulnerabilities

Exploiting and Defending: Common Web Application Vulnerabilities Exploiting and Defending: Common Web Application Vulnerabilities Introduction: Steve Kosten Principal Security Consultant SANS Instructor Denver OWASP Chapter Lead Certifications CISSP, GWAPT, GSSP-Java,

More information

PHP Security. Kevin Schroeder Zend Technologies. Copyright 2007, Zend Technologies Inc.

PHP Security. Kevin Schroeder Zend Technologies. Copyright 2007, Zend Technologies Inc. PHP Security Kevin Schroeder Zend Technologies Copyright 2007, Zend Technologies Inc. Disclaimer Do not use anything you learn here for nefarious purposes Why Program Securely? Your job/reputation depends

More information

CSE 127 Computer Security

CSE 127 Computer Security CSE 127 Computer Security Fall 2015 Web Security I: SQL injection Stefan Savage The Web creates new problems Web sites are programs Partially implemented in browser» Javascript, Java, Flash Partially implemented

More information

Information Security. Gabriel Lawrence Director, IT Security UCSD

Information Security. Gabriel Lawrence Director, IT Security UCSD Information Security Gabriel Lawrence Director, IT Security UCSD Director of IT Security, UCSD Three Startups (2 still around!) Sun Microsystems (Consulting and JavaSoftware) Secure Internet Applications

More information

Application Layer Security

Application Layer Security Application Layer Security General overview Ma. Angel Marquez Andrade Benefits of web Applications: No need to distribute separate client software Changes to the interface take effect immediately Client-side

More information

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015

INF3700 Informasjonsteknologi og samfunn. Application Security. Audun Jøsang University of Oslo Spring 2015 INF3700 Informasjonsteknologi og samfunn Application Security Audun Jøsang University of Oslo Spring 2015 Outline Application Security Malicious Software Attacks on applications 2 Malicious Software 3

More information

Your Turn to Hack the OWASP Top 10!

Your Turn to Hack the OWASP Top 10! OWASP Top 10 Web Application Security Risks Your Turn to Hack OWASP Top 10 using Mutillidae Born to Be Hacked Metasploit in VMWare Page 1 https://www.owasp.org/index.php/main_page The Open Web Application

More information

CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno

CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno CSE 484 / CSE M 584: Computer Security and Privacy Web Security Autumn 2018 Tadayoshi (Yoshi) Kohno yoshi@cs.washington.edu Thanks to Dan Boneh, Dieter Gollmann, Dan Halperin, Ada Lerner, John Manferdelli,

More information

Web Application & Web Server Vulnerabilities Assessment Pankaj Sharma

Web Application & Web Server Vulnerabilities Assessment Pankaj Sharma Web Application & Web Server Vulnerabilities Assessment Pankaj Sharma Indian Computer Emergency Response Team ( CERT - IN ) Department Of Information Technology 1 Agenda Introduction What are Web Applications?

More information

Web Penetration Testing

Web Penetration Testing Web Penetration Testing What is a Website How to hack a Website? Computer with OS and some servers. Apache, MySQL...etc Contains web application. PHP, Python...etc Web application is executed here and

More information

Why bother? Causes of data breaches OWASP. Top ten attacks. Now what? Do it yourself Questions?

Why bother? Causes of data breaches OWASP. Top ten attacks. Now what? Do it yourself Questions? Jeroen van Beek 1 Why bother? Causes of data breaches OWASP Top ten attacks Now what? Do it yourself Questions? 2 In many cases the web application stores: Credit card details Personal information Passwords

More information

Web Security, Summer Term 2012

Web Security, Summer Term 2012 Table of Contents IIG University of Freiburg Web Security, Summer Term 2012 Cross Site Scripting - XSS Dr. E. Benoist Sommer Semester Presentation: Inject Javascript in a Page Javascript for manipulating

More information

Web Security, Summer Term 2012

Web Security, Summer Term 2012 IIG University of Freiburg Web Security, Summer Term 2012 Cross Site Scripting - XSS Dr. E. Benoist Sommer Semester Web Security, Summer Term 2012 5 Cross Site Scripting 1 Table of Contents Presentation:

More information

F5 Application Security. Radovan Gibala Field Systems Engineer

F5 Application Security. Radovan Gibala Field Systems Engineer 1 F5 Application Security Radovan Gibala Field Systems Engineer r.gibala@f5.com +420 731 137 223 2007 2 Agenda Challenge Websecurity What are the problems? Building blocks of Web Applications Vulnerabilities

More information

Featuring. and. Göteborg. Ulf Larson Thursday, October 24, 13

Featuring. and. Göteborg. Ulf Larson Thursday, October 24, 13 Featuring and Göteborg OWASP top ten 2013 Based on risk data from eight firms that specialize in application security, This data spans over 500,000 vulnerabilities across hundreds of organizations and

More information

Slides adopted from Laurie Williams. OWASP Top Ten. John Slankas

Slides adopted from Laurie Williams. OWASP Top Ten. John Slankas Slides adopted from Laurie Williams OWASP Top Ten John Slankas jbslanka@ncsu.edu Agenda Overview of the Top 10 A1 Injection A2 Broken Authentication and Session Management A3 Cross-Site Scripting A4 Broken

More information

INNOV-09 How to Keep Hackers Out of your Web Application

INNOV-09 How to Keep Hackers Out of your Web Application INNOV-09 How to Keep Hackers Out of your Web Application Michael Solomon, CISSP PMP CISM Solomon Consulting Inc. www.solomonconsulting.com What is a Web Application? Any access to your data via the Internet

More information