While playing with your beautiful framework I found a critical security issue which allows to do a directory traversal attack. It is possible to download and delete files on the server.
For example, to download the web.config you can call
http://demo.wisej.com/desktop/resource.wx/web.config
or
http://demo.wisej.com/desktop/download.wx?x=eyJmaWxlIjoid2ViLmNvbmZpZyIsIm5hbWUiOiJ3ZWIuY29uZmlnIiwiZGVsZXRlIjpmYWxzZX0=
Using the download.wx an attacker needs to know that the x-parameter is a base64 encoded string. The decoded example above is {“file”:”web.config”,”name”:”web.config”,”delete”:false}
To delete an file an attacker needs to change the delete property to true.
Maybe the resource.wx should only allows files from specific whitelisted folder. The download.wx should use a token generated per session by Application.Download to avoid an information disclosure.
best regards
Bernhard
Thank you again. There was something that didn’t feel right about those callbacks…
This is how we solved it:
Please note that these restrictions only apply to files and resources managed by Wisej. Any common file/image request will always go through the browser.
When any of the conditions above fails, wisej returns 404 (not found).
We will keep checking for any additional potential unsafe resource access.
/Luca
Hi
Some way to allow other types inside wisej extension? Or another approach/advice?
I trying to make a extension that uses url inside embeded css like:
…/resource.wx/Wisej.Web.Ext.Foo/WiseJ.Web.Ext.Foo.FontAwesome.otf
But some resources doesnt work, like embeded resource fonts or others embeded files like PDF
pdf, eot, otf, ttf, woff, woff2 etc…
Thanks in advance!
Bernhard,
this has been logged as WJ-7254 and already fixed in the nightly build (1.1.90.0), the way Luca described it.
Best regards
Frank
Hi Bernhard,
thanks for bringing this our attention. I have logged this security as WJ-7254 and we will adress it asap.
I will post an answer when it is fixed.
Best regards
Frank Boettcher