lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.2k stars 85 forks source link

Middleware error: BadRequestError: Malicious Path problem #77

Closed hungtruongquoc closed 6 years ago

hungtruongquoc commented 6 years ago

I ran 'ws -s index.html' and I got the error:

BadRequestError: Malicious Path at resolvePath (/usr/lib/node_modules/local-web-server/node_modules/resolve-path/index.js:77:11) at send (/usr/lib/node_modules/local-web-server/node_modules/koa-send/index.js:68:10) at serve (/usr/lib/node_modules/local-web-server/node_modules/koa-static/index.js:44:24) at dispatch (/usr/lib/node_modules/local-web-server/node_modules/koa-compose/index.js:42:32) at next (/usr/lib/node_modules/local-web-server/nodemodules/koa-compose/index.js:43:18) at Object..get (/usr/lib/node_modules/local-web-server/node_modules/lws-spa/index.js:35:18) at /usr/lib/node_modules/local-web-server/node_modules/koa-route/index.js:39:44 at dispatch (/usr/lib/node_modules/local-web-server/node_modules/koa-compose/index.js:42:32) at next (/usr/lib/node_modules/local-web-server/node_modules/koa-compose/index.js:43:18) at etag (/usr/lib/node_modules/local-web-server/node_modules/koa-etag/index.js:26:12)

This is the detail of the request

image

The local-web-server was an internal server and the requests redirected from a Apache proxy server. The following rules are used for the proxy

ProxyPass "/static" "http://localhost:8000/"

ProxyPassReverse "/static/" "http://localhost:8000"

75lb commented 6 years ago

This is not a local-web-server issue. See here for common Malicious Path causes.

Try running ws with the verbose flag to get more insight:

$ ws --verbose
75lb commented 6 years ago

also, see the resolve-path README for more info regarding which paths are considered "malicious".

hungtruongquoc commented 6 years ago

Thanks for quick reply and details :)