Building Secure ColdFusion Applications

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Cross-site Request Forgery (CSRF) Attacks
Web Security Never, ever, trust user inputs Supankar.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
EECS 354 Network Security Cross Site Scripting (XSS)
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Introduction to the OWASP Top 10. Cross Site Scripting (XSS)  Comes in several flavors:  Stored  Reflective  DOM-Based.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
PHP Security.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Lecture 16. OWASP: The Open Web Application Security Project
Security.NET Chapter 1. How Do Attacks Occur? Stages of attack Examples of attacker actions 1. FootprintRuns a port scan on the firewall 2. PenetrationExploits.
Prevent Cross-Site Scripting (XSS) attack
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
1 Maryland ColdFusion User Group Session Management December 2001 Michael Schuler
Cross-Site Attacks James Walden Northern Kentucky University.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
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.
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking SoftUni Team Technical Trainers Software University
Crash Course in Web Hacking
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Writing secure Flex applications  MXML tags with security restrictions  Disabling viewSourceURL  Remove sensitive information from SWF files  Input.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Introduction to Dynamic Web Programming
TOPIC: Web Security (Part-4)
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
World Wide Web policy.
API Security Auditing Be Aware,Be Safe
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.
Cross-Site Forgery
Riding Someone Else’s Wave with CSRF
CSC 495/583 Topics of Software Security Intro to Web Security
Cross-Site Request Forgery (CSRF) Attack Lab
Web Security Advanced Network Security Peter Reiher August, 2014
Lecture 2 - SQL Injection
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
Cross Site Request Forgery New Attacks and Defenses
Security: Exploits & Countermeasures
PHP Forms and Databases.
Lecture 27 Security I April 4, 2018 Open news web sites.
Security: Attacks & Countermeasures
Cross-Site Scripting Attack (XSS)
Cross Site Request Forgery (CSRF)
Presentation transcript:

Building Secure ColdFusion Applications Presented By Pete Freitag Principal Consultant, Foundeo Inc.

The Plan: Unchecked Input File Uploads XSS - Cross Site Scripting SQL Injection Cross Site Request Forgery CRLF Injection Session Hijacking

A Hot Topic Source: http://cwe.mitre.org/documents/vuln-trends.html#table1

Unchecked Input The Cause of Most Security Problems Server Side Validation IsValid Function Regular Expressions

What Are The Inputs? URL Variables FORM Variables Cookies HTTP Request Headers (CGI Scope) User Agent Referrer Other Headers

Uploading Files A common task that can be very dangerous.

Example: File Uploads

Best Practices for File Uploads Upload to a directory outside the web root or to a static content server. Always Check the File Extension cffile.serverFileExt Use the “accept” attribute, but never trust it.

Cross Site Scripting Attacker crafts a request that executes a client side script. Usually JavaScript Flash Applet IFRAME ActiveX

What’s So Bad About XSS Stealing Cookies Phishing

XSS Examples

ScriptProtect ColdFusion MX 7 Introduced ScriptProtect feature. Catches many but not all XSS attacks. Enabled globally or at the application level. Configurable Regular Expressions WEB-INF/cfusion/lib/neo-security.xml

Preventing XSS Escape HTML Tags and Quotes XMLFormat() Escapes double quotes, single quotes and <tags>. HTMLEditFormat() Escapes <tags> and double quotes but not single quotes.

SQL Injection Very Dangerous Very Easy to Prevent Execute ANY SQL Statement Or ANY Program! xp_cmdshell Very Easy to Prevent

Classic SQL Injection Example <cfquery datasource=”db” name=”news”> SELECT title, story FROM news WHERE id = #url.id# </cfquery> /news.cfm?id=8;DELETE+FROM+news

Preventing SQL Injection <cfquery datasource=”db” name=”news”> SELECT title, story FROM news WHERE id = <cfqueryparam value=”#url.id#” cfsqltype=”cf_sql_integer”> </cfquery>

CFQUERYPARAM Can and should be used in WHERE Clauses INSERT Statements UPDATE Statements All variables in your query Where allowed

Cross Site Request Forgery How “samy”, a MySpace user made 1 million friends in less than 20 hours.

Cross Site Request Forgery Samy found a clever way to execute javascript on his MySpace profile page. Whenever a MySpace user visited his profile samy’s script would add himself as a friend on their profile. For a few hours Samy caused MySpace to shut down for “maintenance”.

Cross Site Request Forgery Takes advantage of a logged in user. Performs a privileged action on their behalf.

CSRF + XSS You don’t need an XSS hole to perform a Cross Site Request Forgery (CSRF). However, with an XSS hole, HTTP POST requests can be executed behind the scenes with AJAX. CSRF could be performed by an IFRAME on a malicious web site.

Mitigating CSRF Attacks Server Side Confirmations Require HTTP POST when performing operations. Don’t allow foreign HTTP referrers. Require password for sensitive operations. Include a hash in the form based on authenticated user’s credentials.

CRLF Injection CRLF = Chr(13) & Chr(10) CFHEADER <cfheader name=”Content-Type” value=”#url.type#”>

Session Hijacking If an attacker knows a user’s session id(s) (CFTOKEN & CFID) they can impersonate the user.

Ways Session ID’s are Compromised Passing CFID & CFTOKEN in query string. CFLOCATION does this by default, use addtoken=”false” Cookies can be stolen with cross site scripting attacks. Traffic sniffing

Ways to Prevent Hijacking Use SSL Don’t put session ids in the URL Use long session ids Enable “Use UUID for CFTOKENs” Integrity checking

Don’t Disclose Server Details Error messages may show: File Paths Source Code Database Table and Column Names Use a Global Error Handler or CFERROR

Require SSL / HTTPS Prevent sniffing Browsers run at a higher security level lowering success rates on some attacks. Secure cookies <cfcookie secure=”true” ...>

In Short: Validate Inputs!!

Thanks. Questions? www.petefreitag.com www.foundeo.com