Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Fix for Path Traversal - huntr.dev #280

Closed
wants to merge 15 commits into from

Conversation

huntr-helper
Copy link

https://huntr.dev/users/alromh87 has fixed the Path Traversal vulnerability 馃敤. alromh87 has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 馃挼. Think you could fix a vulnerability like this?

Get involved at https://huntr.dev/

Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#4
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/superstatic/2/README.md

User Comments:

馃搳 Metadata *

Still valid as it fixes a Vulnerability after proposed fix #2

Creating a symlink to a directory could allow acces to system files, proposed fix handles symlinked files but not directories

Bounty URL: https://www.huntr.dev/bounties/2-npm-superstatic

鈿欙笍 Description *

Path is tested for symlinked directories, in case it is request is denied

馃捇 Technical Description *

If symlink filter is enabled and file is not symlink every directory in the path, starting from base directory, is tested to be symlink, in positive case request is denied

馃悰 Proof of Concept (PoC) *

1)Install the Superstatic module
$ npm install -g superstatic

2)Make a directory
$ mkdir test

3)Go to 'test' directory
$ cd test

4)create a symlink file to directory
ln -s /etc/ 'dirname'

5)Run Superstatic module
$ Superstatic

6)Request the file within browser
http://localhost:3474/'dirname'/'regularfile'
http://localhost:3474/poc/passwd

7)Content of file is returned to browser

馃敟 Proof of Fix (PoF) *

After fix error page is shown

馃憤 User Acceptance Testing (UAT)

Original functionality unafected

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

鈩癸笍 Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Oct 9, 2020

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

鈩癸笍 Googlers: Go here for more info.

@JamieSlome
Copy link

@alromh87 - would you be able to sign the CLA? 馃嵃

@alromh87
Copy link

alromh87 commented Oct 10, 2020

@googlebot I consent.

@google-cla
Copy link

google-cla bot commented Oct 10, 2020

CLAs look good, thanks!

鈩癸笍 Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

鈩癸笍 Googlers: Go here for more info.

@alromh87
Copy link

@JamieSlome Sure, is this the right way? #280 (comment)

@JamieSlome
Copy link

@alromh87 - all done. Thanks! 馃嵃

@bkendall
Copy link
Collaborator

Duplicate of #275

@bkendall bkendall marked this as a duplicate of #275 Aug 30, 2022
@bkendall bkendall closed this Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic server restart on file/dir change/add/delete
6 participants