Martin Kruliš 2. 4. 2015 by Martin Kruliš (v1.0)1.

Slides:



Advertisements
Similar presentations
Closing the Gap: Analyzing the Limitations of Web Application Vulnerability Scanners David Shelly Randy Marchany Joseph Tront Virginia Polytechnic Institute.
Advertisements

Chapter 17: WEB COMPONENTS
SEC835 OWASP Top Ten Project.
Topic 8: Secure communication in mobile devices. Choice of secure communication protocols, leveraging SSL for remote authentication and using HTTPS for.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
©2009 Justin C. Klein Keane PHP Code Auditing Session 7 Sessions and Cookies Justin C. Klein Keane
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
The 10 Most Critical Web Application Security Vulnerabilities
Designing Security In Web Applications Andrew Tomkowiak 10/8/2013 UW-Platteville Software Engineering Department
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
D ATABASE S ECURITY Proposed by Abdulrahman Aldekhelallah University of Scranton – CS521 Spring2015.
Introduction to InfoSec – Recitation 8 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
OWASP Zed Attack Proxy Project Lead
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
Introduction to InfoSec – Recitation 7 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
CSCI 6962: Server-side Design and Programming Secure Web Programming.
1-Vulnerabilities 2-Hackers 3-Categories of attacks 4-What a malicious hacker do? 5-Security mechanisms 6-HTTP Web Servers 7-Web applications attacks.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
CSC 2720 Building Web Applications Web Application Security.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
CSE 154 LECTURE 12: COOKIES. Including files: include include("filename"); PHP include("header.html"); include("shared-code.php"); PHP inserts the entire.
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
CGI Security COEN 351. CGI Security Security holes are exploited by user input. We need to check user input against Buffer overflows etc. that cause a.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Oracle Application Express Security. © 2009 Oracle Corporation Authentication Out-of-the-Box Pre-Configured Schemes LDAP Directory credentials Oracle.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
School of Computing and Information Systems CS 371 Web Application Programming Security Avoiding and Preventing Attacks.
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
Chapter 6: Authentications. Training Course, CS, NCTU 2 Overview  Getting Username and Password  Verifying Username and Password  Keeping The Verification.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
SEC835 Runtime authentication Secure session management Secure use of cryptomaterials.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Building Secure Web Applications With ASP.Net MVC.
Web Database Programming Week 7 Session Management & Authentication.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
PHP-based Authentication
Lesson 19-E-Commerce Security Needs. Overview Understand e-commerce services. Understand the importance of availability. Implement client-side security.
PHP Secure Communications Web Technologies Computing Science Thompson Rivers University.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 9 1COMP9321, 15s2, Week.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
OWASP Building Secure Web Applications And the OWASP top 10 vulnerabilities.
Web2.0 Secure Development Practice Bruce Xia
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
Session Management Tyler Moore CS7403 University of Tulsa Slides adapted in part or whole from Dan Boneh, Stanford CS155 1.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Introduction to Dynamic Web Programming
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
World Wide Web policy.
CS 371 Web Application Programming
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
CSC 495/583 Topics of Software Security Intro to Web Security
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
PHP Forms and Databases.
Lecture 27 Security I April 4, 2018 Open news web sites.
Fast-Track UiPath Developer Module 10: Sensitive Data Handling
Presentation transcript:

Martin Kruliš by Martin Kruliš (v1.0)1

by Martin Kruliš (v1.0)2

 Single Point of Entry ◦ One bootstrap script (e.g., index.php )  Per application or service, not per page  Including Scripts ◦ Declarations only, no effective code ◦ Not directly accessible by web server  In separate directory, blocked by.htaccess ◦ Included only once  include_once(), require_once(), autoloading ◦ Exceptions  Only very few – e.g., HTML templates by Martin Kruliš (v1.0)3

 HTTP ◦ Built on TCP, not encrypted  HTTPS ◦ Encrypted data transfers ◦ TSL layer between TCP and HTTP ◦ Matter of web-server configuration  And SSL certificate selection ◦ Ensuring secure connection  Verify whether $_SERVER['HTTPS'] == 'on';  Redirect in case of failure (to URL) ◦ Encryption is not everything … by Martin Kruliš (v1.0)4

 HTTPS ◦ Not all powerful, handle the contents carefully ◦ Often rely on correctness of 3 rd party libraries  Like OpenSSL ◦ Based on the hope that factorization-based cryptography is secure ◦ History taught us to be caution…  CCS Injection Vulnerability  Heartbleed bug  Poodle bug  Predictable keys vulnerability (Debian)  … by Martin Kruliš (v1.0)5

 Script Parameters ◦ GET (from URL) and POST  Usage of $_REQUEST array is not recommended ◦ Ensuring integrity  All incoming parameters need to be validated  By regular expressions, by conversion to numeric types, …  User can easily modify URL or hidden form fields ◦ Prevent sensitive data caching/resending  POSTed data are cached by browser  Can be correctly solved by using redirect after each POST query by Martin Kruliš (v1.0)6

 Securing the Database System ◦ DBMS must be in the “trusted base”  Particular problem for cloud applications ◦ Separate account for PHP script  With minimal rights ◦ Frequent backups  Sensitive Data ◦ Encrypted or hashed by a strong hashing function ,hashfnc(, ) ◦ PHP has built-in functions for password hashing  crypt(), password_hash(), password_verify() by Martin Kruliš (v1.0)7 PHP 5.5

 Database Inputs ◦ Possibility of SQL injection attack ◦ Sanitize ALL user inputs  Preferably use prepared queries and variable binding by Martin Kruliš (v1.0)8 (Exploits of a Mom)

 HTML (JavaScript) Injection ◦ User provided inputs are inserted into HTML ◦ Code can be inserted in tag  JavaScript can read cookies and send them ◦ htmlspecialchars() – sanitizes data for HTML  PHP Injection ◦ Data are used in eval(), include(), require(), …  Shell Injection ◦ Data are used in system(), exec(), shell_exec(), … by Martin Kruliš (v1.0)9

 Authentication Process ◦ Verifies identity of a user (e.g., by login-passwd) ◦ The greatest challenge is to keep the information  HTTP is stateless, IP verification is not enough  Authentication must be repeated with each request  Without user’s interaction  Authentication Solution ◦ Authentication tokens must be saved on both sides  Slightly complicated on the client side ◦ Tokens must not be stolen  Big issue in web browser security by Martin Kruliš (v1.0)10

 Problem of Cross Site Scripting (XSS) ◦ Malicious client-side script injected in the page ◦ Copies security tokens and sends them to attacker ◦ Attacker uses the tokens to assume the identity  Protection Guidelines ◦ Secure connection ◦ Data are sanitized before inserted into HTML ◦ Protecting cookies from XSS (HttpOnly flag) ◦ Additional Techniques  Security tokens have expiration time  IP (browser) verification, multiple security tokens, … by Martin Kruliš (v1.0)11

 Authentication Embedded in HTTP ◦ If the auth. information are provided, they are in  $_SERVER['PHP_AUTH_USER']  $_SERVER['PHP_AUTH_PW'] ◦ The script can request authentication data header('WWW-Authenticate: Basic realm="Auth test"'); header('HTTP/ Unauthorized'); exit; ◦ Potential problems  Password is sent with every request  Logout operation is not very well defined by Martin Kruliš (v1.0)12

 Authorization ◦ Process of verification access rights of the user  Security Model ◦ Defines protected objects, authorities, operations ◦ Simple (state-less) models  Function (object, authority, operation) -> yes/no ◦ More complex models exist  Implementation ◦ Single module (class, function, …) ◦ Two phase verification (when the controls are rendered and when the action is performed) by Martin Kruliš (v1.0)13

 Directory (Capability List) ◦ Authorities have lists of accessible objects  Access List ◦ Protected objects have lists of users (+permissions)  Access Control Matrix ◦ Matrix Authorities-Objects, each item describes access restrictions  Bell-La Padula ◦ Each authority has level of access, each object has minimal required level of access by Martin Kruliš (v1.0)14

 Minimal Rights Principle ◦ Permissions are explicit, denials are implicit  Aggregation of Permissions ◦ User groups (e.g., as in unix systems)  Group permissions are inherited by members ◦ Security Roles  Security templates adopted by users ◦ Capabilities  (Temporary) permissions – like a cinema ticket  Usually used in combination with more complex verifications (that are computationally demanding) by Martin Kruliš (v1.0)15

 Backups and Logs ◦ Backups are useful not only for security breaches ◦ Responsibility tracking is also important  Software Updates ◦ Some exploits uses bugs in PHP, web server, or the database management system  Be Tidy ◦ Remove old information from URLs, cookies, … ◦ Destroy sessions when no longer used ◦ Restrict access to unnecessary files, data, … by Martin Kruliš (v1.0)16

by Martin Kruliš (v1.0)17