You can strengthen the security of your Sitecore installation if you deny script and execute permissions for the upload folder.
This topic outlines how to:
- Deny Script and Execute permissions to for the upload folder
- Disable the Upload Watcher
- Prevent a user from uploading certain file types
Deny Script and Execute permissions for the upload folder
If you allow users to modify the content of the upload
To avoid this, you can deny permissions to run scripts and executable files in the upload folder and thereby prevent an uploaded file from being executed on the server side when a user attempts to download it.
You only need to perform this step if your configuration allows content authors to place files directly in the upload
For more information, see the Microsoft website.
To deny both Script and Execute permissions for the upload folder.
- Open the Internet Information Services (IIS) manager.
- Navigate to and click the upload
- In the Actions pane, click Edit Feature Permissions.
- In the Edit Feature Permissions dialog box, clear the Script and Execute check boxes and click OK.
If your configuration allows content authors to place files directly in the temp folder, for example, using a shared directory or an FTP server, you should also deny users Script and Execute permissions for the temp
This also helps to avoid potential security problems, for example, if
.aspx files are saved in the temp folder (for example, from custom code).
Disable the Upload Watcher
To ensure that the only way to upload files to Sitecore is from the Media Library, you should disable the Upload Watcher. This means that you can only upload files from within the Sitecore client and have control over the files that are uploaded.
When you disable the Upload Watcher, files that are placed in the upload folder are not automatically uploaded to the Media Library.
To disable the Upload Watcher:
- Open the
web.configfile and remove the following string from the
<add type="Sitecore.Resources.Media.UploadWatcher,Sitecore.Kernel" name="SitecoreUploadWatcher"/>
Prevent a user from uploading certain file types
If you want to have complete control and prevent users from uploading certain file types, for example,
.dll, you can use the Upload Filter tool.
Download and install the Upload Filter tool
The Upload Filter tool is a Sitecore package that you can download.
The Upload Filter tool contains the following files:
To install the Upload Filter tool:
- On the Sitecore Launchpad, click Control Panel.
- Under the Administration section, click Install a Package.
- Follow the steps in the wizard to first download the package and then install it.
Configure the Upload Filter tool
After you install the Upload Filter tool, you must configure it.
To configure the Upload Filter tool:
- Open the
<processor mode="on" type="Sitecore.Pipelines.Upload.CheckExtension, Sitecore.UploadFilter" patch:before="*">
<param desc="Allowed extensions (comma separated)"></param>
<param desc="Blocked extensions (comma separated)">exe,dll</param>
- To prevent users from uploading certain file types:
- In the
Allowed extensionsparameter, enter a comma-separated list of the file extension types that can be uploaded.
- In the
Blocked extensionsparameter, enter a comma-separated list of the file extension types that cannot be uploaded.
You must enter the file extension without the dot.
If you try to upload a file type that is on the blocked list, you see the following message:
- In the
After you install the Upload Filter tool, the Upload dialog can freeze if an errors occurs during the upload process. This is a known issue for which there is a solution.