andrewdavey/cassette — Issue #185: File disclosure vulnerability in RawFileRequestHandler
Author: SLaks
Created: 2012-02-20 19:28:52+00:00
State: open

RawFileRequestHandler is used to served cached and versioned copies of image / font files referenced by CSS files.

However, it does no path validation, so it can be used to read any source file in the website.

To fix this, Cassette.Web should maintain a whitelist of allowed RawFile paths.
This should be pre-populated with all AssetReferences from registered bundles.
It should also be extensible to allow people to [use cached files indepedently](https://github.com/andrewdavey/cassette/issues/173).
That should probably look something like

CassetteConfiguration.AllowRawFile(string path, IFileSearch fileSearch = null)

where `path` can be a file or a directory.