Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Due to wrong regex shvl is still vulnerable to prototype pollution #36

Merged
merged 3 commits into from
May 2, 2022

Conversation

vrechson
Copy link
Contributor

As I reported here: https://www.huntr.dev/bounties/2-other-robinvdvleuten/shvl/, shvl is still vulnerable to prototype pollution. I believe that changing !/^(__proto__|constructor|prototype)$/ to !/(__proto__|constructor|prototype)/ is enough to solve the problem but i prefer to keep it open to discussion

@robinvdvleuten
Copy link
Owner

Yes your correct @vrechson, the regex was insufficient. Could you add an additional testcase as well?

@vrechson
Copy link
Contributor Author

vrechson commented May 31, 2021

Yes your correct @vrechson, the regex was insufficient. Could you add an additional testcase as well?

Yes, of course! I'll came up with complete test cases in the next few days.

@vrechson
Copy link
Contributor Author

vrechson commented Jun 2, 2021

Hi @robinvdvleuten, this should be enough

@vrechson
Copy link
Contributor Author

vrechson commented Jun 2, 2021

Hi, I also read the discussion in this pull request that led to the wrong fix and saw that some people pointed that if we simple remove ^ and $ this would also make shvl stop working with paths like a.b.myconstructor and a.___proto___.b (three underscores). In order to not break the result in cases like these I proposed a better fix and added two new test cases.

@Ancient-Dragon
Copy link

Hey guys, is there any update on this PR?

@vrechson
Copy link
Contributor Author

@Ancient-Dragon still waiting for @robinvdvleuten revision

@robinvdvleuten robinvdvleuten merged commit 85b59f9 into robinvdvleuten:master May 2, 2022
@robinvdvleuten
Copy link
Owner

Thanks @vrechson!

@robinvdvleuten
Copy link
Owner

@all-contributors please add @vrechson for code

@allcontributors
Copy link
Contributor

@robinvdvleuten

I've put up a pull request to add @vrechson! 🎉

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants