Security flaw in EPiServer plugins?

This post was originally published on

A colleague of mine - let's call him Erik Nilsson, since that is his name - recently came across a potential security problem when creating your own edit och admin plugin to EPiServer. Unfortunately, he's too shy to write a post about it, so I'll relay the information. If you create a plugin like this:

  Area = EPiServer.PlugIn.PlugInArea.AdminMenu,
  DisplayName = "Plugin name.",
  Description = "Plugin desc.",
  Url = "~/plugin/myplugin.aspx",
  RequiredAccess = EPiServer.Security.AccessLevel.Administer )]
public partial class MyPlugin : EPiServer.UI.SystemPageBase

You might think that this plugin in only accessable to users with administration right. This however, is only the case if you access it through the admin mode. If you access the page directly, i.e. by using the url, you can access it without even having to login. Seems EPiServer only checks the RequiredAccess in the admin or edit mode. 

So what you need to to in order to secure your plugin is to set required access for the "plugin" location in web.config:

<location path="plugin">
      <allow roles="WebAdmins, Administrators" />
      <deny users="*" />

Bug or working as intended? I don't know, but it's important to keep in mind either way.

By the way, I'm trying out a new syntax hightlighter. Like it? It's this one. The old one is still available as well, but it seems to be more happening with this one.

blog comments powered by Disqus