Welcome to Cactus Juice Sign in | Join | Help

Cameron Scholtz's Blog

Enthusiasm Always Wins
Reminder About File Extension Renaming

Just a friendly security reminder. Do not rename your server-executable file extensions. I still come across this developer faux pas all too frequently--on production web sites. Someone reading this post does it. If I've saved just one web developer then this post was all worth it, haha.

If you rename your .JSP, .ASP, .ASPX, .CFM (etc.) files then the web server will no longer recognize the file for what it is -- a server-executable script. Your page won't run. And that might have been your plan. However, just because the page won't run doesn't mean the server won't still send back the content! And therein lies the security issue. If someone requests your renamed page the server is going to give it to them...as verbatim text! Not good. Unless you're an exhibitionist.

Suffices to say it is a much better idea to use source control software and branch your changes or whatever within that. Unfortunately in the real world (ASU) we'll all eventually run into code that is outside of version control. If you are on a project that does not provide source control then rename your file descriptively. No need to abbreviate, this is 2006 baby!

Example:

stuff.jsp can be renamed to: stuff - before database change.jsp

MyPage.asp can be renamed to: MyPage without new graphics.asp

This will keep your code safe and (extra credit) any future developers looking at the old page will quickly have an idea why it was renamed.

Posted: Wednesday, September 06, 2006 3:22 PM by Cameron

Comments

No Comments

Anonymous comments are disabled