Protect your plugins!
One of the things I love about EPiServer is how easy it is to extend. I’m sure that most of the EPiServer projects out there uses some kind of edit or admin plugin.
What we see very often, is that these plugins are not under EPiServer authorization. In effect, If you know the url to the plugin .aspx, you can browse it directly anonymously!
So, how can we be sure that the plugins are secured?
Well, any of the solutions below should solve the problem.
Safest bet: Check access from code when aspx loads
This is a sample from an admin plugin. Your .aspx need to inherit from an EPiServer PageBase class (e.g. EPiServer.SimplePage) in order to use the AccessDenied method.
Using the location tag in web.config
This is the same way EPiServer secures it’s admin and edit mode. Remember to add this section in all environments – development, test and especially at the production server. You can also place your plugin the same place as the EPiServer UI, but this complicates module packaging (as the UI paths will differ from project to project).
There is also the option of adding a web.config file at the same level as the .aspx file(s). An example implementation can be found here: web.config for the EPiCode.PageTypeUtil module.
Important: Using the ICustomPlugInLoader interface (see description here) will not secure your aspx.
Use 5 minutes today to verify that your plugins are secure - this also includes any module plugins downloaded from CodePlex, EPiCode or the Code section on world.episerver.com.