Re:Show HN: Serve Static GitHub Pages Locally
by csunbird on Wednesday January 30, 2019 @02:37AM
(#19033363)
Did you test it against relative path(s) ? For example, what if "../" is included in the file path ? It can be used to escape the root folder and traverse arbitrarily in the host file system.
[ Parent
| on HN ]
Re:Show HN: Serve Static GitHub Pages Locally
by clusmore on Wednesday January 30, 2019 @03:16AM
(#19033507)
That's a great question. Although I don't encourage anybody to expose this to any network they don't trust, it was a concern. I was previously passing the incoming path directly to ServeFile[1] which handles this, although I have since put in a filepath.Clean... I've tested this in browsers and with curl and it looks okay, I'll take a closer look at this though.