Lurker News
Back to discussion

Comment by q3k

q3k4 replies#
Putting my money where my mouth is - use this to leak any file accessible by the running user of zero from the filesystem:

    # curl -v --path-as-is 127.0.0.1:3000/../../../../../etc/passwd
    root:x:0:0:root:/root:/bin/bash
    [...]
asadlionpk2 replies#
Thanks for pointing this out. Fixed this particular bug!
q3k1 reply#
You 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

Sephr3 replies#
Anyone, including yourself can do that.

Continue this thread — 3 replies

hombre_fatal1 reply#
A 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.

Continue this thread — 1 reply

the_mitsuhiko#
This fix does not even work on windows. You can still request data on a different drive.
IshKebab1 reply#
I don't think I would use any package that makes this classic mistake in 2019. Web services need to be at least vaguely secure and this destroys all my confidence of that.
cmroanirgo1 reply#
You would've thought OP posting to HN should've considered security backlash. Unfortunately, damage is done for me too.
asadlionpk4 replies#
This was fixed literally the minute it was commented here. Securing any project is always a long-term and continuous effort.

This project is brand new, I posted the repo publicly this morning. I frankly think this subthread is an overreaction. I don’t get the hate.

Continue this thread — 4 replies

brianberns#
Hah. Now that’s a Zero day Zero server exploit. :)
johnpipi#
can just put some logic to set the root directory where can start to include from?