Subscribe: Pete Freitag's Homepage
Added By: Feedage Forager Feedage Grade B rated
Language: English
apache catalina  apache  coldfusion filter  coldfusion  invoke  java coldfusion  java org  java  org apache  org  session 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Pete Freitag's Homepage

Pete Freitag's Homepage

Covering ColdFusion, Java, Web Development, and other topics

Last Build Date: Tue, 04 Apr 2017 22:14:00 GMT


Upcoming CFML Conferences in April 2017

Tue, 04 Apr 2017 22:14:00 GMT

I will be speaking at two conferences this month.

The conference is the Adobe CFSummit East also known as the Adobe ColdFusion Government Summit. It will be held on April 18-19, 2017 in Washington DC. The first day is two half day hands on sessions, I will be presenting the first session which is a CFML security training class (sold out). On day two I will be presenting a 1hr session: Bulletproof Your Adobe ColdFusion Server with the Lockdown Guide.

This conference is free to attend, so if you are on the east cost it may be worth it to consider attending. Other speakers besides myself include: Rakshith Naresh, Giancarlo Gomez, Matt Hintze, Elishia Dvorak, Charlie Arehart, Dan Wilson, Nolan Erck, Masha Edelen, and Dan Fredericks. The opening keynote will be given by Tridib Roy Chowdhury & Steve Drucker. My company Foundeo Inc. is a sponsor of the event.

The following week is the Into the Box Conference. This conferences is loaded with tons of great speakers and should be a really good place to learn the latest techniques for modern CFML development. While the conference organized on by the makers of the ColdBox framework, you don't need to use ColdBox to get a lot out of this conference. Many of the tools in the Box ecosystem can be utilized on their own and can provide great benefits to developers. Take for example CommandBox, if you are not using this tool spend 5 minutes looking into it right now and find out why you should be.

At Into the Box I will be speaking on Securing CFML Codebases, a look at techniques to improve the security of your existing CFML codebase.

CFSummit 2016 Slides

Tue, 18 Oct 2016 01:02:00 GMT

Here are my slides from the Adobe ColdFusion Summit 2016 conference in Las Vegas:

The conference appeared to be a great success with about 500 people in attendance. My company Foundeo Inc. was a Gold Sponsor again this year. I met a lot of great ColdFusion developers, thanks for saying hello.

I also presented a full day pre-conference workshop on CFML Security along with Dave Epler. This session went very well and was sold out at 50 people. For this session (and other CFML security training classes I teach) I built a CFML web application called Bank of Insecurity you can find the code on github here.

Securing Legacy CFML - dev.Objective() 2016 Slides

Mon, 20 Jun 2016 23:10:00 GMT

Back from another great dev.Objective() conference in Minneapollis. This year Foundeo was a sponsor, and I spoke on Securing Legacy CFML Code. Find the slides here.

My CFSummit 2015 Slide Decks

Fri, 13 Nov 2015 02:05:00 GMT

I was fortunate enough to be able to do two different talks this year at the Adobe CFSummit 2015 conference.

My first session, was a hands on Pre-Conference workshop taught by David Epler and myself, it was titled: Hack & Fix - Hands on ColdFusion Security Training. This was a 3 hour workshop which had a VM preloaded with the hackable CFML training app: HackableType that was first created by Jason Dean and I in 2010. Students then try to hack the vulnerable code, and then fix it. It went very well thanks to David, and all who attended!

Hack & Fix - Hands on ColdFusion Security Training - View Slides

For my second session I presented on Locking down ColdFusion Servers, an overview of the ColdFusion 11 Lockdown Guide. View Slides

My company Foundeo was a Gold sponsor of CFSummit 2015. I enjoyed meeting lots of our HackMyCF and FuseGuard customers and hopefully a few soon to be customers!

Adding Chrome Custom Search for CFDocs

Fri, 16 Oct 2015 20:07:00 GMT

I read some complaints recently that the new Adobe documentation site is not friendly with a chrome custom search engine (because the URIs are different based on what the tag/function starts with).

If you want to setup a custom search engine in chrome, it is really easy:

  1. Using Chrome go to chrome://settings/searchEngines
  2. Scroll down to an empty text box that says Add a new search engine
  3. In the first box type in the second box type cf and in the third box type

Now type cf followed by a space in the address bar, and then a tag or function name.

Disable Flash Remoting on ColdFusion Servers

Thu, 03 Sep 2015 20:37:00 GMT

Due to the recent security vulnerability ABSP15-20 / APSB15-21 in BlazeDS there has been increased interest in disabling flash remoting when not needed -- if you followed the lockdown guide for CF9, CF10, or CF11 you should already have it disabled. This only applies to ColdFusion 10 and ColdFusion 11 right? Nope! Your ColdFusion 7-9 servers may also be vulnerable to this issue but since they are considered EOL or End Of Life, they are no longer supported or patched by Adobe so there is no hotfix to apply. If you do need flash remoting on these servers you can manually update the flex-messaging-core.jar file in your lib directory. I tested this on a CF 9.0.2 server tested that it worked by using the ColdFusion Server Monitor. David Epler has posted some instructions for manually patching a CF9 server. How can I disable Flash Remoting on ColdFusion Servers There are a few ways this can be accomplished, I recommending doing each way to provide layers of assurance or defense in depth. Uncheck: Enable Flash Remoting in ColdFusion Administrator - this is the easiest way to go, but I don't trust this method to fully disable anything that might be vulnerable to a security issue. Block URIs on your web server web server blocks are always my favorite approach because they are blocked before hitting the CF server at all, they are the most efficient way to protect resources in most cases. If you are using IIS 7+ you can block (if you are using IIS6 or lower you are running an EOL operating system with many other security issues to consider, time to upgrade!) using Request Filtering. It can run on a per site basis or on a global basis - for security rules like this it makes sense to run them on a global basis. Click on the URL tab and then Deny Url Sequence to add the following URIs to block, test them out in your browser to make sure you get a 404: /flex2gateway /flashservices /flex-internal /CFFormGateway /cfform-internal To block them on Apache you could do something like this globally in httpd.conf: RedirectMatch 404 (?i).*/flex2gateway.* RedirectMatch 404 (?i).*/flashservices.* RedirectMatch 404 (?i).*/flex-internal.* RedirectMatch 404 (?i).*/cfformgateway.* RedirectMatch 404 (?i).*/cfform-internal.* Using nginx you can do something like this (thanks Joseph Lamoree) : location ~* ^/(flex2gateway|flashservices|flex-internal|CFFormGateway|cfform-internal|messagebroker) { return 403; } Keep in mind that when blocking only on the web server Flash Remoting is still enabled so you could still use the server monitor over the Internal Web Server, or if you have it running on its own port. Disable by Removing Servlet Mappings Removing Servlet Mappings removes the URL pattern to Servlet (the java code that executes requests) definition at the JEE servlet container level. It is done by editing the web.xml file found in the WEB-INF folder. You can either delete the ... tag or comment it out with an <-- XML comment --> (only uses two dashes). Here's an example of a servlet mapping on CF9: MessageBrokerServlet /flex2gateway/* You can also disable the servlet mappings that have the following URL patterns: /flashservices/gateway/* /flex-internal/* /CFFormGateway/* /cfform-internal/* You can also remove the Servlets that correspond to these servlet-mapping but I have seen cases where CF would not start due to removing a servlet that is expected to be there. Removing unnecessary servlets can improve your CF server startup time and potentially reduce resource utilization, so it may be worth experimenting with for you. What if I am running Railo / Lucee There is a good chance your server could also be vulnerable to this issue, because m[...]

HackMyCF Adds SSL/TLS Scanner

Wed, 27 May 2015 20:37:00 GMT

I'm pleased to announce a feature of HackMyCF that I've been excited about for a while: SSL / TLS Scanning.

If you stay up to date with security news you know that there have been a large number of vulnerabilities or weaknesses discovered in SSL or TLS protocols and implementations. For example, we have LogJam, Heartbleed, POODLE, CRIME, BEAST, and those are just the ones with cool names :)

While we have been issuing warnings when SSLv2 and SSLv3 (poodle) are enabled for a while, but here are some of the new checks we have added:

  • Warn if TLS 1.2 is not enabled
  • LogJam: Weak DH Group Size (less than 2048 bits) and some common prime warnings (not fully inclusive)
  • Warn if SSL Certificate will expire soon, or is expired
  • Warn if certificate is signed with SHA1 (will cause warnings/errors in recent Chrome versions)
  • Warn if TLS compression is enabled (CRIME)
  • Test for OpenSSL Heartbleed vulnerability
  • Warn if Public Key Size less than 2048 bits

Here's a screenshot from an example HackMyCF report:

Customers can enable this feature if they have set protocol = HTTPS in their server settings.

IncompatibleClassChangeError after ColdFusion 11 Update 5

Mon, 20 Apr 2015 23:24:00 GMT

If you use the Encrypt function in ColdFusion 11, you may experience an error that looks like this: java.lang.IncompatibleClassChangeError: Expected static method coldfusion.runtime.CFPage.Encrypt(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at cfprobe2ecfm877726397._factor9(/hackmycf/probe.cfm:258) at cfprobe2ecfm877726397.runPage(/hackmycf/probe.cfm:1) at coldfusion.runtime.CfJspPage.invoke( at coldfusion.tagext.lang.IncludeTag.handlePageInvoke( at coldfusion.tagext.lang.IncludeTag.doStartTag( at coldfusion.filter.CfincludeFilter.invoke( at coldfusion.filter.IpFilter.invoke( at coldfusion.filter.ApplicationFilter.invoke( at coldfusion.filter.RequestMonitorFilter.invoke( at coldfusion.filter.MonitoringFilter.invoke( at coldfusion.filter.PathFilter.invoke( at coldfusion.filter.LicenseFilter.invoke( at coldfusion.filter.ExceptionFilter.invoke( at coldfusion.filter.ClientScopePersistenceFilter.invoke( at coldfusion.filter.BrowserFilter.invoke( at coldfusion.filter.NoCacheFilter.invoke( at coldfusion.filter.GlobalsFilter.invoke( at coldfusion.filter.DatasourceFilter.invoke( at coldfusion.filter.CachingFilter.invoke( at coldfusion.CfmServlet.service( at coldfusion.bootstrap.BootstrapServlet.service( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at coldfusion.monitor.event.MonitoringServletFilter.doFilter( at coldfusion.bootstrap.BootstrapFilter.doFilter( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter( at coldfusion.bootstrap.BootstrapFilter.doFilter( at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( at org.apache.catalina.core.ApplicationFilterChain.doFilter( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.authenticator.AuthenticatorBase.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.valves.ErrorReportValve.invoke( at org.apache.catalina.core.StandardEngineValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.service( at org.apache.coyote.http11.AbstractHttp11Processor.process( at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process( at$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at org.apache.tomcat.util.threads.TaskThread$ at The solution is to clear the Template Cache, this is done quite easily in the ColdFusion adminis[...]

Scope Injection in CFML

Tue, 03 Mar 2015 22:59:00 GMT

Here is an interesting vulnerability that I have come across several times in real CFML code during code reviews, I have spoken about it at conferences but have never written about it. Since it doesn't really have a name, I call it Scope Injection, you'll see why in a minute. We have the following code: Do something only an admin can do... Now lets suppose that this session.isAdmin is set upon a successful authentication, but for unauthenticated sessions isAdmin is undefined in the session scope (onSessionStart does not initialize it). Now suppose a request to the above code like this: /admin/something.cfm?session.isAdmin=1 What happens when the above code example is run: CF checks to see if session.isAdmin is defined in the session scope The variable session.isAdmin was not defined in the session scope, so it starts searching other scopes, such as the url scope. CF finds url.session.isAdmin defined and uses that value to evaluate the if statement as true. Code that should only be executed by an admin can actually be executed by anyone. Mitigating Scope Injection in CFML To mitigate this, you should make sure that variables are initialized properly, a good place to do this is in your Application.cfc event lifecycle methods, onSessionStart for session scoped variables, onApplicationStart for application scoped variables, onRequestStart for request scope variables, etc. So to mitigate this issue, we simply need this: If you are extra paranoid you can also use StructKeyExists to make sure the variable is defined: do admin stuff ColdFusion 2016 Enhancement The ColdFusion 2016 release added a new Application.cfc level setting this.searchImplicitScopes which defaults to true for backwards compatibility. If you set it to false it will only search the variables, local and arguments scopes when a scope is unspecified on a variable. Scope Injection in Railo / Lucee This particular example is not vulnerable in the version of Railo / Lucee I tested, apparently because it does not allow cascading on builtin scopes. You can still have a scope injection issue on variables that are not in a builtin scope, consider this: do admin stuff There is also a setting in the Railo / Lucee administrator that allows you to turn off cascading (under scopes) by setting it to strict. You can also do this in your Application.cfc: this.scopeCascading = "strict"; When the scopeCascading setting is set to strict it removes the possibility of a scope injection vulnerability, and may also improve performance. How FuseGuard protects from Scope Injection FuseGuard customers have been enjoying protection from scope injection for the past 3 years. It operates in a strict mode by default which prevents inputs like, with strict mode off it only looks at valid scope names (like session, application, etc). As of version 2.3 you can also set a prefix to ignore, for example fusebox apps commonly have url's like ?fusebox.action=foo so you can tell FuseGuard to allow that by adding: filter.setIgnorePrefixList("fusebox"); You can also ignore a variable a-la-carte like this: filter.ignoreVariable("url", "one.two"); [...]

Upload Files Directly to Amazon S3 using ColdFusion

Wed, 26 Nov 2014 22:19:00 GMT

Here's a quick example showing how to upload a file directly to Amazon S3 (bypassing your server). The tricky part in getting this to work is that you don't want to allow anyone to upload a file anywhere on your S3. To accomplish this you can create an AWS Access Control Policy, base64 encode it, and then sign it using HMAC-SHA1 with your AWS Secret Key. A policy is a JSON string that might look like this: { "expiration": "2014-11-26T13:23:00.000Z", "conditions": [ {"bucket": "example-bucket-name" }, ["eq", "$key", "image.jpg"], {"acl": "public-read" }, {"redirect": "" }, ["starts-with", "$Content-Type", "image/"] ] } To generate this policy dynamically we might do something like this: { "expiration": "#DateFormat(expDate, "yyyy-mm-dd")#T#TimeFormat(expDate, "HH:mm")#:00.000Z", "conditions": [ {"bucket": "example-bucket-name" }, ["eq", "$key", "#JSStringFormat(fileName)#"], {"acl": "public-read" }, {"redirect": "" }, ["content-length-range", 1, 1048576], ["starts-with", "$Content-Type", "image/"] ] } Because we are using the HMac function you must be on CF10+ or Railo 4.1+ if you are on an older version you will need to find a third party hmac implementation. Next you create a form that posts directly to Amazon S3:
According to the S3 documentation there are some conditions in which the redirect will not happen: Please note that the redirect is not guaranteed to be followed. It is possible that an upload would succeed, but that a networking problem on the end-users network prevents them from following the redirect. It is also possible that in certain failure conditions, that a file is actually uploaded but you are not notified about the upload. To get around this uncertainty you can setup Event Notifications for the S3 bucket you are uploading to. The other thing to note is that if an error occurs the redirect will not happen and the user will be presented with an XML error message. To handle that more gracefully you could upload the file via AJAX, and then handle the error condition within JavaScript. [...]