Skip to content

Big Security Issue! StaticFilesModule allows access to ANY file on harddrive. #68

@MarcusWichelmann

Description

@MarcusWichelmann

There is a very big security flaw in the StaticFilesModule class because of the use of Path.combine().
See: https://github.com/unosquare/embedio/blob/master/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs#L212
This method returns only the second (user-defined) parameter when the second parameter is something like C:/.... Thanks to this it's possible to download more or less any file that's stored on the pc the webserver runs on which is very bad.

Also see this stackoverflow-answer, where I've posted further information: http://stackoverflow.com/questions/1321466/securely-enforcing-user-input-file-paths-within-subdirectories/42543716#42543716

Sample code:

WebServer server = new WebServer(5555);
server.RegisterModule(new StaticFilesModule("R:/HTML/"));
server.Module<StaticFilesModule>().UseGzip = true;
server.Module<StaticFilesModule>().UseRamCache = false;

For example it's possible to download a list of all recently used FileZilla credentials this way:
4afcc22993d1a36cb99938ff9f902fb1

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions