5 ms·
Thanks for pointing this out. Fixed this particular bug!
by asadlionpk 8y ago
Thanks for pointing this out. Fixed this particular bug!
- q3k 8y agoYou also need to report this to security@npmjs.com so they post an advisory [1] and mark the existing versions as vulnerable. [1] - https://www.npmjs.com/advisories https://www.npmjs.com/advisories
- wesleytodd 8y agoSeems like your fix[1] for this is a bit fast. You are already importing `path` in that file. Also, you can do this with just one `path.relative`. Lastly, the url package method you are using is deprecated[2]. [1] https://github.com/remoteinterview/zero/commit/b4af5325c388e21a9bba4c9305c9a61693c73578 https://github.com/remoteinterview/zero/commit/b4af5325c388e... [2] https://nodejs.org/api/url.html#url_legacy_url_api https://nodejs.org/api/url.html#url_legacy_url_api
- hombre_fatal 8y agoA simpler fix might be to canonicalize (i.e. no "..") the public folder path and the requested file path and then ensure the public path is a prefix of the other.
- Kalium 8y agoAny fix also needs to be sure to resolve any symlinks before doing a prefix check.
- the_mitsuhiko 8y agoThis fix does not even work on windows. You can still request data on a different drive.