Search code examples
securitycoldfusioncoldfusion-8

Coldfusion security issue...how to hide directory of files?


So, I decided to try to break my website...I googled my site by typing in site:mysite.com/whatever and behold, all of the users uploaded files were available for view under a specific directory.

What kind of script/ counter measure should I use to block these files from being viewed? I already have a script that checks the path and the logged in status, however this doesn't seem to be working. I've looked all over for solutions...but I can't quite find one. I'm using ColdFusion 8.


Solution

  • This isn't a ColdFusion issue so much as a web server configuration issue.

    You should either:

    • configure your web server not to show a directory of files when using a URL without a filename (e.g., http://www.example.com/files/)

    • drop a blank default web document (index.html, index.htm, default.htm, index.cfm, whatever) into that directory so that it displays that document rather than the list of files. If you use index.cfm, it'll fire your Application.cfm/cfc in your file path and use whatever other security you've built.

    (or, better, do both)