SlideShare a Scribd company logo
This is matter
My Name is Pritesh Patel working as Technical Project
Manager at iSummation Technologies Pvt. Ltd.
Twitter: @thecfguy
Blog: http://www.thecfguy.com
1.
2.
3.
4.
5.

6.
7.
8.
9.

10.

Injection
Broken Authentication And Session Management
Cross-Site Scripting (XSS)
Insecure Direct object references
Security Misconfiguration
Sensitive Data Exposure
Missing Function level access control
Cross-Site Request Forgery (CSRF)
Using Components with Known Vulnerabilities
Unvalidated Redirects and Forwards
 It’s security team duty to find it out. I am developer,

why should I care about?
 Site doesn’t have important data to hide.
 There is negligible change to attack on my site out of
millions of websites.
 To give little relax to your security team as gift.
 Every sites data is important or other sites hosted on

same server has.
 We always hope to win Jackpot out of billion, who
know you are lucky winner amongst millions.
 You should care for your/your company better
impression.
Security with ColdFusion
 Injection can be done at SQL, OS or LDAP but a web







developer SQL injection will discuss.
Best way to prevent it is, use <cfqueryparam> tag all your
dynamic value of query (or user input).
Use stored procedure as much as possible.
Escaping all user supplied input wherever you are not using
cfqueryparam.
Remove unnecessary previlige for ColdFusion datasource
from “Advance Setting”.
You can simply use ESAPI (now available with ColdFusion
9 latest patch) and encodeForSQL() function.



<cfset esapi = CreateObject("java", "org.owasp.esapi.ESAPI").encoder()>
<cfset esapi.encodeForSQL(org.owasp.esapi.codecs.Codec codec, java.lang.String input) )>










Keep username case INsensitive. (not for security but for user comfort.
Set password minimum length not shorter than 10 characters.
Maximum length should not be less than 20 characters.
Force for complex password.
On multiple incorrect attempt verify input placed by human.
Never store password in plain text, you did that right?
Re-authenticate on sensitive feature. (Like change password, delete account, edit account information
or payment information).
Use generic error message instead of indicating what exactly wrong.


Incorrect





Correct









“Test is wrong username”.
“Supplied password is wrong”.
“Login Failed: Incorrect username or password”.

User UUID for CFTOKEN.
Enable Jsession Id
Use httpOnly for session cookie.
Minimize session idle timeout.
Do not cache webpage for important information. Force page refresh when using through browser
back button.
 This javascript based attack. Easy to attack on any site and







hard to prevent it.
Simple rule to avoid XSS “Never trust on user input”.
Demo
ColdFusion 10 coming with inbuilt function based on
ESAPI to avoid XSS attack. ColdFusion 9 latest patch
already have ESAPI included in so you can create ESAPI
object and use it wherever needed.
Useful functions:





Encodeforhtml()
Encodeforhtmlattribute()
Encodeforcss()
Encodeforjavascript()
 Sometime we supply crucial information in URL

param without knowing importance.
 For ex.:
http://www.example.com/customer/userinvoice.cfm?i
nvoiceid=1233
 How to avoid:
 Add additional hashed key with passed parameters

which generated with user session id and compare
before giving access.
 Keep your software updated with latest patches.
 Always use custom error page instead of showing

stacktrace.
 Keep setting different for development and
production. And it should auto detect by IP/domain
instead of manual change.
 Disabled directory listing on your web application.
 Store your sensitive data (password, credit card) always

in encrypted format.
 Forced SSL redirection for non public page.
 Store sensitive data only if needed.
 Disable auto complete form for collecting sensitive
data and of course disabled caching of page.
 It is little similar to “Insecure Direct object References”.

Instead of form/url parameter look for full URL is also
have access control.
 http://www.example.com/guest/profile
 http://www.example.com/user/profile
 Implement role based security for each functionality.
 This attack allow to use functionality of user’s








authenticated area without knowing user’s permission.
Demo
Add CSRFToken to every request and compare it.
Use POST instead of GET method (though is not going to
prevent attack)
Check the referrer header. (This can be spoofed as well)
Check origin header. Unlike referer HTTP origin will be
present in HTTP request that originates from HTTPS url.
Challenge-Response:
 Captcha
 Re-Authenticate
 One-Time token
 World with lots of vulnerabilities. Before using any

third party component or software make sure
component do not have any known vulnerabilities.
 Monitor security patches or version release for your
components.
 Imagine if your user redirect to some malware site if






click on “next” button.
Sometime we use page to redirect. E.g.
http://www.example.com/redirect.cfm?nexturl=badgu
yssite.com
Try to avoid redirect/forward page.
Do not use user input for redirection parameter.
Fully validate url where you are redirecting.

More Related Content

PDF
Pentesting RESTful webservices
PDF
In graph we trust: Microservices, GraphQL and security challenges
PPTX
A2 - broken authentication and session management(OWASP thailand chapter Apri...
PPTX
Cross site request forgery(csrf)
PDF
Esoteric xss payloads
PPTX
Make profit with UI-Redressing attacks.
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
ODP
Top 10 Web Security Vulnerabilities
Pentesting RESTful webservices
In graph we trust: Microservices, GraphQL and security challenges
A2 - broken authentication and session management(OWASP thailand chapter Apri...
Cross site request forgery(csrf)
Esoteric xss payloads
Make profit with UI-Redressing attacks.
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities

What's hot (20)

PPTX
Avoiding Cross Site Scripting - Not as easy as you might think
PPTX
OWASP Khartoum Top 10 A3 - 6th meeting
PPTX
Beefing Up Security In ASP.NET Dot Net Bangalore 3rd meet up on May 16 2015
PPTX
Spring Security 3
PDF
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
PDF
Testing REST Web Services
PDF
XSS And SQL Injection Vulnerabilities
PPTX
Web Hacking Intro
PPTX
Unified authentication using azure acs
PDF
Common Web Application Attacks
PPTX
Pci compliance writing secure code
PPT
Spring Security Introduction
PPTX
Security asp.net application
PPT
Proxy Caches and Web Application Security
PPT
OWASP Serbia - A3 broken authentication and session management
PDF
Securty Testing For RESTful Applications
PDF
OWASPTop 10
PPTX
Spring Security
PDF
Getting Single Page Application Security Right
PPTX
Abusing Exploiting and Pwning with Firefox Addons
Avoiding Cross Site Scripting - Not as easy as you might think
OWASP Khartoum Top 10 A3 - 6th meeting
Beefing Up Security In ASP.NET Dot Net Bangalore 3rd meet up on May 16 2015
Spring Security 3
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Testing REST Web Services
XSS And SQL Injection Vulnerabilities
Web Hacking Intro
Unified authentication using azure acs
Common Web Application Attacks
Pci compliance writing secure code
Spring Security Introduction
Security asp.net application
Proxy Caches and Web Application Security
OWASP Serbia - A3 broken authentication and session management
Securty Testing For RESTful Applications
OWASPTop 10
Spring Security
Getting Single Page Application Security Right
Abusing Exploiting and Pwning with Firefox Addons
Ad

Viewers also liked (20)

PDF
Become a Security Rockstar with ColdFusion 2016
PDF
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
DOC
Ukurankul
PPSX
Cancer 2011
PPTX
Social Media Strategy
PPSX
CASA ALEGRE TERRASSA
PPTX
NTT Com Asia - Our Values
PPT
Vasse 150910 wayne
PDF
Twitter
PDF
Quick Time7 User Guide
PDF
Final faculty presentation
PPTX
인터넷마케팅 과제
PDF
Punchd: Loyalty cards on your smart phone
PDF
Gim peus
PDF
Family tree
PPT
pengurusan rekod murid
PPT
Kerajaan orang khmer
PDF
Triduo Sr. Angela Vallese_3 giorno ita
PPTX
Mayu info
PDF
Installing mandriva linux mandriva community wiki
Become a Security Rockstar with ColdFusion 2016
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
Ukurankul
Cancer 2011
Social Media Strategy
CASA ALEGRE TERRASSA
NTT Com Asia - Our Values
Vasse 150910 wayne
Twitter
Quick Time7 User Guide
Final faculty presentation
인터넷마케팅 과제
Punchd: Loyalty cards on your smart phone
Gim peus
Family tree
pengurusan rekod murid
Kerajaan orang khmer
Triduo Sr. Angela Vallese_3 giorno ita
Mayu info
Installing mandriva linux mandriva community wiki
Ad

Similar to Security with ColdFusion (20)

PPT
Top Ten Tips For Tenacious Defense In Asp.Net
PPSX
Web Security
PPT
Website Security
PPT
Website Security
PPTX
Presentation on Top 10 Vulnerabilities in Web Application
DOCX
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
PDF
Owasp top 10_openwest_2019
PDF
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
PPT
Php & Web Security - PHPXperts 2009
PPTX
Php security common 2011
ODP
Security In PHP Applications
PPT
OWASP Top10 2010
PPTX
Don't get stung - an introduction to the OWASP Top 10
PDF
Steps to mitigate Top 5 OWASP Vulnerabilities 2013
PPTX
ASP.NET Web Security
PPT
Phpnw security-20111009
PPT
Intro to Web Application Security
PPT
Jan 2008 Allup
PDF
OWASP Portland - OWASP Top 10 For JavaScript Developers
PPT
PHPUG Presentation
Top Ten Tips For Tenacious Defense In Asp.Net
Web Security
Website Security
Website Security
Presentation on Top 10 Vulnerabilities in Web Application
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
Owasp top 10_openwest_2019
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Php & Web Security - PHPXperts 2009
Php security common 2011
Security In PHP Applications
OWASP Top10 2010
Don't get stung - an introduction to the OWASP Top 10
Steps to mitigate Top 5 OWASP Vulnerabilities 2013
ASP.NET Web Security
Phpnw security-20111009
Intro to Web Application Security
Jan 2008 Allup
OWASP Portland - OWASP Top 10 For JavaScript Developers
PHPUG Presentation

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Modernizing your data center with Dell and AMD
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Modernizing your data center with Dell and AMD
“AI and Expert System Decision Support & Business Intelligence Systems”
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.

Security with ColdFusion

  • 2. My Name is Pritesh Patel working as Technical Project Manager at iSummation Technologies Pvt. Ltd. Twitter: @thecfguy Blog: http://www.thecfguy.com
  • 3. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Injection Broken Authentication And Session Management Cross-Site Scripting (XSS) Insecure Direct object references Security Misconfiguration Sensitive Data Exposure Missing Function level access control Cross-Site Request Forgery (CSRF) Using Components with Known Vulnerabilities Unvalidated Redirects and Forwards
  • 4.  It’s security team duty to find it out. I am developer, why should I care about?  Site doesn’t have important data to hide.  There is negligible change to attack on my site out of millions of websites.
  • 5.  To give little relax to your security team as gift.  Every sites data is important or other sites hosted on same server has.  We always hope to win Jackpot out of billion, who know you are lucky winner amongst millions.  You should care for your/your company better impression.
  • 7.  Injection can be done at SQL, OS or LDAP but a web      developer SQL injection will discuss. Best way to prevent it is, use <cfqueryparam> tag all your dynamic value of query (or user input). Use stored procedure as much as possible. Escaping all user supplied input wherever you are not using cfqueryparam. Remove unnecessary previlige for ColdFusion datasource from “Advance Setting”. You can simply use ESAPI (now available with ColdFusion 9 latest patch) and encodeForSQL() function.   <cfset esapi = CreateObject("java", "org.owasp.esapi.ESAPI").encoder()> <cfset esapi.encodeForSQL(org.owasp.esapi.codecs.Codec codec, java.lang.String input) )>
  • 8.         Keep username case INsensitive. (not for security but for user comfort. Set password minimum length not shorter than 10 characters. Maximum length should not be less than 20 characters. Force for complex password. On multiple incorrect attempt verify input placed by human. Never store password in plain text, you did that right? Re-authenticate on sensitive feature. (Like change password, delete account, edit account information or payment information). Use generic error message instead of indicating what exactly wrong.  Incorrect    Correct       “Test is wrong username”. “Supplied password is wrong”. “Login Failed: Incorrect username or password”. User UUID for CFTOKEN. Enable Jsession Id Use httpOnly for session cookie. Minimize session idle timeout. Do not cache webpage for important information. Force page refresh when using through browser back button.
  • 9.  This javascript based attack. Easy to attack on any site and     hard to prevent it. Simple rule to avoid XSS “Never trust on user input”. Demo ColdFusion 10 coming with inbuilt function based on ESAPI to avoid XSS attack. ColdFusion 9 latest patch already have ESAPI included in so you can create ESAPI object and use it wherever needed. Useful functions:     Encodeforhtml() Encodeforhtmlattribute() Encodeforcss() Encodeforjavascript()
  • 10.  Sometime we supply crucial information in URL param without knowing importance.  For ex.: http://www.example.com/customer/userinvoice.cfm?i nvoiceid=1233  How to avoid:  Add additional hashed key with passed parameters which generated with user session id and compare before giving access.
  • 11.  Keep your software updated with latest patches.  Always use custom error page instead of showing stacktrace.  Keep setting different for development and production. And it should auto detect by IP/domain instead of manual change.  Disabled directory listing on your web application.
  • 12.  Store your sensitive data (password, credit card) always in encrypted format.  Forced SSL redirection for non public page.  Store sensitive data only if needed.  Disable auto complete form for collecting sensitive data and of course disabled caching of page.
  • 13.  It is little similar to “Insecure Direct object References”. Instead of form/url parameter look for full URL is also have access control.  http://www.example.com/guest/profile  http://www.example.com/user/profile  Implement role based security for each functionality.
  • 14.  This attack allow to use functionality of user’s       authenticated area without knowing user’s permission. Demo Add CSRFToken to every request and compare it. Use POST instead of GET method (though is not going to prevent attack) Check the referrer header. (This can be spoofed as well) Check origin header. Unlike referer HTTP origin will be present in HTTP request that originates from HTTPS url. Challenge-Response:  Captcha  Re-Authenticate  One-Time token
  • 15.  World with lots of vulnerabilities. Before using any third party component or software make sure component do not have any known vulnerabilities.  Monitor security patches or version release for your components.
  • 16.  Imagine if your user redirect to some malware site if     click on “next” button. Sometime we use page to redirect. E.g. http://www.example.com/redirect.cfm?nexturl=badgu yssite.com Try to avoid redirect/forward page. Do not use user input for redirection parameter. Fully validate url where you are redirecting.