Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

**No bounty** Fix Path traversal vulnerability on Snek Serv #2

Closed
wants to merge 1 commit into from

Conversation

alromh87
Copy link

@alromh87 alromh87 commented Sep 22, 2020

📊 Metadata *

Bounty was not set but still worth fixing and send trough huntr

The snekserve project is a directory listing server which is vulnerable against Directory Traversal, which may allow access to sensitive files and data on the server.
For example, requesting the following URL: /../../etc/passwd would result in /etc/passwd leaking.

Bounty URL: No bounty, just to get it fixed

⚙️ Description *

There is no path sanitization in the path provided making marscode vulnerable against path traversal through the ../ technique, leading to information exposure and file content disclosure.

💻 Technical Description *

Fixed by sanitizing any occurrence of ../, using regexp.

🐛 Proof of Concept (PoC) *

  1. Start the server
    node index.js
  2. Request private file from server
    curl -v --path-as-is http://127.0.0.1:8080/../../../../../../../../../../../etc/passwd
  3. /etc/passwd will be displayed.

SnekServPOC

Proof of Fix (PoF) *

After fix Response code 400 Bad request is returned to user instead of restricted file conten

👍 User Acceptance Testing (UAT)

After fix functionality is unafected

Copy link

@bbeale bbeale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@Mik317 Mik317 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😄 🍰
Sorry for the late reply

Cheers,
Mik

Copy link

@mufeedvh mufeedvh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏🎉

@alromh87 alromh87 closed this Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants